Преглед изворни кода

Categories and tags list use singular and plural verbs depending on count

Talha Mansoor пре 11 година
родитељ
комит
d8c2dcebb4
2 измењених фајлова са 20 додато и 2 уклоњено
  1. 10 1
      templates/categories.html
  2. 10 1
      templates/tags.html

+ 10 - 1
templates/categories.html

@@ -16,7 +16,16 @@ All Categories - {{ super() }}
     <div class="span7 offset3">
         <ul>
             {% for category, articles in categories %}
-            <li>{{ articles|count }} articles in <a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></li>
+            <li>
+            {% set num = articles|count %}
+            {{ num }} 
+            {% if num > 1 %}
+            articles 
+            {% else %}
+            article
+            {% endif %}
+            filed in <a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a>
+            </li>
             {% endfor %}
         </ul>
     </div>

+ 10 - 1
templates/tags.html

@@ -16,7 +16,16 @@ All Tags - {{ super() }}
     <div class="span7 offset3">
         <ul>
             {% for tag, articles in tags %}
-            <li>{{ articles|count }} articles in <a href="{{ SITEURL }}/{{ tag.url }}">{{  }}</a></li>
+            <li>
+            {% set num = articles|count %}
+            {{ num }} 
+            {% if num > 1 %}
+            articles are 
+            {% else %}
+            article is
+            {% endif %}
+            tagged <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>
+            </li>
             {% endfor %}
         </ul>
     </div>