Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
86:f81226b5e87b | 87:515d1daec811 |
---|---|
9 <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a> » | 9 <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a> » |
10 <a href="{% url forums-topic_index id=topic.id %}">{{ topic.name }}</a> | 10 <a href="{% url forums-topic_index id=topic.id %}">{{ topic.name }}</a> |
11 </h3> | 11 </h3> |
12 | 12 |
13 <div class="forum-block"> | 13 <div class="forum-block"> |
14 {% if last_page %} | |
15 <a href="#forum-reply-form">New Reply</a> • | |
16 {% else %} | |
14 <a href="">New Reply</a> • | 17 <a href="">New Reply</a> • |
18 {% endif %} | |
15 <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> |
16 | 20 |
17 <table class="forum-topic"> | 21 <table class="forum-topic"> |
18 {% for post in posts %} | 22 {% for post in posts %} |
19 <tr class="forum-post"> | 23 <tr class="forum-post"> |
20 <td class="forum-post-author"> | 24 <td class="forum-post-author"> |
25 <a name="p{{ post.id }}"></a> | |
21 <a href="{% url bio-view_profile username=post.user.username %}">{{ post.user.username }}</a><br /> | 26 <a href="{% url bio-view_profile username=post.user.username %}">{{ post.user.username }}</a><br /> |
22 {% avatar post.user %} | 27 {% avatar post.user %} |
23 </td> | 28 </td> |
24 <td class="forum-post-body"> | 29 <td class="forum-post-body"> |
25 <div class="forum-post-info quiet"> | 30 <div class="forum-post-info quiet"> |
31 </div> | 36 </div> |
32 </td> | 37 </td> |
33 </tr> | 38 </tr> |
34 {% endfor %} | 39 {% endfor %} |
35 </table> | 40 </table> |
36 {% if user.is_authenticated %} | 41 {% if last_page and user.is_authenticated %} |
42 <a name="forum-reply-form"></a> | |
37 <form action="" method="post"> | 43 <form action="" method="post"> |
38 <fieldset> | 44 <fieldset> |
39 <legend>Reply to Thread</legend> | 45 <legend>Reply to "{{ topic.name }}"</legend> |
40 {{ form.as_p }} | 46 {{ form.as_p }} |
41 <input type="submit" value="Submit Reply" /> | 47 <input type="submit" value="Submit Reply" /> |
42 </fieldset> | 48 </fieldset> |
43 </form> | 49 </form> |
44 {% endif %} | 50 {% endif %} |