diff options
author | Dan McGee <dpmcgee@gmail.com> | 2011-07-18 23:03:52 -0500 |
---|---|---|
committer | Dan McGee <dpmcgee@gmail.com> | 2011-07-18 23:03:52 -0500 |
commit | 7d1b1cf271ce073b82812fa4c563f48486527202 (patch) | |
tree | 0c9338db0a8c75bf5418688967616728ae7484a5 | |
parent | cfb1ea90618f9b86fff58fa20e01a42180a9c513 (diff) | |
download | website-7d1b1cf271ce073b82812fa4c563f48486527202.tar.gz website-7d1b1cf271ce073b82812fa4c563f48486527202.zip |
Show all catgories on category detail page
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
-rw-r--r-- | blog/views.py | 1 | ||||
-rw-r--r-- | templates/blog/postcategory_detail.html | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/blog/views.py b/blog/views.py index b4fa88c..93653c7 100644 --- a/blog/views.py +++ b/blog/views.py @@ -26,6 +26,7 @@ def postcategory_detail(request, queryset, category): { 'pc': cat, 'posts': cat.post_set.public().order_by('-pub_date'), + 'categories': queryset, }, RequestContext(request) ) diff --git a/templates/blog/postcategory_detail.html b/templates/blog/postcategory_detail.html index f117f57..26cc14e 100644 --- a/templates/blog/postcategory_detail.html +++ b/templates/blog/postcategory_detail.html @@ -2,12 +2,27 @@ {% load url from future %} -{% block subtitle %}Blog Tag ({{ pc.category }}){% endblock %} +{% block subtitle %}Posts tagged '{{ pc.category }}'{% endblock %} {% block content %} <h2>Posts tagged <em>{{ pc.category }}</em></h2> +<p>{{ pc.post_count }} post{{ pc.post_count|pluralize }} found.</p> <ul> {% for post in posts %} <li><a href="{% url 'blog-single-post' slug=post.slug %}">{{ post.title }}</a> - {{ post.pub_date|date }}</li>{% endfor %} </ul> + +<h3>All Tags</h3> +<ul id="taglist"> +{% for pc in categories %} +<li value="{{pc.post_count}}"><a href="{% url 'blog-single-tag' category=pc.category %}">{{ pc.category }}</a><span class="postcount"> - {{ pc.post_count }} post{{ pc.post_count|pluralize }}</span></li> +{% endfor %} +</ul> +{% endblock %} + +{% block moreenddata %} +<script type="text/javascript" src="/media/jquery.tagcloud.min.js"></script> +<script type="text/javascript"> + $(document).ready(makeTagCloud); +</script> {% endblock %} |