changeset 1206:19e7e10e0dd0

Some more improvement in diff presentation, also changed revisions with empty comment's titles.
author Shitiz Garg <mail@dragooon.net>
date Fri, 06 Jan 2012 08:58:28 +0530
parents b76652381200
children af3fdd4c34e2
files MoinMoin/apps/feed/views.py MoinMoin/templates/atom.html MoinMoin/templates/diff_text_atom.html
diffstat 3 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/feed/views.py	Fri Jan 06 08:17:57 2012 +0530
+++ b/MoinMoin/apps/feed/views.py	Fri Jan 06 08:58:28 2012 +0530
@@ -78,7 +78,7 @@
                     content = hl_item._render_data_diff_atom(previous_rev, this_rev)
                 else:
                     # full html rendering for new items
-                    content = render_template('atom.html', get='first_revision', content=Markup(hl_item._render_data()))
+                    content = render_template('atom.html', get='first_revision', content=hl_item._render_data(), revision=this_revid)
                 content_type = 'html'
             except Exception as e:
                 logging.exception("content rendering crashed")
@@ -86,7 +86,7 @@
                 content_type = 'text'
             rev_comment = rev.meta.get(COMMENT, '')
             if not rev_comment:
-                rev_comment = _(u'(No comment)')
+                rev_comment = _(u'Revision: {0}').format(this_revid[0:7])
             else:
                 # Trim down extremely long revision comment
                 if len(rev_comment) > 80:
--- a/MoinMoin/templates/atom.html	Fri Jan 06 08:17:57 2012 +0530
+++ b/MoinMoin/templates/atom.html	Fri Jan 06 08:58:28 2012 +0530
@@ -3,5 +3,8 @@
 {%- elif get == 'comment_cont_merge' -%}
     <p style="font-size: 14px">...{{ comment }}</p> <br /> {{ content }}
 {%- elif get == 'first_revision' -%}
-    <p><i>{{ _('First revision') }}</i></p><br />{{ content }}
+    <div class="moin-diff-info moin-diff-info-rev-id">
+        <span class="moin-diff-info-caption"><strong>Revision: {{ revision | shorten_id }}</strong> - <i>{{ _('First revision') }}</i></span>
+    </div>
+    <div style="background-color: #cfc"><blockquote>{{ content }}</blockquote></div>
 {%- endif -%}
\ No newline at end of file
--- a/MoinMoin/templates/diff_text_atom.html	Fri Jan 06 08:17:57 2012 +0530
+++ b/MoinMoin/templates/diff_text_atom.html	Fri Jan 06 08:58:28 2012 +0530
@@ -6,7 +6,6 @@
         <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_id }}</span>
     </div>
 {% endmacro %}
-
 <table class="moin-diff" style="width: 100%;">
     <tr>
         <td class="moin-diff-header-line" style="width: 3%;">
@@ -22,9 +21,13 @@
     {% for llineno, lcontent, rlineno, rcontent in diffs %}
         <tr>
             <td style="vertical-align: top;"><a href="#{{ llineno }}">{{ llineno }}:</a></td>
-            <td class="moin-diff-removed" style="vertical-align: top; background-color: lightYellow; word-wrap: break-word;"><blockquote>{{ lcontent }}</blockquote></td>
+            <td class="moin-diff-removed" style="vertical-align: top; background-color:#ff9; word-wrap: break-word;"><blockquote>{{ lcontent }}</blockquote></td>
             <td style="vertical-align: top;"><a href="#{{ rlineno }}">{{ rlineno }}:</a></td>
-            <td class="moin-diff-added" style="vertical-align: top; background-color: #E0FFE0; word-wrap: break-word;"><blockquote>{{ rcontent }}</blockquote></td>
+            <td class="moin-diff-added" style="vertical-align: top; background-color: #cfc; word-wrap: break-word;"><blockquote>{{ rcontent }}</blockquote></td>
         </tr>
     {% endfor %}
 </table>
+<style type="text/css">
+    .moin-diff-added span { background-color: #80FF80; }
+    .moin-diff-removed span { background-color: #FFFF80; }
+</style>