Commits

Luke Plant committed 2e57ee5

Added pagination to the sermons page

  • Participants
  • Parent commits e22b3ec

Comments (0)

Files changed (4)

christchurch/settings.py

     'cms.middleware.user.CurrentUserMiddleware',
     'cms.middleware.toolbar.ToolbarMiddleware',
     'cms.middleware.media.PlaceholderMediaMiddleware',
+    'pagination.middleware.PaginationMiddleware',
 ]
 
 TEMPLATE_CONTEXT_PROCESSORS = [
     'cms.plugins.snippet',
     'cms.plugins.googlemap',
     'semanticeditor',
+    'pagination',
 ]
 
 CMS_TEMPLATES = (

christchurch/static/christchurch/css/style.css

     clear: right;
     margin-left: 0 !important;
     }
+
+.pagination {
+    text-align: right;
+}
 python-dateutil==1.4.1
 pytz>=2010b
 semanticeditor==0.2.1
-
+django-pagination

sermons/templates/sermons/index.html

 {% extends "standard.html" %}
+{% load pagination_tags %}
 {% block content %}
 {{ block.super }}
+
+{% autopaginate sermons 30 %}
+
+{% paginate %}
+
 {% for sermon in sermons %}
   {% ifchanged sermon.date_delivered %}
   <h2>{{ sermon.date_delivered|date:"F j, Y" }}</h2>
   {% endifchanged %}
   <p>{{ sermon.nice_time }}: <a href="{{ sermon.url }}">{{ sermon.speaker }} {% if sermon.title %} - {{ sermon.title }}{% endif %}{% if sermon.nice_passage %} - {{ sermon.nice_passage }}{% endif %}</a></p>
 {% endfor %}
+
+{% paginate %}
 {% endblock %}