Modify some select2 box

This commit is contained in:
cuom1999 2024-02-05 15:15:32 -06:00
parent 847e8b6660
commit 695fa85b19
13 changed files with 50 additions and 31 deletions

View file

@ -522,7 +522,9 @@
$('#search-handle').select2({
placeholder: '<i class="fa fa-search"></i> {{ _('Search by handle...') }}',
ajax: {
url: '{{ url('chat_user_search_select2_ajax') }}'
url: '{{ url('chat_user_search_select2_ajax') }}',
delay: 250,
cache: true,
},
minimumInputLength: 1,
escapeMarkup: function (markup) {

View file

@ -161,7 +161,9 @@
$('#search-contest').select2({
placeholder: placeholder,
ajax: {
url: '{{ url('contest_user_search_select2_ajax', contest.key) }}'
url: '{{ url('contest_user_search_select2_ajax', contest.key) }}',
cache: true,
delay: 250,
},
minimumInputLength: 1,
escapeMarkup: function (markup) {

View file

@ -128,12 +128,14 @@
{% block before_table %}
{% include "contest/contest-datetime.html" %}
<div style="margin-bottom: 0.5em">
{% if page_type == 'participation' %}
{% if contest.can_see_full_scoreboard(request.user) %}
{% if page_type == 'participation' %}
{% if contest.can_see_full_scoreboard(request.user) %}
<div style="margin-bottom: 0.5em">
<input id="search-contest" type="text" placeholder="{{ _('View user participation') }}">
{% endif %}
</div>
{% endif %}
{% endif %}
<div style="margin-bottom: 0.5em">
<input id="show-schools-checkbox" type="checkbox" style="vertical-align: bottom">
<label for="show-schools-checkbox" style="vertical-align: bottom; margin-right: 1em;">{{ _('Show schools') }}</label>

View file

@ -90,7 +90,15 @@
.css({'visibility': 'visible'});
$('#search-org').select2({multiple: 1, placeholder: '{{ _('Groups') }}...'})
.css({'visibility': 'visible'});
$('#search-author').select2({multiple: 1, placeholder: '{{ _('Authors') }}...'})
$('#search-author').select2({
multiple: 1,
placeholder: '{{ _('Authors') }}...',
ajax: {
url: '{{ url('problem_authors_select2_ajax') }}',
delay: 250,
cache: true,
}
})
.css({'visibility': 'visible'});
// This is incredibly nasty to do but it's needed because otherwise the select2 steals the focus

View file

@ -49,9 +49,9 @@
<div class="filter-form-group">
<label class="bold-text margin-label" for="type"><i class="non-italics">{{ _('Author') }}</i></label>
<select id="search-author" name="authors" multiple>
{% for author in all_authors %}
<option value="{{ author.id }}"{% if author.id in author_query %} selected{% endif %}>
{{ author.user__username }}
{% for author in author_query %}
<option value="{{ author.id }}" selected>
{{ author.username }}
</option>
{% endfor %}
</select>

View file

@ -275,10 +275,6 @@
col.sub-info, td.sub-info {
width: 78%
}
#status, #language {
visibility: hidden;
}
</style>
{% endif %}

View file

@ -193,6 +193,8 @@
}
};
},
delay: 250,
cache: true,
},
};

View file

@ -9,7 +9,9 @@
$('#search-handle').select2({
placeholder: '{{ _('Search by handle...') }}',
ajax: {
url: '{{ url('user_search_select2_ajax') }}'
url: '{{ url('user_search_select2_ajax') }}',
delay: 250,
cache: true,
},
minimumInputLength: 1,
escapeMarkup: function (markup) {