Django

Code

Changeset 235

Show
Ignore:
Timestamp:
07/19/05 20:11:09 (3 years ago)
Author:
adrian
Message:

Fixed #96 -- Added comment counts to djangoproject.com homepage and blog index

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • djangoproject.com/django_website/templates/blog/entries_archive.html

    r189 r235  
    33{% block content %} 
    44 
     5{% load comments.comments %} 
     6 
    57<h1>Latest entries</h1> 
    68 
    79{% for object in latest %} 
    8 <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2> 
    9 {{ object.body }} 
    10 <p class="date small">Posted by <strong>{{ object.author }}</strong> on {{ object.pub_date|date:"F j, Y" }}</p> 
    11  
     10    {% get_free_comment_count for blog.entries object.id as comment_count %} 
     11    <h2><a href="{{ object.get_absolute_url }}">{{ object.headline }}</a></h2> 
     12    {{ object.body }} 
     13    <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> 
    1214{% endfor %} 
    1315 
  • djangoproject.com/django_website/templates/flatfiles/homepage.html

    r189 r235  
    5959<h2>Weblog</h2> 
    6060 
     61{% load comments %} 
    6162{% load latestblogentry %} 
    6263{% get_latest_blog_entries 2 as latest_entries %} 
    6364 
    6465{% for latest_entry in latest_entries %} 
    65 <h3><a href="{{ latest_entry.get_absolute_url }}">{{ latest_entry.headline }}</a></h3> 
    66 <p class="date">by <strong>{{ latest_entry.author }}</strong> on {{ latest_entry.pub_date|date:"F j, Y" }}</p> 
    67 {{ latest_entry.summary }} 
    68 <p class="more"><a href="{{ latest_entry.get_absolute_url }}">Read more</a> / <a href="{{ latest_entry.get_absolute_url }}#comments">Comments</a></p> 
     66    {% get_free_comment_count for blog.entries latest_entry.id as comment_count %} 
     67    <h3><a href="{{ latest_entry.get_absolute_url }}">{{ latest_entry.headline }}</a></h3> 
     68    <p class="date">by <strong>{{ latest_entry.author }}</strong> on {{ latest_entry.pub_date|date:"F j, Y" }}</p> 
     69    {{ latest_entry.summary }} 
     70    <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> 
    6971{% endfor %} 
    7072