[PATCH v3 6/8] nmbug-status: Add inter-message padding

Subject: [PATCH v3 6/8] nmbug-status: Add inter-message padding

Date: Thu, 13 Feb 2014 08:47:21 -0800

To: notmuch@notmuchmail.org

Cc: Tomi Ollila

From: W. Trevor King


We already had the tbody with a blank row separating threads (which is
not colored); this commit adds a bit of spacing to separate messages
within a thread.  It will also add a bit of colored padding above the
first message and below the final message, but the main goal is to add
padding *between* two-row message blocks.

                                               <--- new padding
  thread-1, message-1, row-1  (class="message-first")
  thread-1, message-1, row-2  (class="message-last")
                                               <--- new padding
    spacer tbody with a blank row
                                               <--- new padding
  thread-2, message-1, row-1  (class="message-first")
  thread-2, message-1, row-2  (class="message-last")
                                               <--- new padding
                                               <--- new padding
  thread-2, message-2, row-1  (class="message-first")
  thread-2, message-2, row-2  (class="message-last")
                                               <--- new padding
---
 devel/nmbug/nmbug-status | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
index 57eec6c..9ad7d35 100755
--- a/devel/nmbug/nmbug-status
+++ b/devel/nmbug/nmbug-status
@@ -208,11 +208,11 @@ class HtmlPage (Page):
             stream.write('  <tbody>\n')
             for message_display_data in thread:
                 stream.write((
-                    '    <tr>\n'
+                    '    <tr class="message-first">\n'
                     '      <td>{date}</td>\n'
                     '      <td><code>{message-id-term}</code></td>\n'
                     '    </tr>\n'
-                    '    <tr>\n'
+                    '    <tr class="message-last">\n'
                     '      <td>{from}</td>\n'
                     '      <td>{subject}</td>\n'
                     '    </tr>\n'
@@ -256,6 +256,12 @@ _PAGES['html'] = HtmlPage(
     table {{
       border-spacing: 0;
     }}
+    tr.message-first td {{
+      padding-top: {inter_message_padding};
+    }}
+    tr.message-last td {{
+      padding-bottom: {inter_message_padding};
+    }}
     td {{
       padding-left: {border_radius};
       padding-right: {border_radius};
@@ -288,6 +294,7 @@ For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>
 </p>
 <h3>Views</h3>
 '''.format(date=datetime.datetime.utcnow().date(),
+           inter_message_padding='0.25em',
            border_radius='0.5em'),
     footer='</body>\n</html>\n',
     )
-- 
1.8.5.2.8.g0f6c0d1


Thread: