# HG changeset patch # User raph # Date 1260781521 -3600 # Node ID 381538cb3a8bb6bc7d5ead595609c77c478d2677 # Parent 84837aa8d2cafbe34782550dc2da2fdc49a33612 refactor history template diff -r 84837aa8d2ca -r 381538cb3a8b src/cm/templates/site/text_history.html --- a/src/cm/templates/site/text_history.html Fri Dec 11 13:42:16 2009 +0100 +++ b/src/cm/templates/site/text_history.html Mon Dec 14 10:05:21 2009 +0100 @@ -35,7 +35,11 @@
-

{% blocktrans %}Versions:{% endblocktrans %}

+
{% blocktrans %}Versions:{% endblocktrans %} +{% for author,color in author_colors %} + {{ author }} +{% endfor %} +
{% for v1, v2, color in paired_versions %} @@ -56,22 +60,18 @@ {% endfor %} -

{% blocktrans %}Authors:{% endblocktrans %}

-{% for author,color in author_colors %} - {{ author }} -{% empty %} -{% blocktrans %}authors{% endblocktrans %} -{% endfor %} - {% if can_edit_text %} -

{% blocktrans %}Actions:{% endblocktrans %}

-
{% blocktrans %}Revert to version #{{ v1_nid }}:{% endblocktrans %}
+
+
+
{% endif %} {% if v2_nid %}

{% blocktrans with v1_nid as v1_nid and v1_nid as v1_nid %}Differences between version #{{ v1_nid }} and version #{{ v2_nid }}:{% endblocktrans %}

{% else %} -

{% blocktrans with version1.created|local_date:tz as date and v1_nid as version_number and version1.title as title %}Version #{{ version_number }} entitled "{{ title }}" and created on {{ date }}:{% endblocktrans %}

+

{{ version1.title }}

+ {% blocktrans with version1.created|local_date:tz as date and v1_nid as version_number %}Version #{{ version_number }} created on {{ date }}{% endblocktrans %} +

{% endif %} {% autoescape off %} @@ -80,24 +80,31 @@
- {% blocktrans with v1_nid as version_number and version1.title as title %}{{ title }} / version #{{ version_number }}{% endblocktrans %} + {{ version1.title }}
- {% blocktrans with version1.created|local_date:tz as date %}created {{ date }}{% endblocktrans %} +
- {% blocktrans with v2_nid as version_number and version2.title as title %}{{ title }} / version #{{ version_number }}{% endblocktrans %} + {{ version2.title }}
- {% blocktrans with version2.created|local_date:tz as date %}created {{ date }}{% endblocktrans %} - +
{% endif %} + +{% if is_diff %} {{ content }} +{% else %} +
{% blocktrans %}No differences{% endblocktrans %}
+{% endif %} + +{% if embed_code %}
{{ embed_code }} +{% endif %}
{% endautoescape %} diff -r 84837aa8d2ca -r 381538cb3a8b src/cm/views/texts.py --- a/src/cm/views/texts.py Fri Dec 11 13:42:16 2009 +0100 +++ b/src/cm/views/texts.py Mon Dec 14 10:05:21 2009 +0100 @@ -484,8 +484,9 @@ 'v2_id' : v2_id, 'version1': v1, 'version2': v2, - 'content' : content, + 'content' : content.strip(), 'embed_code':embed_code, + 'is_diff' : content !='
', 'author_colors' : author_colors, } return render_to_response('site/text_history.html', template_dict, context_instance=RequestContext(request))