comparison gpp/templates/forums/manage_topics.html @ 232:a46788862737

Implement a forum favorites feature for #82
author Brian Neal <bgneal@gmail.com>
date Sun, 01 Aug 2010 21:26:12 +0000
parents
children 21d2ca3b4bf7
comparison
equal deleted inserted replaced
231:a2d388ed106e 232:a46788862737
1 {% extends 'base.html' %}
2 {% block title %}Forums: {{ page_title }}{% endblock %}
3 {% block custom_js %}
4 <script type="text/javascript">
5 //<![CDATA[
6 $(document).ready(function() {
7 $('#master_check').click(function() {
8 var master_checked = this.checked;
9 $('.topic_box').each(function(index) {
10 this.checked = master_checked;
11 });
12 });
13 $('#topic_form').submit(function() {
14 var checked = false;
15 $('.topic_box').each(function(index) {
16 checked = checked || this.checked;
17 });
18 if (!checked) {
19 alert("Please select some topics to remove.");
20 return false;
21 }
22 return confirm("Are you sure you wish to remove the selected topics from your list?");
23 });
24 });
25 //]]>
26 </script>
27 {% endblock %}
28 {% block content %}
29 <h2>Forums: {{ page_title }}</h2>
30
31 <h3>
32 <a href="{% url forums-index %}">SurfGuitar101 Forum Index</a> &raquo; {{ page_title }}
33 </h3>
34 <p>{{ description }}</p>
35 {% include 'forums/pagination.html' %}
36 <form id="topic_form" action="." method="post">{% csrf_token %}
37 <table class="forum-topic-table">
38 <thead>
39 <tr>
40 <th>Forum</th>
41 <th>Topic</th>
42 <th><input type="checkbox" id="master_check" /></th>
43 </tr>
44 </thead>
45 <tbody>
46 {% for topic in page.object_list %}
47 <tr>
48 <td><a href="{{ topic.forum.get_absolute_url }}">{{ topic.forum.name }}</a></td>
49 <td><a href="{{ topic.get_absolute_url }}">{{ topic.name }}</a></td>
50 <td><input type="checkbox" class="topic_box" name="delete_ids" value="{{ topic.id }}" /></td>
51 </tr>
52 {% empty %}
53 <tr><td colspan="3"><em>No topics found</em></td></tr>
54 {% endfor %}
55 </tbody>
56 </table>
57 {% include 'forums/pagination.html' %}
58 {% if page.object_list %}
59 <input type="hidden" name="page" value="{{ page.number }}" />
60 <input type="submit" name="delete_selected" value="Delete Selected" />
61 {% endif %}
62 </form>
63 {% endblock %}