database error
[notmuch-archives.git] / 32 / 2e9fda7fea45f4adc6ad54a48175ddf9b5a7b7
1 Return-Path: <wking@tremily.us>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 0ED6E429E39\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 03:01:22 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
13         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id 3SwRkF6JHdFF for <notmuch@notmuchmail.org>;\r
18         Mon,  3 Feb 2014 03:01:15 -0800 (PST)\r
19 Received: from qmta09.westchester.pa.mail.comcast.net\r
20         (qmta09.westchester.pa.mail.comcast.net [76.96.62.96])\r
21         by olra.theworths.org (Postfix) with ESMTP id 5ED83431FDB\r
22         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 03:00:47 -0800 (PST)\r
23 Received: from omta06.westchester.pa.mail.comcast.net ([76.96.62.51])\r
24         by qmta09.westchester.pa.mail.comcast.net with comcast\r
25         id Mn0E1n00516LCl059n0myQ; Mon, 03 Feb 2014 11:00:46 +0000\r
26 Received: from odin.tremily.us ([24.18.63.50])\r
27         by omta06.westchester.pa.mail.comcast.net with comcast\r
28         id Mn0l1n00p152l3L3Sn0mjA; Mon, 03 Feb 2014 11:00:46 +0000\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
30         by odin.tremily.us (Postfix) with ESMTPS id A2D49FB4D63;\r
31         Mon,  3 Feb 2014 03:00:45 -0800 (PST)\r
32 Received: (nullmailer pid 716 invoked by uid 1000);\r
33         Mon, 03 Feb 2014 10:59:42 -0000\r
34 From: "W. Trevor King" <wking@tremily.us>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 17/17] nmbug-status: Color threads in HTML output\r
37 Date: Mon,  3 Feb 2014 02:59:35 -0800\r
38 Message-Id:\r
39  <d1dcf421ebf092e0e247acaedd6a0d0168b83073.1391424512.git.wking@tremily.us>\r
40 X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
41 In-Reply-To: <cover.1391424512.git.wking@tremily.us>\r
42 References: <cover.1391424512.git.wking@tremily.us>\r
43 In-Reply-To: <cover.1391424512.git.wking@tremily.us>\r
44 References: <cover.1391424512.git.wking@tremily.us>\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
46         s=q20121106; t=1391425246;\r
47         bh=rB6hcxHENRH544GZz+amuY/2PGFzSEfouPR2fTv1f90=;\r
48         h=Received:Received:Received:Received:From:To:Subject:Date:\r
49         Message-Id;\r
50         b=mtD4FNMjii2Dvx5jEvD0obzqj8C0XjDzZOrW48wv6GbZF+/mU6XbAxyd0myKyBvIT\r
51         0RusQZpSHrN6NJoTWl54I6/eLKQRxrynMHJij1O6yrXhQnRpbwszEQcTtIm4Tu/BZP\r
52         +HZT02BjrODm38JtC4EQpZPNbx1tIEGqkgyBQczv8OcVd2QNzO5UgW3NnnN0pLjwy/\r
53         8MmHXPuHMgvHMNnm1WfXK5Dwa7UuwwRm67nkJQefTPIQNUKl/3MWc5a5kI8w6L03OE\r
54         +UiiXB5tgVryuz56F3i4DREkwQd10wdY6bRrmkiiAH1DLuW6Qg4/NsY28K5CrBck3J\r
55         STIUKCiORFjKg==\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Mon, 03 Feb 2014 11:01:22 -0000\r
69 \r
70 Add tbody sections so we don't have to color every row.  Multiple\r
71 tbody sections are allowed [1].  Use CSS 3's nth-child to handle\r
72 even/odd coloring (skipping the spacer rows) [2], which is supported\r
73 on the major browsers [3].\r
74 \r
75 border-spacing is from CCS 2.1 [4,5].  I'm using it to avoid\r
76 whitespace between td cells.\r
77 \r
78 border-radius is from CCS 3 [6,7].  I'm using it to make the colored\r
79 sections a bit less harsh.  I tried adding rounded borders to the\r
80 tbody itself doesn't work, but I couldn't get that to work without\r
81 setting the tbody's display to 'block'.  That rounded the corners, but\r
82 collapsed the cell spacing (e.g. columns were no longer aligned).\r
83 This commit's by-corner-td approach is not particularly elegant, but\r
84 it works.  The td padding entries just ensure that the cell body is\r
85 suitably far from the edges that it doesn't fall outside of the\r
86 rounded corners.\r
87 \r
88 The doubled-braces are escapes from Python's str.format.\r
89 \r
90 [1]: http://www.w3.org/TR/html5/tabular-data.html#the-table-element\r
91 [2]: http://www.w3.org/TR/css3-selectors/#nth-child-pseudo\r
92 [3]: https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child#Browser_compatibility\r
93 [4]: http://www.w3.org/TR/CSS2/tables.html#propdef-border-spacing\r
94 [5]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-spacing#Browser_compatibility\r
95 [6]: http://www.w3.org/TR/css3-background/#the-border-radius\r
96 [7]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius#Browser_compatibility\r
97 ---\r
98  devel/nmbug/nmbug-status | 52 ++++++++++++++++++++++++++++++++++++++----------\r
99  1 file changed, 41 insertions(+), 11 deletions(-)\r
100 \r
101 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
102 index 21fb481..f1adf65 100755\r
103 --- a/devel/nmbug/nmbug-status\r
104 +++ b/devel/nmbug/nmbug-status\r
105 @@ -183,19 +183,22 @@ class HtmlPage (Page):\r
106              return\r
107          stream.write('<table>\n')\r
108          for thread in threads:\r
109 +            stream.write('  <tbody>\n')\r
110              for message_display_data in thread:\r
111                  stream.write((\r
112 -                    '<tr>\n'\r
113 -                    '  <td>{date}</td>\n'\r
114 -                    '  <td><code>{message-id-term}</code></td>\n'\r
115 -                    '</tr>\n'\r
116 -                    '<tr>\n'\r
117 -                    '  <td>{from}</td>\n'\r
118 -                    '  <td>{subject}</td>\n'\r
119 -                    '</tr>\n'\r
120 +                    '    <tr>\n'\r
121 +                    '      <td>{date}</td>\n'\r
122 +                    '      <td><code>{message-id-term}</code></td>\n'\r
123 +                    '    </tr>\n'\r
124 +                    '    <tr>\n'\r
125 +                    '      <td>{from}</td>\n'\r
126 +                    '      <td>{subject}</td>\n'\r
127 +                    '    </tr>\n'\r
128                      ).format(**message_display_data))\r
129 +            stream.write('  </tbody>\n')\r
130              if thread != threads[-1]:\r
131 -                stream.write('<tr><td colspan="2"><br /></td></tr>\n')\r
132 +                stream.write(\r
133 +                    '  <tbody><tr><td colspan="2"><br /></td></tr></tbody>\n')\r
134          stream.write('</table>\n')\r
135  \r
136      def _message_display_data(self, *args, **kwargs):\r
137 @@ -218,8 +221,35 @@ _PAGES['html'] = HtmlPage(\r
138      header='''<!DOCTYPE html>\r
139  <html lang="en">\r
140  <head>\r
141 -<meta http-equiv="Content-Type" content="text/html; charset={encoding}" />\r
142 -<title>Notmuch Patches</title>\r
143 +  <meta http-equiv="Content-Type" content="text/html; charset={encoding}" />\r
144 +  <title>Notmuch Patches</title>\r
145 +  <style media="screen" type="text/css">\r
146 +    table {{\r
147 +      border-spacing: 0;\r
148 +    }}\r
149 +    td {{\r
150 +      padding-left: 1em;\r
151 +      padding-right: 1em;\r
152 +    }}\r
153 +    tr:first-child td:first-child {{\r
154 +      border-top-left-radius: 1em;\r
155 +    }}\r
156 +    tr:first-child td:last-child {{\r
157 +      border-top-right-radius: 1em;\r
158 +    }}\r
159 +    tr:last-child td:first-child {{\r
160 +      border-bottom-left-radius: 1em;\r
161 +    }}\r
162 +    tr:last-child td:last-child {{\r
163 +      border-bottom-right-radius: 1em;\r
164 +    }}\r
165 +    tbody:nth-child(4n+1) tr td {{\r
166 +      background-color: #EFF;\r
167 +    }}\r
168 +    tbody:nth-child(4n+3) tr td {{\r
169 +      background-color: #FEF;\r
170 +    }}\r
171 +  </style>\r
172  </head>\r
173  <body>\r
174  <h2>Notmuch Patches</h2>\r
175 -- \r
176 1.8.5.2.8.g0f6c0d1\r
177 \r