]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/osqaadmin/nodeman.html
Adds the bulk management interface with node bulk management with full filtering...
[osqa.git] / forum / skins / default / templates / osqaadmin / nodeman.html
1 {% extends basetemplate %}
2
3 {% load i18n %}
4 {% load user_tags %}
5
6 {% block adminjs %}
7     <script type="text/javascript">
8         $(function() {
9             var $form = $('#changelist-search');
10
11             $('.node-type-link').click(function() {
12                 $form.find('#id_state_type').val('any');
13                 $form.find('#id_node_type').val($(this).attr('href').substring(1));
14                 $form.submit();
15             });
16
17             $('.state-type-link').click(function() {
18                 $form.find('#id_state_type').val($(this).attr('href').substring(1));
19                 $form.submit();
20             });
21         });
22     </script>
23     <style>
24         #toolbar ul li {
25             list-style-type: none;
26             display: inline;
27             margin-right: 12px;
28         }
29     </style>
30 {% endblock %}
31
32 {% block subtitle %}
33     {% trans "Node manager" %}
34 {% endblock %}
35 {% block description %}
36     {% trans "Nodes bulk management" %}
37 {% endblock %}
38
39 {% block admincontent %}
40     <div id="changelist" class="module filtered">
41         <div id="toolbar">
42             <form method="get" action="" id="changelist-search">
43             <div>
44                 <label for="searchbar"><img alt="Search" src="{{ settings.ADMIN_MEDIA_PREFIX }}img/admin/icon_searchbox.png"></label>
45                 {{ filter_form.text }}
46                 {{ filter_form.node_type }}
47                 {{ filter_form.state_type }}
48                 <input type="submit" value="Search"><br />
49                 {{ filter_form.text_in }}
50             </div>
51             </form>
52         </div>
53         <div id="changelist-filter">
54             <h2>{% trans "Filter" %}</h2>
55             <h3>{% trans "By type" %}</h3>
56             <ul>
57                 {% for type, name in node_types %}
58                 <li{% ifequal filter_form.node_type.data type %} class="selected"{% endifequal %}>
59                     <a class="node-type-link" href="#{{ type }}">{{ name }}</a>
60                 </li>
61                 {% endfor %}
62             </ul>
63             <h3>{% trans "By state" %}</h3>
64             <ul>
65                 <li{% ifequal filter_form.state_type.data "any" %} class="selected"{% endifequal %}><a class="state-type-link" href="#any">{% trans "any" %}</a></li>
66                 {% for state_type in state_types %}
67                     <li{% ifequal filter_form.state_type.data state_type %} class="selected"{% endifequal %}>
68                         <a class="state-type-link" href="#{{ state_type }}">{{ state_type }}</a>
69                     </li>
70                 {% endfor %}
71             </ul>
72         </div>
73         <form id="changelist-form" method="POST" action="">
74             <div class="action"></div>
75             <table id="result_list" cellspacing="0">
76                 <thead>
77                     <tr>
78                         <th class="action-checkbox-column">
79                             <input type="checkbox" id="action-toggle" style="display: inline;" />
80                         </th>
81                         {% ifequal filter_form.node_type.data "all" %}
82                             <th>{% trans "Type" %}</th>
83                         {% endifequal %}
84                         <th>{% trans "Title" %}</th>
85                         <th>{% trans "Author" %}</th>
86                     </tr>
87                 </thead>
88                 <tbody>
89                 {% for node in nodes.paginator.page %}
90                     <tr class="{% cycle 'row1' 'row2' %}">
91                         <td><input type="checkbox" name="_selected_action" value="{{ node.id }}" class="action-select"></td>
92                         {% ifequal filter_form.node_type.data "all" %}
93                             <th>{{ node.friendly_name }}</th>
94                         {% endifequal %}
95                         <td><a href="{{ node.get_absolute_url }}" target="_blank">{{ node.headline }}</a></td>
96                         <td><a href="{{ node.author.get_absolute_url  }}">{{ node.author.username }}</a></td>
97                     </tr>
98                 {% endfor %}
99                 </tbody>
100             </table>
101             {{ nodes.paginator.page_numbers }}
102         </form>
103     </div>
104 {% endblock %}