changeset 2192:6f2291d304bd

meta diff macro
author Ana Balica <ana.balica@gmail.com>
date Sun, 15 Sep 2013 11:29:27 +0200
parents 47a007f552b7
children b3059f21645b
files MoinMoin/templates/mail/meta_diff.html
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/templates/mail/meta_diff.html	Sun Sep 15 11:29:27 2013 +0200
@@ -0,0 +1,29 @@
+{% macro meta_diff(diff) %}
+<table border="0" cellpadding="0" cellspacing="0" style="margin:0; padding:10px;
+        width:100%; font-family:monospace; background-color:#F9F9F9">
+{% for change in diff -%}
+{% if change[0] == "insert" -%}
+    <tr style="color:#00B000; height:1.2em;">
+    {% set marker = '+' -%}
+{% elif change[0] == "delete" -%}
+    <tr style="color:#991111; height:1.2em;">
+    {% set marker = '-' -%}
+{%- endif %}
+        <td style="font-family:monospace; width:1.2em; vertical-align:top;">{{ marker }}</td>
+        <td style="font-family:monospace;">
+        {% if change[0] == "insert" -%}
+            <ins style="text-decoration:none;">
+                {{ change[1] | join(".") }}{% if change[1] -%}:{%- endif %}
+                {{ change[2] }}
+            </ins>
+        {% elif change[0] == "delete" -%}
+            <del style="text-decoration:none;">
+                {{ change[1] | join(".") }}{% if change[1] -%}:{%- endif %}
+                {{ change[2] }}
+            </del>
+        {% endif %}
+        </td>
+    </tr>
+{%- endfor %}
+</table>
+{% endmacro %}