|
2 | 2 |
|
3 | 3 | {% set page = "test_interface" %} |
4 | 4 |
|
5 | | -{% block js_init %} |
| 5 | +{% block additional_js %} |
6 | 6 | // Define TASK_LANGUAGES for task-specific language filtering |
7 | 7 | var TASK_LANGUAGES = { |
8 | | -{% for lang in task.get_allowed_languages() or [] %} |
9 | | - '{{ lang }}': { |
10 | | -{% for extension in (lang|to_language).source_extensions %} |
11 | | - '{{ extension }}': true, |
12 | | -{% endfor %} |
13 | | - }, |
| 8 | +{% for task in contest.tasks %} |
| 9 | + '{{ task.name }}': { |
| 10 | + {% for lang in task.get_allowed_languages() or [] %} |
| 11 | + '{{ lang }}': { |
| 12 | + {% for extension in (lang|to_language).source_extensions %} |
| 13 | + '{{ extension }}': true, |
| 14 | + {% endfor %} |
| 15 | + }, |
| 16 | + {% endfor %} |
| 17 | + }, |
14 | 18 | {% endfor %} |
15 | 19 | }; |
16 | | -{% endblock js_init %} |
17 | 20 |
|
18 | | -{% block additional_js %} |
19 | 21 | $(document).on("click", ".user_test_list tbody tr td.status .details", function (event) { |
20 | 22 | var $this = $(this); |
21 | 23 | var task_id = $this.parent().parent().parent().parent().attr("data-task"); |
@@ -117,8 +119,10 @@ <h2 style="margin-bottom: 10px">{% trans %}Submit a test{% endtrans %}</h2> |
117 | 119 | <div class="controls"> |
118 | 120 | <input type="file" class="input-xlarge" |
119 | 121 | id="input{{ loop.index0 }}" name="{{ filename }}" |
120 | | - onchange="CMS.CWSUtils.filter_languages($(this).parents('form').find('select[name=language] option'), |
121 | | - $(this).parents('form').find('input[type=file]').not('#input_file'), TASK_LANGUAGES)"/> |
| 122 | + onchange="CMS.CWSUtils.filter_languages( |
| 123 | + $(this).parents('form').find('select[name=language] option'), |
| 124 | + $(this).parents('form').find('input[type=file]').not('#input_file'), |
| 125 | + TASK_LANGUAGES['{{ task.name }}'])"/> |
122 | 126 | </div> |
123 | 127 | </div> |
124 | 128 | {% endfor %} |
|
0 commit comments