Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #96 -- Added comment counts to djangoproject.com homepage and b…

…log index

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@235 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5ff88d59a277fb9e452af12f5780b06cbd84596c 1 parent 6926c13
adrian authored
View
10 django_website/templates/blog/entries_archive.html
@@ -2,13 +2,15 @@
{% block content %}
+{% load comments.comments %}
+
<h1>Latest entries</h1>
{% for object in latest %}
-<h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2>
-{{ object.body }}
-<p class="date small">Posted by <strong>{{ object.author }}</strong> on {{ object.pub_date|date:"F j, Y" }}</p>
-
+ {% get_free_comment_count for blog.entries object.id as comment_count %}
+ <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2>
+ {{ object.body }}
+ <p class="date small">Posted by <strong>{{ object.author }}</strong> on {{ object.pub_date|date:"F j, Y" }} | <a href="{{ object.get_absolute_url }}#comments">{{ comment_count }} comment{{ comment_count|pluralize }}</a></p>
{% endfor %}
{% endblock %}
View
10 django_website/templates/flatfiles/homepage.html
@@ -58,14 +58,16 @@ <h2 class="deck">Django is a high-level Python Web framework that encourages rap
{% block content-extra %}
<h2>Weblog</h2>
+{% load comments %}
{% load latestblogentry %}
{% get_latest_blog_entries 2 as latest_entries %}
{% for latest_entry in latest_entries %}
-<h3><a href="{{ latest_entry.get_absolute_url }}">{{ latest_entry.headline }}</a></h3>
-<p class="date">by <strong>{{ latest_entry.author }}</strong> on {{ latest_entry.pub_date|date:"F j, Y" }}</p>
-{{ latest_entry.summary }}
-<p class="more"><a href="{{ latest_entry.get_absolute_url }}">Read more</a> / <a href="{{ latest_entry.get_absolute_url }}#comments">Comments</a></p>
+ {% get_free_comment_count for blog.entries latest_entry.id as comment_count %}
+ <h3><a href="{{ latest_entry.get_absolute_url }}">{{ latest_entry.headline }}</a></h3>
+ <p class="date">by <strong>{{ latest_entry.author }}</strong> on {{ latest_entry.pub_date|date:"F j, Y" }}</p>
+ {{ latest_entry.summary }}
+ <p class="more"><a href="{{ latest_entry.get_absolute_url }}">Read more</a> / <a href="{{ latest_entry.get_absolute_url }}#comments">{{ comment_count }} comment{{ comment_count|pluralize }}</a></p>
{% endfor %}
{% comment %}
Please sign in to comment.
Something went wrong with that request. Please try again.