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@232
|
27 {% endblock %}
|
bgneal@232
|
28 {% block content %}
|
bgneal@232
|
29 <h2>Forums: {{ page_title }}</h2>
|
bgneal@232
|
30
|
bgneal@232
|
31 <h3>
|
bgneal@232
|
32 <a href="{% url forums-index %}">SurfGuitar101 Forum Index</a> » {{ page_title }}
|
bgneal@232
|
33 </h3>
|
bgneal@232
|
34 <p>{{ description }}</p>
|
bgneal@232
|
35 {% include 'forums/pagination.html' %}
|
bgneal@232
|
36 <form id="topic_form" action="." method="post">{% csrf_token %}
|
bgneal@232
|
37 <table class="forum-topic-table">
|
bgneal@232
|
38 <thead>
|
bgneal@232
|
39 <tr>
|
bgneal@232
|
40 <th>Forum</th>
|
bgneal@232
|
41 <th>Topic</th>
|
bgneal@232
|
42 <th><input type="checkbox" id="master_check" /></th>
|
bgneal@232
|
43 </tr>
|
bgneal@232
|
44 </thead>
|
bgneal@232
|
45 <tbody>
|
bgneal@232
|
46 {% for topic in page.object_list %}
|
bgneal@232
|
47 <tr>
|
bgneal@232
|
48 <td><a href="{{ topic.forum.get_absolute_url }}">{{ topic.forum.name }}</a></td>
|
bgneal@232
|
49 <td><a href="{{ topic.get_absolute_url }}">{{ topic.name }}</a></td>
|
bgneal@232
|
50 <td><input type="checkbox" class="topic_box" name="delete_ids" value="{{ topic.id }}" /></td>
|
bgneal@232
|
51 </tr>
|
bgneal@232
|
52 {% empty %}
|
bgneal@232
|
53 <tr><td colspan="3"><em>No topics found</em></td></tr>
|
bgneal@232
|
54 {% endfor %}
|
bgneal@232
|
55 </tbody>
|
bgneal@232
|
56 </table>
|
bgneal@232
|
57 {% include 'forums/pagination.html' %}
|
bgneal@232
|
58 {% if page.object_list %}
|
bgneal@232
|
59 <input type="hidden" name="page" value="{{ page.number }}" />
|
bgneal@232
|
60 <input type="submit" name="delete_selected" value="Delete Selected" />
|
bgneal@232
|
61 {% endif %}
|
bgneal@232
|
62 </form>
|
bgneal@232
|
63 {% endblock %}
|