Procházet zdrojové kódy

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

Talha Mansoor před 11 roky
rodič
revize
d8c2dcebb4
2 změnil soubory, kde provedl 20 přidání a 2 odebrání
  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>