core&ui: add contest private files (#1053)

Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
undefinedandpanda authored and GitHub committed 2025-10-17 10:24:38 +01:00
1 parent 9729346ad9
commit f5ef8b7f38
35 files changed
+781 -843

No files matched your search

@@ -29,6 +29,9 @@
<li class="menu__item"><a class="menu__link" href="{{ url('contest_balloon', tid=tdoc.docId) }}">
<span class="icon icon-balloon"></span> {{ _('Balloon Status') }}
</a></li>
<li class="menu__item"><a class="menu__link" href="{{ url('contest_clarification', tid=tdoc.docId) }}">
<span class="icon icon-comment--text"></span> {{ _('Contest Clarifications') }}
</a></li>
<li class="menu__seperator"></li>
</ol>
</div>
@@ -1,44 +1,49 @@
{% import "components/nothing.html" as nothing with context %}
<div class="section__body no-padding files" data-fragment-id="files">
<div class="section__body no-padding files" {% if filetype %}data-type="{{ filetype }}"{% endif %} data-fragment-id="files{% if filetype %}-{{ filetype }}{% endif %}">
{% if files.length %}
<table class="data-table">
<colgroup>
<col class="col--checkbox">
{% if not sidebar %}<col class="col--checkbox">{% endif %}
<col class="col--name">
<col class="col--size">
<col class="col--operation">
</colgroup>
<thead>
<tr>
{% if not sidebar %}
<th class="col--checkbox">
<label class="compact checkbox">
<input type="checkbox" name="select_all" data-checkbox-toggle="files">
<input type="checkbox" name="select_all" data-checkbox-toggle="{{ filetype|default('files') }}">
</label>
</th>
{% endif %}
<th class="col--name">{{ _('Filename') }}</th>
<th class="col--size">{{ _('Size') }}</th>
<th class="col--operation"></th>
<th class="col--operation"><span class="icon icon-wrench"></span></th>
</tr>
</thead>
<tbody>
{%- for file in files -%}
<tr data-filename="{{ file.name }}" data-size="{{ file.size }}">
{% if not sidebar %}
<td class="col--checkbox">
<label class="compact checkbox">
<input type="checkbox" data-checkbox-group="files" data-checkbox-range>
<input type="checkbox" data-checkbox-group="{{ filetype|default('files') }}" data-checkbox-range>
</label>
</td>
{% endif %}
<td class="col--name" data-preview>
<a href="{{ urlForFile(file.name) }}">{{ file.name }}</a>
<a href="{{ urlForFile(file.name, filetype) }}">{{ file.name }}</a>
</td>
<td class="col--size">{{ size(file.size) }}</td>
<td class="col--operation">
<a href="{{ urlForFile(file.name) }}" class="icon icon-download"></a>
<a href="{{ urlForFile(file.name, filetype) }}" class="icon icon-download"></a>
</td>
</tr>
{%- endfor -%}
</tbody>
</table>
{% else %}
{{ nothing.render('There are no files currently.') }}
{{ nothing.render('There are no files currently.', compact=true) }}
{% endif %}
</div>
@@ -1,7 +1,7 @@
{% import "components/nothing.html" as nothing with context %}
{% set _files = testdata if filetype == 'testdata' else additional_file %}
<div class="section__body no-padding problem-{{ 'sidebar' if sidebar else 'files' }}-{{ filetype }}" data-fragment-id="problem-files-{{ filetype }}"
{% if sidebar %}data-type="{{ filetype }}" data-sidebar{% endif %}>
<div class="section__body files no-padding problem-{{ 'sidebar' if sidebar else 'files' }}-{{ filetype }}" data-fragment-id="problem-files-{{ filetype }}"
data-type="{{ filetype }}" {% if sidebar %}data-sidebar{% endif %}>
{% if reference %}
<blockquote class="note">
<p>{{ _('This is a copy of another problem.') }}</p>
@@ -49,8 +49,8 @@
<td class="col--size">{{ size(file.size) }}</td>
{% if can_edit %}
<td class="col--operation">
<a href="javascript:;" name="{{ filetype }}__rename"><span class="icon icon-edit"></span></a>
<a href="javascript:;" name="{{ filetype }}__delete"><span class="icon icon-delete"></span></a>
<a href="javascript:;" name="file_rename"><span class="icon icon-edit"></span></a>
<a href="javascript:;" name="file_remove"><span class="icon icon-delete"></span></a>
</td>
{% endif %}
</tr>