changeset 2935:453a66b219ab

Fixes #503 Added time in item diff
author Aabhas Majumdar <majumdaraabhas@gmail.com>
date Sun, 08 Mar 2015 21:01:25 +0530
parents e2b5a79a1e06
children cd48671a0488
files MoinMoin/templates/atom.html MoinMoin/templates/diff_text.html MoinMoin/templates/diff_text_atom.html MoinMoin/templates/utils.html
diffstat 4 files changed, 50 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/templates/atom.html	Sun Mar 08 20:57:53 2015 +0530
+++ b/MoinMoin/templates/atom.html	Sun Mar 08 21:01:25 2015 +0530
@@ -1,18 +1,4 @@
 {% import "utils.html" as utils %}
-{% macro show_meta(rev) %}
-    <div class="moin-diff-info moin-diff-info-rev-id">
-        <span class="moin-diff-info-caption">{{ _('Revision') }}:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_id }}</span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-size">
-        <span class="moin-diff-info-caption">{{ _('Size') }}:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['size'] }}</span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-comment">
-        <span class="moin-diff-info-caption">{{ _('Comment') }}:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['comment'] }}</span>
-    </div>
-{% endmacro %}
 
 {# A few style rules to ensure the content doesn't overflow #}
 {% macro atom_style() %}
@@ -39,7 +25,7 @@
     <table class="moin-diff" cellpadding="10" width="100%">
         <tr>
             <td class="moin-diff-header" style="width: 100%;">
-                <strong>{{ show_meta(rev) }}</strong>
+                <strong>{{ utils.show_meta(rev) }}</strong>
             </td>
         </tr>
     </table>
@@ -50,10 +36,10 @@
     <table class="moin-diff" cellpadding="10" width="100%">
         <tr>
             <td class="moin-diff-header" style="width: 50%;">
-                <strong>{{ show_meta(oldrev) }}</strong>
+                <strong>{{ utils.show_meta(oldrev) }}</strong>
             </td>
             <td class="moin-diff-header" style="width: 50%;">
-                <strong>{{ show_meta(newrev) }}</strong>
+                <strong>{{ utils.show_meta(newrev) }}</strong>
             </td>
         </tr>
     </table>
--- a/MoinMoin/templates/diff_text.html	Sun Mar 08 20:57:53 2015 +0530
+++ b/MoinMoin/templates/diff_text.html	Sun Mar 08 21:01:25 2015 +0530
@@ -1,33 +1,12 @@
 {% import "utils.html" as utils %}
 
-{% macro show_meta(rev) %}
-    <div class="moin-diff-info moin-diff-info-rev-id">
-        <span class="moin-diff-info-caption">Revision:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_id }}</span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-author">
-        <span class="moin-diff-info-caption">Editor:</span>
-        <span class="moin-diff-info-value">
-            {{ utils.editor_info(rev.meta) }}
-        </span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-size">
-        <span class="moin-diff-info-caption">Size:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['size'] }}</span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-comment">
-        <span class="moin-diff-info-caption">Comment:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['comment'] }}</span>
-    </div>
-{% endmacro %}
-
 <table class="moin-diff">
     <tr>
         <td class="moin-diff-header">
-            {{ show_meta(oldrev) }}
+            {{ utils.show_meta(oldrev) }}
         </td>
         <td class="moin-diff-header">
-            {{ show_meta(newrev) }}
+            {{ utils.show_meta(newrev) }}
         </td>
     </tr>
     <tr>
--- a/MoinMoin/templates/diff_text_atom.html	Sun Mar 08 20:57:53 2015 +0530
+++ b/MoinMoin/templates/diff_text_atom.html	Sun Mar 08 21:01:25 2015 +0530
@@ -1,19 +1,5 @@
 {% import "utils.html" as utils %}
 
-{% macro show_meta(rev) %}
-    <div class="moin-diff-info moin-diff-info-rev-id">
-        <span class="moin-diff-info-caption">{{ _('Revision') }}:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['revid'] | shorten_id }}</span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-size">
-        <span class="moin-diff-info-caption">{{ _('Size') }}:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['size'] }}</span>
-    </div>
-    <div class="moin-diff-info moin-diff-info-rev-comment">
-        <span class="moin-diff-info-caption">{{ _('Comment') }}:</span>
-        <span class="moin-diff-info-value">{{ rev.meta['comment'] }}</span>
-    </div>
-{% endmacro %}
 <table class="moin-diff" style="width: 100%;">
     {% for llineno, lcontent, rlineno, rcontent in diffs %}
         <tr>
@@ -27,12 +13,12 @@
         <td class="moin-diff-header-line" style="width: 3%;">
         </td>
         <td class="moin-diff-header" style="width: 47%;">
-            <strong>{{ show_meta(oldrev) }}</strong>
+            <strong>{{ utils.show_meta(oldrev) }}</strong>
         </td>
         <td class="moin-diff-header-line" style="width: 3%;">
         </td>
         <td class="moin-diff-header" style="width: 47%;">
-            <strong>{{ show_meta(newrev) }}</strong>
+            <strong>{{ utils.show_meta(newrev) }}</strong>
         </td>
     </tr>
 </table>
--- a/MoinMoin/templates/utils.html	Sun Mar 08 20:57:53 2015 +0530
+++ b/MoinMoin/templates/utils.html	Sun Mar 08 21:01:25 2015 +0530
@@ -262,3 +262,46 @@
         {% endif %}
     </ul>
 {% endmacro %}
+
+{% macro show_meta(rev) %}
+    <div>
+        <span class="moin-diff-info-caption">
+            Revision:
+        </span>
+        <span class="moin-diff-info-value">
+            {{ rev.meta['revid'] | shorten_id }}
+        </span>
+    </div>
+    <div>
+        <span class="moin-diff-info-caption">
+            Editor:
+        </span>
+        <span class="moin-diff-info-value">
+            {{ editor_info(rev.meta) }}
+        </span>
+    </div>
+    <div>
+        <span class="moin-diff-info-caption">
+            Size:
+        </span>
+        <span class="moin-diff-info-value">
+            {{ rev.meta['size'] }}
+        </span>
+    </div>
+    <div>
+        <span class="moin-diff-info-caption">
+            Time:
+        </span>
+        <span class="moin-diff-info-value">
+            {{ rev.meta.mtime|datetimeformat }}
+        </span>
+    </div>
+    <div>
+        <span class="moin-diff-info-caption">
+            Comment:
+        </span>
+        <span class="moin-diff-info-value">
+            {{ rev.meta['comment'] }}
+        </span>
+    </div>
+{% endmacro %}