mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: contest: add print (#1036)
Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
1 parent
1c7b2275ff
commit
720eb6b7e0
13 files changed
+419
-6
No files matched your search
@@ -166,6 +166,14 @@
|
||||
value:tdoc.allowViewCode|default(true),
|
||||
row:false
|
||||
}) }}
|
||||
{{ form.form_checkbox({
|
||||
columns:4,
|
||||
label:'Allow Print',
|
||||
name:'allowPrint',
|
||||
placeholder:_('Allow user to print during contest'),
|
||||
value:tdoc.allowPrint|default(false),
|
||||
row:false
|
||||
}) }}
|
||||
<div style="display: none" class="contest-rule-settings contest-rule--acm contest-rule--ioi">
|
||||
{{ form.form_text({
|
||||
columns:4,
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{% extends "layout/basic.html" %}
|
||||
{% import "components/contest.html" as contest with context %}
|
||||
{% import "components/form.html" as form with context %}
|
||||
{% block content %}
|
||||
{{ set(UiContext, 'tdoc', tdoc) }}
|
||||
{{ set(UiContext, 'tsdoc', tsdoc) }}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Print Request') }} - {{ tdoc.title }}</h1>
|
||||
<div class="section__tools">
|
||||
{% if handler.user.own(tdoc) or handler.user.hasPerm(perm.PERM_EDIT_CONTEST) %}
|
||||
<button class="primary rounded button" name="enable_print_kiosk">{{ _('Enable Print Kiosk') }}</button>
|
||||
{% endif %}
|
||||
<button class="primary rounded button" name="add_print_task">{{ _('Print New File') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section__body no-padding" id="printKioskContainer" {% if handler.user.own(tdoc) or handler.user.hasPerm(perm.PERM_EDIT_CONTEST) %}data-is-admin="true" {% endif %}></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
{% set owner_udoc = udict[tdoc.owner] %}
|
||||
{% include "partials/contest_sidebar.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -78,6 +78,11 @@
|
||||
<span class="icon icon-statistics"></span> {{ _('Scoreboard (Hidden)') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if tdoc.allowPrint and (tsdoc.attend or handler.user.own(tdoc) or handler.user.hasPerm(perm.PERM_EDIT_CONTEST)) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_print', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-print"></span> {{ _('Print') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user.own(tdoc) or handler.user.hasPerm(perm.PERM_EDIT_CONTEST) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_edit', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit Contest') }}
|
||||
|
||||
Reference in new issue
Block a user