Mercurial > public > sg101
comparison gpp/templates/forums/topic.html @ 97:96eec1ed0fd3
Render the forum page navigation in the view with render_to_string() to avoid doing it twice in the template code. Also undo a mistake in the last commit. Need 2 different orderings for Post objects: by creation date in normal views, and by reverse creation date in the admin.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 13 Sep 2009 19:58:31 +0000 |
parents | 4c33e266db03 |
children | e67c4dd98db5 |
comparison
equal
deleted
inserted
replaced
96:93d9e74a471e | 97:96eec1ed0fd3 |
---|---|
1 {% extends 'base.html' %} | 1 {% extends 'base.html' %} |
2 {% load forum_tags %} | |
3 {% block title %}Forums: {{ topic.name }}{% endblock %} | 2 {% block title %}Forums: {{ topic.name }}{% endblock %} |
4 {% block custom_js %}{% if last_page %}{{ form.media }}{% endif %}{% endblock %} | 3 {% block custom_js %}{% if last_page %}{{ form.media }}{% endif %}{% endblock %} |
5 {% block content %} | 4 {% block content %} |
6 <h2>Forums: {{ topic.name }}</h2> | 5 <h2>Forums: {{ topic.name }}</h2> |
7 | 6 |
16 <a href="#forum-reply-form">New Reply</a> • | 15 <a href="#forum-reply-form">New Reply</a> • |
17 {% else %} | 16 {% else %} |
18 <a href="./?page={{ page.paginator.num_pages }}#forum-reply-form">New Reply</a> • | 17 <a href="./?page={{ page.paginator.num_pages }}#forum-reply-form">New Reply</a> • |
19 {% endif %} | 18 {% endif %} |
20 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> | 19 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> |
21 {% forum_page_navigation page %} | 20 {{ page_nav }} |
22 | 21 |
23 <table class="forum-topic" id="forum-topic"> | 22 <table class="forum-topic" id="forum-topic"> |
24 {% for post in page.object_list %} | 23 {% for post in page.object_list %} |
25 {% include 'forums/display_post.html' %} | 24 {% include 'forums/display_post.html' %} |
26 {% endfor %} | 25 {% endfor %} |
27 </table> | 26 </table> |
28 {% forum_page_navigation page %} | 27 {{ page_nav }} |
29 | 28 |
30 {% if last_page and user.is_authenticated %} | 29 {% if last_page and user.is_authenticated %} |
31 <a name="forum-reply-form"></a> | 30 <a name="forum-reply-form"></a> |
32 <form action="" method="post" id="forums-quick-reply"> | 31 <form action="" method="post" id="forums-quick-reply"> |
33 <fieldset> | 32 <fieldset> |