-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change school_select_form selects to select2
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
{% load i18n %} | ||
{% load i18n static %} | ||
|
||
{% block head %} | ||
{% comment %} <link href="{% static 'oi/select2.min.css' %}" rel="stylesheet" /> | ||
<script src="{% static 'oi/select2.min.js' %}"></script> {% endcomment %} | ||
|
||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" /> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script> | ||
|
||
{% endblock head %} | ||
|
||
{% block styles %} | ||
<style> | ||
.select2-container { | ||
width: 100% !important; | ||
} | ||
</style> | ||
{% endblock styles %} | ||
|
||
|
||
{% for suffix, opts, selected in options %} | ||
<p> | ||
<select name="{{ attr.name }}{{ suffix }}" id="{{ attr.id }}{{ suffix }}"> | ||
|
@@ -15,3 +34,17 @@ | |
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>. | ||
{% endblocktrans %} | ||
{% endif %} | ||
|
||
{% comment %} {% block script %} | ||
<script> | ||
$(document).ready(function() { | ||
$('#id_school_province').select2(); | ||
}); | ||
$(document).ready(function() { | ||
$('#id_school_city').select2(); | ||
}); | ||
$(document).ready(function() { | ||
$('#id_school').select2(); | ||
}); | ||
</script> | ||
{% endblock script %} {% endcomment %} |