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