You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
5.5 KiB
HTML
133 lines
5.5 KiB
HTML
{% extends "layout/basic.html" %}
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="medium-5 columns">
|
|
<div class="section">
|
|
<div class="section__header">
|
|
<h1 class="section__title">{{ _('Testdata') }}</h1>
|
|
<div class="section__tools">
|
|
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
|
<button class="primary rounded button" name="upload_testdata">{{ _('Add File') }}</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{{ noscript_note.render() }}
|
|
<div class="section__body no-padding problem-files-testdata">
|
|
{% if testdata.length %}
|
|
<table class="data-table">
|
|
<colgroup>
|
|
<col class="col--checkbox">
|
|
<col class="col--name">
|
|
<col class="col--size">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th class="col--checkbox">
|
|
<label class="compact checkbox">
|
|
<input type="checkbox" name="select_all" data-checkbox-toggle="testdata">
|
|
</label>
|
|
</th>
|
|
<th class="col--name">{{ _('Filename') }}</th>
|
|
<th class="col--size">{{ _('Size') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{%- for file in testdata -%}
|
|
<tr data-filename="{{ file.name }}" data-size="{{ file.size }}">
|
|
<td class="col--checkbox">
|
|
<label class="compact checkbox">
|
|
<input type="checkbox" data-checkbox-group="testdata" data-checkbox-range>
|
|
</label>
|
|
</td>
|
|
<td class="col--name">
|
|
<a href="{{ url('problem_file_download', {pid: pdoc.docId, filename: file.name, query:{type:'testdata'} }) }}">{{ file.name }}</a>
|
|
</td>
|
|
<td class="col--size">{{ size(file.size) }}</td>
|
|
</tr>
|
|
{%- endfor -%}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
{% if handler.user.own(pdoc) or handler.user.hasPriv(PRIV.PRIV_READ_PROBLEM_DATA) or handler.user.hasPerm(perm.PERM_READ_PROBLEM_DATA) %}
|
|
{{ nothing.render('No testdata at current.') }}
|
|
{% else %}
|
|
{{ nothing.render("You don't have permission to read testdata.")}}
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
|
{% if testdata.length %}
|
|
<div class="section__body">
|
|
<button class="rounded button" name="download_selected_testdata">{{ _('Download Selected') }}</button>
|
|
<button class="rounded button" name="remove_selected_testdata">{{ _('Remove Selected') }}</button>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="medium-4 columns">
|
|
<div class="section">
|
|
<div class="section__header">
|
|
<h1 class="section__title">{{ _('Additional Files') }}</h1>
|
|
<div class="section__tools">
|
|
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
|
<button class="primary rounded button" name="upload_file">{{ _('Add File') }}</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="section__body no-padding problem-files-additional_file">
|
|
{% if additional_file.length %}
|
|
<table class="data-table">
|
|
<colgroup>
|
|
<col class="col--checkbox">
|
|
<col class="col--name">
|
|
<col class="col--size">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th class="col--checkbox">
|
|
<label class="compact checkbox">
|
|
<input type="checkbox" name="select_all" data-checkbox-toggle="additional_file">
|
|
</label>
|
|
</th>
|
|
<th class="col--name">{{ _('Filename') }}</th>
|
|
<th class="col--size">{{ _('Size') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{%- for file in additional_file -%}
|
|
<tr data-filename="{{ file.name }}" data-size="{{ file.size }}">
|
|
<td class="col--checkbox">
|
|
<label class="compact checkbox">
|
|
<input type="checkbox" data-checkbox-group="additional_file" data-checkbox-range>
|
|
</label>
|
|
</td>
|
|
<td class="col--name">
|
|
<a href="{{ url('problem_file_download', {pid: pdoc.docId, filename: file.name}) }}">{{ file.name }}</a>
|
|
</td>
|
|
<td class="col--size">{{ size(file.size) }}</td>
|
|
</tr>
|
|
{%- endfor -%}
|
|
</tbody>
|
|
</table>
|
|
{% else %}
|
|
{{ nothing.render('No additional file at current.') }}
|
|
{% endif %}
|
|
</div>
|
|
{% if additional_file.length %}
|
|
<div class="section__body">
|
|
<button class="rounded button" name="download_selected_file">{{ _('Download Selected') }}</button>
|
|
{% if handler.user.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
|
<button class="rounded button" name="remove_selected_file">{{ _('Remove Selected') }}</button>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="medium-3 columns">
|
|
{% set owner_udoc = udoc %}
|
|
{% include "partials/problem_sidebar.html" %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|