From 0cb045996613caab33795894e317b6fd797457a9 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 30 Sep 2019 23:05:38 +0200 Subject: [PATCH] Fix plurals in counters --- templates/utils.html | 18 +++++++++--------- utils/template_filters.py | 7 +++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/templates/utils.html b/templates/utils.html index 571dc2c..bc54da9 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -250,19 +250,19 @@ {% endif %} -{% if meta.count_reply and obj.id | is_from_outbox %}{{ meta.count_reply }} replies +{% if meta.count_reply and obj.id | is_from_outbox %}{{ meta.count_reply }} replie{% if meta.count_reply > 1 %}s{% endif %} {% elif meta.count_reply and session.logged_in %} -{{ meta.count_reply }} replies{% endif %} +{{ meta.count_reply }} replie{% if meta.count_reply > 1 %}s{% endif %}{% endif %} -{% if not perma and meta.count_boost and obj.id | is_from_outbox %}{{ meta.count_boost }} boosts{% endif %} -{% if not perma and meta.count_like and obj.id | is_from_outbox %}{{ meta.count_like }} likes{% endif %} +{% if not perma and meta.count_boost and obj.id | is_from_outbox %}{{ meta.count_boost }} boost{% if meta.count_boost > 1 %}s{% endif %}{% endif %} +{% if not perma and meta.count_like and obj.id | is_from_outbox %}{{ meta.count_like }} like{% if meta.count_like > 1 %}s{% endif %}{% endif %} {% if session.logged_in %} {% if ui%} reply -{% if meta.object_visibility | visibility_is_public %} +{% if meta | get_visibility | visibility_is_public %} {% if meta.boosted %}
@@ -348,7 +348,7 @@ thread {% endif %} -{% if meta.object_visibility | visibility_is_public %} +{% if meta | get_visibility | visibility_is_public %} {% if obj | url_or_id | get_url | is_from_outbox %} {% if not perma %} permalink @@ -360,7 +360,7 @@ {% endif %} {% endif %} {% endif %} -{{ meta.object_visibility | visibility }} +{{ meta | get_visibility | visibility }} @@ -368,14 +368,14 @@