deadfoxjunction: Use custom formatting for recentchangens entries.
[matthijs/projects/wipi.git] / plugin / theme / deadfoxjunction.py
index 13929c791fec2563608bf0a37d77cd159d88d6c3..4a363332d02980af1f24c07b09ec2a4fae7f1fdd 100644 (file)
@@ -22,3 +22,54 @@ class Theme(SiteTheme):
        html = SiteTheme.endPage(self, d)
        html += u'</div><!-- #window -->\n'
        return html
+
+    def recentchanges_entry(self, d):
+        """
+        Assemble a single recentchanges entry (table row)
+
+        Based on the same function from ThemeBase, but with the comment
+        on a second table row, since the available horizontal space in
+        this theme is fairly limited.
+
+        @param d: parameter dictionary
+        @rtype: string
+        @return: recentchanges entry html
+        """
+        _ = self.request.getText
+        html = []
+        html.append('<tr>\n')
+
+        html.append('<td class="rcicon1">%(icon_html)s</td>\n' % d)
+
+        html.append('<td class="rcpagelink">%(pagelink_html)s</td>\n' % d)
+
+        html.append('<td class="rctime">')
+        if d['time_html']:
+            html.append("%(time_html)s" % d)
+        html.append('</td>\n')
+
+        html.append('<td class="rcicon2">%(info_html)s</td>\n' % d)
+
+        html.append('<td class="rceditor">')
+        if d['editors']:
+            html.append('<br>'.join(d['editors']))
+        html.append('</td>\n')
+        html.append('</tr>\n')
+        html.append('<tr>\n')
+
+        html.append('<td colspan="5" class="rccomment">')
+        if d['comments']:
+            if d['changecount'] > 1:
+                notfirst = 0
+                for comment in d['comments']:
+                    html.append('%s<tt>#%02d</tt>&nbsp;%s' % (
+                        notfirst and '<br>' or '', comment[0], comment[1]))
+                    notfirst = 1
+            else:
+                comment = d['comments'][0]
+                html.append('%s' % comment[1])
+        html.append('</td>\n')
+
+        html.append('</tr>\n')
+
+        return ''.join(html)