Skip to content

Commit a865d54

Browse files
Merge pull request #93 from unicef/feature/247252-export-fields-have-ability-to-check-all
AB#247252: Export Fields have ability to check all
2 parents c947c3e + e988b6d commit a865d54

File tree

2 files changed

+33
-16
lines changed

2 files changed

+33
-16
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$(function () {
2+
$("#select-all").change(function () {
3+
$(this)
4+
.closest("form")
5+
.find("input:checkbox")
6+
.not(this)
7+
.prop('checked', this.checked);
8+
})
9+
})
Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
{% extends "workspace/actions/base.html" %}{% load i18n %}
1+
{% extends "workspace/actions/base.html" %}{% load i18n static %}
22
{% block content %}
3-
<div>
4-
Select the columns you want to update
5-
</div>
6-
<form method="post" id="bulk-update-form">
7-
<div class="submit-row">
8-
<input type="submit" value="{% translate 'Export' %}" class="default" name="_export">
9-
</div>
10-
{% csrf_token %}
11-
<table>
12-
{{ form.as_table }}
13-
</table>
14-
{% load admin_urls i18n workspace_urls %}
15-
<div class="submit-row float-right">
16-
<input type="submit" value="{% translate 'Export' %}" class="default" name="_export">
3+
<div>
4+
Select the columns you want to update
175
</div>
6+
<form method="post" id="bulk-update-form">
7+
<div class="submit-row">
8+
<input type="submit" value="{% translate 'Export' %}" class="default" name="_export">
9+
</div>
10+
{% csrf_token %}
11+
<label for="select-all">
12+
<input type="checkbox" id="select-all">Select all
13+
</label>
14+
<table>
15+
{{ form.as_table }}
16+
</table>
17+
{% load admin_urls i18n workspace_urls %}
18+
<div class="submit-row float-right">
19+
<input type="submit" value="{% translate 'Export' %}" class="default" name="_export">
20+
</div>
1821

19-
</form>
22+
</form>
23+
{% block admin_change_form_document_ready %}
24+
{% block document_ready %}
25+
<script src="{% static 'workspace/js/select-all.js' %}"></script>
26+
{% endblock document_ready %}
27+
{% endblock admin_change_form_document_ready %}
2028
{% endblock content %}

0 commit comments

Comments
 (0)