瀏覽代碼

Print invoices without links, and give their cells room

A printed invoice carried two live links into the PDF: the post title
from post_title.tx and the series tag from post_tags.tx.  Both point at
the backoffice, which a client cannot reach.  The invoice now hides both
in print and prints a plain copy of the title instead.  The new
printonly class is hidden by screen.css, so it shows only in print.

The invoice table cells had no padding, so the lines ran together.  They
now get padding, a line height of 1.5, and top alignment, from
structure.css, which loads for both screen and print.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
George Baugh 1 周之前
父節點
當前提交
81c2b9f759
共有 3 個文件被更改,包括 14 次插入 和 1 次删除
  1. 4 0
      www/styles/screen.css
  2. 6 0
      www/styles/structure.css
  3. 4 1
      www/templates/html/components/forms/invoice.tx

+ 4 - 0
www/styles/screen.css

@@ -541,3 +541,7 @@ pre {
     font-weight: normal;
     opacity: .7;
 }
+
+.printonly {
+    display: none;
+}

+ 6 - 0
www/styles/structure.css

@@ -161,3 +161,9 @@ iframe.responsive {
 		display: none;
 	}
 }
+
+.invoice .table-cell {
+    padding: .5rem .25rem;
+    line-height: 1.5;
+    vertical-align: top;
+}

+ 4 - 1
www/templates/html/components/forms/invoice.tx

@@ -1,14 +1,17 @@
 <div class="post <: $style :>">
     :if ( !$post.addpost ) {
+        <div class="noprint">
         : include "post_title.tx";
         : include "post_tags.tx";
+        </div>
+        <h3 class="blogtitles printonly"><: $post.title :></h3>
 
         : if ( !$post.video_href && !$post.is_image && !$post.is_video && !$post.is_profile && $post.preview ) {
             <img src="<: $post.preview :>" class="responsive-img" loading="lazy" />
         : }
 
         <div class="postData responsive-text" id="postData-<: $post.id :>">
-            <div class="table">
+            <div class="table invoice">
                 <div class="table-row">
                     <div class="table-cell">
                         Invoice ID# <: $post.id :><br />