Commits

Shitiz Garg committed 19e7e10

Some more improvement in diff presentation, also changed revisions with empty comment's titles.

Comments (0)

Files changed (3)

MoinMoin/apps/feed/views.py

                     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")
                 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:

MoinMoin/templates/atom.html

 {%- 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 -%}

MoinMoin/templates/diff_text_atom.html

         <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%;">
     {% 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>