comparison gpp/templates/forums/topic.html @ 102:e67c4dd98db5

Forums: new topic form sprouts boolean fields for sticky and locking if the user has rights. Implemented the locked logic. Fixed a bug where topics where getting out of order (the view_count was bumping the update_date because of auto_now).
author Brian Neal <bgneal@gmail.com>
date Wed, 16 Sep 2009 02:01:57 +0000
parents 96eec1ed0fd3
children 59688577a8f1
comparison
equal deleted inserted replaced
101:4bbb6a9aa317 102:e67c4dd98db5
9 <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a> &raquo; 9 <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a> &raquo;
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 topic.locked %}
15 <img src="{{ MEDIA_URL }}/icons/lock.png" alt="Lock" title="This topic is locked" />
16 {% else %}
14 {% if last_page %} 17 {% if last_page %}
15 <a href="#forum-reply-form">New Reply</a> &bull; 18 <a href="#forum-reply-form">New Reply</a>
16 {% else %} 19 {% else %}
17 <a href="./?page={{ page.paginator.num_pages }}#forum-reply-form">New Reply</a> &bull; 20 <a href="./?page={{ page.paginator.num_pages }}#forum-reply-form">New Reply</a>
18 {% endif %} 21 {% endif %}
19 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> 22 {% endif %}
23 &bull; <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a>
20 {{ page_nav }} 24 {{ page_nav }}
21 25
22 <table class="forum-topic" id="forum-topic"> 26 <table class="forum-topic" id="forum-topic">
23 {% for post in page.object_list %} 27 {% for post in page.object_list %}
24 {% include 'forums/display_post.html' %} 28 {% include 'forums/display_post.html' %}
25 {% endfor %} 29 {% endfor %}
26 </table> 30 </table>
27 {{ page_nav }} 31 {{ page_nav }}
28 32
29 {% if last_page and user.is_authenticated %} 33 {% if last_page and user.is_authenticated and not topic.locked %}
30 <a name="forum-reply-form"></a> 34 <a name="forum-reply-form"></a>
31 <form action="" method="post" id="forums-quick-reply"> 35 <form action="" method="post" id="forums-quick-reply">
32 <fieldset> 36 <fieldset>
33 <legend>Reply to &quot;{{ topic.name }}&quot;</legend> 37 <legend>Reply to &quot;{{ topic.name }}&quot;</legend>
34 {{ form.as_p }} 38 {{ form.as_p }}