annotate gpp/templates/forums/topic.html @ 87:515d1daec811

Forums: added intra-page links for posts. Added last_page variable for topic. Conditionally display reply form using last_page.
author Brian Neal <bgneal@gmail.com>
date Sat, 12 Sep 2009 18:45:35 +0000
parents f81226b5e87b
children 021492db4aad
rev   line source
bgneal@86 1 {% extends 'base.html' %}
bgneal@86 2 {% load avatar_tags %}
bgneal@86 3 {% block title %}Forums: {{ topic.name }}{% 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@86 17 <a href="">New Reply</a> &bull;
bgneal@87 18 {% endif %}
bgneal@86 19 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a>
bgneal@86 20
bgneal@86 21 <table class="forum-topic">
bgneal@86 22 {% for post in posts %}
bgneal@86 23 <tr class="forum-post">
bgneal@86 24 <td class="forum-post-author">
bgneal@87 25 <a name="p{{ post.id }}"></a>
bgneal@86 26 <a href="{% url bio-view_profile username=post.user.username %}">{{ post.user.username }}</a><br />
bgneal@86 27 {% avatar post.user %}
bgneal@86 28 </td>
bgneal@86 29 <td class="forum-post-body">
bgneal@86 30 <div class="forum-post-info quiet">
bgneal@86 31 <a href="{{ post.get_absolute_url }}"><img src="{{ MEDIA_URL }}icons/link.png" alt="Link" title="Link to this post" /></a>
bgneal@86 32 Posted on {{ post.creation_date|date:"M d, Y H:i" }}
bgneal@86 33 </div>
bgneal@86 34 <div class="forum-post-body">
bgneal@86 35 {{ post.html|safe }}
bgneal@86 36 </div>
bgneal@86 37 </td>
bgneal@86 38 </tr>
bgneal@86 39 {% endfor %}
bgneal@86 40 </table>
bgneal@87 41 {% if last_page and user.is_authenticated %}
bgneal@87 42 <a name="forum-reply-form"></a>
bgneal@86 43 <form action="" method="post">
bgneal@86 44 <fieldset>
bgneal@87 45 <legend>Reply to &quot;{{ topic.name }}&quot;</legend>
bgneal@86 46 {{ form.as_p }}
bgneal@86 47 <input type="submit" value="Submit Reply" />
bgneal@86 48 </fieldset>
bgneal@86 49 </form>
bgneal@86 50 {% endif %}
bgneal@86 51 </div>
bgneal@86 52 {% endblock %}