1 {% extends basetemplate %}
3 {% load i18n user_tags extra_tags %}
6 <script type="text/javascript">
8 var $form = $('#changelist-search');
10 $('.node-type-link').click(function() {
11 $form.find('#id_state_type').val('any');
12 $form.find('#id_node_type').val($(this).attr('href').substring(1));
16 $('.state-type-link').click(function() {
17 $form.find('#id_state_type').val($(this).attr('href').substring(1));
21 $('.action-select').change(function() {
22 $('#action-toggle').removeAttr('checked');
23 var $tr = $(this).parents('tr');
24 if ($(this).attr('checked')) {
25 $tr.addClass('selected');
27 $tr.removeClass('selected');
31 $('#action-toggle').change(function() {
32 var $rows = $('#result_list').find('tbody').find('tr');
33 var $boxes = $('#result_list').find('tbody').find('input');
35 if ($(this).attr('checked')) {
36 $rows.addClass('selected');
37 $boxes.attr('checked', 'checked')
39 $rows.removeClass('selected');
40 $boxes.removeAttr('checked');
47 list-style-type: none;
55 {% trans "Node manager" %}
57 {% block description %}
58 {% trans "Nodes bulk management" %}
61 {% block admincontent %}
62 <div id="changelist" class="module filtered">
64 <form method="get" action="" id="changelist-search">
66 <label for="searchbar"><img alt="Search" src="{{ settings.ADMIN_MEDIA_PREFIX }}img/admin/icon_searchbox.png"></label>
67 {{ filter_form.text }}
68 {{ filter_form.node_type }}
69 {{ filter_form.state_type }}
70 <input type="submit" value="{% trans "Search" %}"><br />
71 {{ filter_form.text_in }}
75 <div id="changelist-filter">
76 <h2>{% trans "Filter" %}</h2>
77 <h3>{% trans "By type" %}</h3>
79 {% for type, name in node_types %}
80 <li{% ifequal filter_form.node_type.data type %} class="selected"{% endifequal %}>
81 <a class="node-type-link" href="#{{ type }}">{{ name }}</a>
85 <h3>{% trans "By state" %}</h3>
87 <li{% ifequal filter_form.state_type.data "any" %} class="selected"{% endifequal %}><a class="state-type-link" href="#any">{% trans "any" %}</a></li>
88 {% for state_type in state_types %}
89 <li{% ifequal filter_form.state_type.data state_type %} class="selected"{% endifequal %}>
90 <a class="state-type-link" href="#{{ state_type }}">{{ state_type }}</a>
94 {% comment %}<h3>{% trans "Show" %}</h3>
95 <form action="" method="get">
96 <div>{{ show_form.show }}</div>
97 <input type="submit" value="{% trans "Refresh" %}" />
98 </form>{% endcomment %}
100 <form id="changelist-form" method="POST" action="">
101 <div class="actions">
103 {% trans "Action" %}:
104 <select name="action">
105 <option selected="selected" value="">---------</option>
106 <option value="delete_selected">{% trans "Mark deleted" %}</option>
109 <button value="0" name="index" title="{% trans "Run the selected action" %}" class="button" type="submit">{% trans "Go" %}</button>
111 <table id="result_list" cellspacing="0">
115 <th class="action-checkbox-column">
116 <input type="checkbox" id="action-toggle" style="display: inline;" />
118 {% ifequal filter_form.node_type.data "all" %}
119 <th>{% trans "Type" %}</th>
121 <th class="sorted{% ifequal nodes.paginator.current_sort "title" %} ascending{% endifequal %}">
122 <a href="{{ nodes.paginator.title_sort_link }}">{% trans "Title" %}</a>
124 <th>{% trans "Author" %}</th>
125 <th class="sorted{% ifequal nodes.paginator.current_sort "added_at" %} ascending{% endifequal %}">
126 <a href="{{ nodes.paginator.added_at_sort_link }}">{% trans "Added at" %}</a>
128 <th class="sorted{% ifequal nodes.paginator.current_sort "score" %} ascending{% endifequal %}">
129 <a href="{{ nodes.paginator.score_sort_link }}">{% trans "Score" %}</a>
131 <th>{% trans "Last acivity by" %}</th>
132 <th class="sorted{% ifequal nodes.paginator.current_sort "act_at" %} ascending{% endifequal %}">
133 <a href="{{ nodes.paginator.act_at_sort_link }}">{% trans "Last activity at" %}</a>
139 {% for node in nodes.paginator.page %}
140 <tr class="{% cycle 'row1' 'row2' %}">
141 <td><input type="checkbox" name="_selected_node" value="{{ node.id }}" class="action-select"></td>
142 {% ifequal filter_form.node_type.data "all" %}
143 <th>{{ node.friendly_name }}</th>
145 <td><a href="{{ node.get_absolute_url }}" target="_blank">{{ node.headline }}</a></td>
146 <td><a href="{{ node.author.get_absolute_url }}">{{ node.author.username }}</a></td>
147 <td>{% diff_date node.added_at %}</td>
148 <td>{{ node.score }}</td>
149 <td><a href="{{ node.last_activity_by.get_absolute_url }}">{{ node.last_activity_by.username }}</a></td>
150 <td>{% diff_date node.last_activity_at %}</td>
155 {{ nodes.paginator.page_numbers }}