From 694e965f45b8da0af96e3ae99c85b4f1f4819ee6 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Fri, 30 Dec 2011 20:17:59 +0100 Subject: [PATCH] Fix #712: Comment counter always uses plural --- .../mediagoblin/user_pages/media.html | 86 ++++++++++--------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html index 13fa1baa..4c255112 100644 --- a/mediagoblin/templates/mediagoblin/user_pages/media.html +++ b/mediagoblin/templates/mediagoblin/user_pages/media.html @@ -81,18 +81,25 @@ {% trans %}Delete{% endtrans %} {% endif %}

-

{% trans comment_count=comments.count() -%}{{ comment_count }} comments{%- endtrans %} - -

- {# 0 comments. Be the first to add one! #} + {% if comments %} +

+ {% if comments.count()==1 %} + {% trans comment_count=comments.count() -%}{{ comment_count }} comment{%- endtrans %} + {% elif comments.count()>1 %} + {% trans comment_count=comments.count() -%}{{ comment_count }} comments{%- endtrans %} + {% else %} + {% trans %}No comments yet.{% endtrans %} + {% endif %} + +

{% if request.user %}
- - {% else %} -
- {% endif %} -
- {% autoescape False %} - {{ comment.content_html }} - {% endautoescape %} - - - {{ comment_author.username }} - - {% trans %}at{% endtrans %} - - {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} - -
-
- {% endfor %} + {% for comment in comments %} + {% set comment_author = comment.get_author %} + {% if pagination.active_id == comment._id %} +
+ + {% else %} +
+ {% endif %} +
+ {% autoescape False %} + {{ comment.content_html }} + {% endautoescape %} + + + {{ comment_author.username }} + + {% trans %}at{% endtrans %} + + {{ comment.created.strftime("%I:%M%p %Y-%m-%d") }} + +
+
+ {% endfor %} {{ render_pagination(request, pagination, media.url_for_self(request.urlgen)) }} {% endif %}