Browse Source

Shows tag count in the tags list of the article

Talha Mansoor 11 years ago
parent
commit
57fc1c14b8
1 changed files with 10 additions and 3 deletions
  1. 10 3
      templates/article.html

+ 10 - 3
templates/article.html

@@ -36,11 +36,18 @@ hell {{ article.title }} - {{ super() }}
 
         <div class="row-fluid">
             <div class="span12">
-                {% if article.tags %}<p>Tags:
+                {% if article.tags %}
+                <p>Tags:
                 <ul> 
-                    {% for tag in article.tags %}<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a></li>{% endfor %}
+                    {% for tag in article.tags %}
+                    <li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}
+                    {% for aTag, tagged_articles in tags if aTag == tag %}
+                    {{ tagged_articles|count }}
+                    {% endfor %}</a></li>
+                    {% endfor %}
                 </ul>
-                </p>{% endif %}
+                </p>
+                {% endif %}
             </div>
         </div>
     </div>