annotate gpp/templates/forums/topic.html @ 358:768e3568addf

Fixing #172; add a forums jump box.
author Brian Neal <bgneal@gmail.com>
date Fri, 04 Mar 2011 03:50:07 +0000
parents cfad8d605cb8
children 59aaba88405e
rev   line source
bgneal@86 1 {% extends 'base.html' %}
bgneal@310 2 {% load url from future %}
bgneal@127 3 {% load forum_tags %}
bgneal@86 4 {% block title %}Forums: {{ topic.name }}{% endblock %}
bgneal@358 5 {% block custom_js %}
bgneal@358 6 {{ form.media }}
bgneal@358 7 {% include "forums/jump_box.js" %}
bgneal@358 8 {% endblock %}
bgneal@86 9 {% block content %}
bgneal@283 10 {% forum_navigation topic %}
bgneal@86 11
bgneal@86 12 <div class="forum-block">
bgneal@104 13 {% if topic.sticky %}
bgneal@312 14 <img src="{{ STATIC_URL }}icons/asterisk_orange.png" alt="Sticky" title="Sticky" />
bgneal@104 15 {% endif %}
bgneal@102 16 {% if topic.locked %}
bgneal@312 17 <img src="{{ STATIC_URL }}icons/lock.png" alt="Lock" title="This topic is locked" />
bgneal@104 18 {% endif %}
bgneal@104 19 {% if can_reply %}
bgneal@104 20 {% if topic.locked or topic.sticky %}&bull;{% endif %}
bgneal@87 21 {% if last_page %}
bgneal@102 22 <a href="#forum-reply-form">New Reply</a>
bgneal@87 23 {% else %}
bgneal@102 24 <a href="./?page={{ page.paginator.num_pages }}#forum-reply-form">New Reply</a>
bgneal@87 25 {% endif %}
bgneal@102 26 {% endif %}
bgneal@310 27 &bull; <a href="{% url 'forums-new_topic' slug=forum.slug %}">New Topic</a>
bgneal@97 28 {{ page_nav }}
bgneal@86 29
bgneal@89 30 <table class="forum-topic" id="forum-topic">
bgneal@90 31 {% for post in page.object_list %}
bgneal@89 32 {% include 'forums/display_post.html' %}
bgneal@86 33 {% endfor %}
bgneal@86 34 </table>
bgneal@97 35 {{ page_nav }}
bgneal@358 36 {% include 'forums/jump_box.html' %}
bgneal@109 37 {% if can_moderate %}
bgneal@109 38 <div class="forum-mod-controls">
bgneal@310 39 <form action="{% url 'forums-mod_topic_stick' topic.id %}" method="post">{% csrf_token %}
bgneal@109 40 <input type="submit" value="{% if topic.sticky %}Unstick{% else %}Stick{% endif %} Topic" />
bgneal@109 41 </form>
bgneal@310 42 <form action="{% url 'forums-mod_topic_lock' topic.id %}" method="post">{% csrf_token %}
bgneal@109 43 <input type="submit" value="{% if topic.locked %}Unlock{% else %}Lock{% endif %} Topic" />
bgneal@109 44 </form>
bgneal@310 45 <form action="{% url 'forums-mod_topic_delete' topic.id %}" method="post">{% csrf_token %}
bgneal@109 46 <input type="submit" value="Delete Topic" id="forum-mod-del-topic" />
bgneal@109 47 </form>
bgneal@312 48 <a href="{% url 'forums-mod_topic_move' topic.id %}"><img src="{{ STATIC_URL }}icons/application_go.png" alt="Move Topic" title="Move Topic" /></a>
bgneal@310 49 <a href="{% url 'forums-mod_topic_move' topic.id %}">Move this topic</a>
bgneal@312 50 <a href="{% url 'forums-mod_topic_split' topic.id %}"><img src="{{ STATIC_URL }}icons/arrow_branch.png" alt="Split Topic" title="Split Topic" /></a>
bgneal@310 51 <a href="{% url 'forums-mod_topic_split' topic.id %}">Split this topic</a>
bgneal@109 52 </div>
bgneal@109 53 {% endif %}
bgneal@90 54
bgneal@104 55 {% if last_page and can_reply %}
bgneal@87 56 <a name="forum-reply-form"></a>
bgneal@285 57 {% show_form "Reply to Topic" form "Submit Reply" 1 %}
bgneal@86 58 {% endif %}
bgneal@181 59
bgneal@181 60 {% if user.is_authenticated %}
bgneal@310 61 <form action={% if is_favorite %}"{% url 'forums-unfavorite_topic' topic.id %}"{% else %}"{% url 'forums-favorite_topic' topic.id %}"{% endif %} method="post">{% csrf_token %}
bgneal@232 62 <fieldset>
bgneal@232 63 <legend>Favorite Options</legend>
bgneal@232 64 <p>
bgneal@232 65 {% if is_favorite %}
bgneal@312 66 <img src="{{ STATIC_URL }}icons/delete.png" alt="Favorite" />
bgneal@232 67 You currently have saved this topic in your list of favorites.
bgneal@232 68 <input type="submit" value="Remove from favorites" />
bgneal@232 69 {% else %}
bgneal@312 70 <img src="{{ STATIC_URL }}icons/add.png" alt="Favorite" />
bgneal@232 71 Would you like to save this topic to your favorites list?
bgneal@232 72 <input type="submit" value="Save to favorites" />
bgneal@232 73 {% endif %}
bgneal@232 74 </p>
bgneal@232 75 <p>
bgneal@232 76 To manage all your forum topic favorites, please visit your
bgneal@310 77 <a href="{% url 'forums-manage_favorites' %}">favorites page</a>.
bgneal@232 78 </p>
bgneal@232 79 </fieldset>
bgneal@232 80 </form>
bgneal@232 81
bgneal@310 82 <form action={% if is_subscribed %}"{% url 'forums-unsubscribe_topic' topic.id %}"{% else %}"{% url 'forums-subscribe_topic' topic.id %}"{% endif %} method="post">{% csrf_token %}
bgneal@181 83 <fieldset>
bgneal@181 84 <legend>Subscription Options</legend>
bgneal@181 85 <p>
bgneal@181 86 {% if is_subscribed %}
bgneal@312 87 <img src="{{ STATIC_URL }}icons/email_delete.png" alt="Email" />
bgneal@181 88 You are currently subscribed to this topic and will receive an email when new replies are posted.
bgneal@181 89 <input type="submit" value="Unsubscribe Me" />
bgneal@181 90 {% else %}
bgneal@312 91 <img src="{{ STATIC_URL }}icons/email_add.png" alt="Email" />
bgneal@181 92 Would you like to receive an email when someone replies to this topic?
bgneal@181 93 <input type="submit" value="Subscribe via Email" />
bgneal@181 94 {% endif %}
bgneal@181 95 </p>
bgneal@181 96 <p>
bgneal@181 97 To manage all your forum topic subscriptions, please visit your
bgneal@310 98 <a href="{% url 'forums-manage_subscriptions' %}">subscriptions page</a>.
bgneal@181 99 </p>
bgneal@181 100 </fieldset>
bgneal@181 101 </form>
bgneal@181 102 {% endif %}
bgneal@343 103 <a href="#top" class="quiet" title="Goto top of the page">Top</a>
bgneal@86 104 </div>
bgneal@86 105 {% endblock %}