Skip to content

Commit 3d27d61

Browse files
committed
Change school_select_form selects to select2
1 parent 20c3aec commit 3d27d61

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed
Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
{% load i18n %}
2+
3+
{% block head %}
4+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
5+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
6+
{% endblock head %}
7+
8+
{% block styles %}
9+
<style>
10+
.select2-container {
11+
width: 100% !important;
12+
}
13+
</style>
14+
{% endblock styles %}
15+
216
{% for suffix, opts, selected in options %}
317
<p>
418
<select name="{{ attr.name }}{{ suffix }}" id="{{ attr.id }}{{ suffix }}">
@@ -10,8 +24,20 @@
1024
</select>
1125
</p>
1226
{% endfor %}
13-
{% if show_add_new %}
14-
{% blocktrans %}
15-
If you can not find your school on the list, please <button type="submit" class="btn btn-xs btn-link" name="_add_school">add it</button>.
16-
{% endblocktrans %}
17-
{% endif %}
27+
{% blocktrans %}
28+
If you cannot find your school on the list, please contact the organiser.
29+
{% endblocktrans %}
30+
31+
{% block script %}
32+
<script>
33+
$(document).ready(function() {
34+
$('#id_school_province').select2();
35+
});
36+
$(document).ready(function() {
37+
$('#id_school_city').select2();
38+
});
39+
$(document).ready(function() {
40+
$('#id_school').select2();
41+
});
42+
</script>
43+
{% endblock script %}

0 commit comments

Comments
 (0)