annotate 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
rev   line source
bgneal@86 1 {% extends 'base.html' %}
bgneal@86 2 {% block title %}Forums: {{ topic.name }}{% endblock %}
bgneal@89 3 {% block custom_js %}{% if last_page %}{{ form.media }}{% endif %}{% endblock %}
bgneal@86 4 {% block content %}
bgneal@86 5 <h2>Forums: {{ topic.name }}</h2>
bgneal@86 6
bgneal@86 7 <h3>
bgneal@86 8 <a href="{% url forums-index %}">SurfGuitar101 Forum Index</a> &raquo;
bgneal@86 9 <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a> &raquo;
bgneal@86 10 <a href="{% url forums-topic_index id=topic.id %}">{{ topic.name }}</a>
bgneal@86 11 </h3>
bgneal@86 12
bgneal@86 13 <div class="forum-block">
bgneal@87 14 {% if last_page %}
bgneal@87 15 <a href="#forum-reply-form">New Reply</a> &bull;
bgneal@87 16 {% else %}
bgneal@90 17 <a href="./?page={{ page.paginator.num_pages }}#forum-reply-form">New Reply</a> &bull;
bgneal@87 18 {% endif %}
bgneal@86 19 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a>
bgneal@97 20 {{ page_nav }}
bgneal@86 21
bgneal@89 22 <table class="forum-topic" id="forum-topic">
bgneal@90 23 {% for post in page.object_list %}
bgneal@89 24 {% include 'forums/display_post.html' %}
bgneal@86 25 {% endfor %}
bgneal@86 26 </table>
bgneal@97 27 {{ page_nav }}
bgneal@90 28
bgneal@87 29 {% if last_page and user.is_authenticated %}
bgneal@87 30 <a name="forum-reply-form"></a>
bgneal@89 31 <form action="" method="post" id="forums-quick-reply">
bgneal@86 32 <fieldset>
bgneal@87 33 <legend>Reply to &quot;{{ topic.name }}&quot;</legend>
bgneal@86 34 {{ form.as_p }}
bgneal@89 35 <input type="submit" value="Submit Reply" id="forums-reply-post" />
bgneal@86 36 </fieldset>
bgneal@86 37 </form>
bgneal@86 38 {% endif %}
bgneal@86 39 </div>
bgneal@86 40 {% endblock %}