diff --git a/django/contrib/admin/media/css/changelists.css b/django/contrib/admin/media/css/changelists.css
index 649cff7..a10af1a 100644
a
|
b
|
|
228 | 228 | border-right: 1px solid #ddd; |
229 | 229 | } |
230 | 230 | |
| 231 | .action_counter{ |
| 232 | font-size: 11px; |
| 233 | margin: 0 0.5em; |
| 234 | padding-right: 0.5em; |
| 235 | border-right: 1px solid #ccc; |
| 236 | } |
| 237 | |
231 | 238 | #changelist .actions { |
232 | 239 | color: #666; |
233 | 240 | padding: 3px; |
diff --git a/django/contrib/admin/media/js/actions.js b/django/contrib/admin/media/js/actions.js
index b5e556a..82a8156 100644
a
|
b
|
|
1 | 1 | var Actions = { |
2 | 2 | init: function() { |
| 3 | counterSpans = document.getElementsBySelector('span._acnt'); |
| 4 | actionCheckboxes = document.getElementsBySelector('tr input.action-select'); |
3 | 5 | selectAll = document.getElementById('action-toggle'); |
4 | 6 | if (selectAll) { |
5 | 7 | selectAll.style.display = 'inline'; |
6 | 8 | addEvent(selectAll, 'click', function() { |
7 | 9 | Actions.checker(selectAll.checked); |
| 10 | Actions.counter(); |
| 11 | }); |
| 12 | } |
| 13 | for(var i = 0; i < actionCheckboxes.length; i++) { |
| 14 | addEvent(actionCheckboxes[i], 'click', function() { |
| 15 | Actions.counter(); |
8 | 16 | }); |
9 | 17 | } |
10 | 18 | }, |
11 | 19 | checker: function(checked) { |
12 | | actionCheckboxes = document.getElementsBySelector('tr input.action-select'); |
13 | 20 | for(var i = 0; i < actionCheckboxes.length; i++) { |
14 | 21 | actionCheckboxes[i].checked = checked; |
15 | 22 | } |
| 23 | }, |
| 24 | counter: function() { |
| 25 | counter = 0; |
| 26 | for(var i = 0; i < actionCheckboxes.length; i++) { |
| 27 | if(actionCheckboxes[i].checked){ |
| 28 | counter++; |
| 29 | } |
| 30 | } |
| 31 | for(var i = 0; i < counterSpans.length; i++) { |
| 32 | counterSpans[i].innerHTML = counter; |
| 33 | } |
16 | 34 | } |
17 | 35 | } |
18 | 36 | |
19 | | addEvent(window, 'load', Actions.init); |
| 37 | addEvent(window, 'load', Actions.init); |
| 38 | No newline at end of file |
diff --git a/django/contrib/admin/templates/admin/actions.html b/django/contrib/admin/templates/admin/actions.html
index bf4b975..4fea071 100644
a
|
b
|
|
1 | 1 | {% load i18n %} |
2 | 2 | <div class="actions"> |
| 3 | <span class="action_counter"> |
| 4 | {% ifequal cl.result_count 1 %} |
| 5 | {% blocktrans with cl.result_count as total_count and cl.opts.verbose_name as module_name %}<span class="_acnt">0</span> of {{ total_count }} {{ module_name }} selected{% endblocktrans %} |
| 6 | {% else %} |
| 7 | {% blocktrans with cl.result_count as total_count and cl.opts.verbose_name_plural as module_name %}<span class="_acnt">0</span> of {{ total_count }} {{ module_name }} selected{% endblocktrans %} |
| 8 | {% endifequal %} |
| 9 | </span> |
3 | 10 | {% for field in action_form %}<label>{{ field.label }} {{ field }}</label>{% endfor %} |
4 | 11 | <button type="submit" class="button" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button> |
5 | 12 | </div> |