Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #149 -- djangoproject.com/comments/ now displays latest comments

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 233e9fe164cb7ab34319fc4aadd50af3140fb911 1 parent e77bee8
adrian authored
View
7 django_website/settings/urls/main.py
@@ -1,8 +1,15 @@
from django.conf.urls.defaults import *
+info_dict = {
+ 'app_label': 'comments',
+ 'module_name': 'freecomments',
+ 'paginate_by': 15,
+}
+
urlpatterns = patterns('',
(r'^weblog/', include('django_website.apps.blog.urls.blog')),
(r'^documentation/', include('django_website.apps.docs.urls.docs')),
+ (r'^comments/$', 'django.views.generic.list_detail.object_list', info_dict),
(r'^comments/', include('django.contrib.comments.urls.comments')),
(r'^rss/', include('django.conf.urls.rss')),
(r'', include('django.conf.urls.flatfiles')),
View
24 django_website/templates/comments/freecomments_list.html
@@ -0,0 +1,24 @@
+{% extends "base_weblog" %}
+
+{% block title %}Recent comments{% endblock %}
+
+{% block content %}
+
+<h1>Recent comments</h1>
+
+<p>{% if has_previous %}<a href="?page={{ previous }}">Previous</a> | {% endif %}
+Page {{ page }} of {{ pages }}
+{% if has_next %} | <a href="?page={{ next }}">Next</a>{% endif %}</p>
+
+{% for comment in object_list %}
+<div class="comment" id="c{{ comment.id }}">
+ <h3><a href="{{ comment.get_absolute_url }}">{{ comment.person_name }} <span class="small quiet">{{ comment.submit_date|date:"F j, Y" }} at {{ comment.submit_date|date:"P" }}</span></a></h3>
+ {{ comment.comment|escape|urlizetrunc:"40"|linebreaks }}
+</div>
+{% endfor %}
+
+<p>{% if has_previous %}<a href="?page={{ previous }}">Previous</a> | {% endif %}
+Page {{ page }} of {{ pages }}
+{% if has_next %} | <a href="?page={{ next }}">Next</a>{% endif %}</p>
+
+{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.