mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: handle contest status display
This commit is contained in:
1 parent
069f420310
commit
78b1141a02
12 files changed
+29
-31
No files matched your search
@@ -53,11 +53,13 @@
|
||||
{% set extra_attr = args.extra_attr %}
|
||||
{% set date = args.date or false %}
|
||||
{% set time = args.time or false %}
|
||||
{% set datetime = args.datetime or false %}
|
||||
class="{{ form_class }}{% if extra_class %} {{ extra_class }}{% endif %}"
|
||||
{% if disabled %}disabled{% endif %}
|
||||
{% if required %}required{% endif %}
|
||||
{% if autofocus %}autofocus data-autofocus{% endif %}
|
||||
{% if noAutocomplete %}autocomplete="off"{% endif %}
|
||||
{% if datetime %}data-pick-datetime{% endif %}
|
||||
{% if date %}data-pick-date{% endif %}
|
||||
{% if time %}data-pick-time{% endif %}
|
||||
{% if extra_attr %}{{ extra_attr }}{% endif %}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<h1 class="section__title">{{ tdoc.title }}</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<span class="bp4-tag bp4-large bp4-minimal problem__tag-item">{{ _(model.contest.statusText(tdoc)) }}</span>
|
||||
<span class="bp4-tag bp4-large bp4-minimal problem__tag-item">{{ _(model.contest.statusText(tdoc, tsdoc)) }}</span>
|
||||
<span class="bp4-tag bp4-large bp4-minimal problem__tag-item icon icon-award">{{ _(model.contest.RULES[tdoc.rule].TEXT) }}</span>
|
||||
<span class="bp4-tag bp4-large bp4-minimal problem__tag-item">{{ _('Start at') }}: {{ contest.render_time(tdoc.beginAt) }}</span>
|
||||
<span class="bp4-tag bp4-large bp4-minimal problem__tag-item icon icon-schedule">{{ contest.render_duration(tdoc) }} {{ _('hour(s)') }}</span>
|
||||
@@ -25,14 +25,14 @@
|
||||
<div class="section">
|
||||
<div class="section__body typo">
|
||||
{{ tdoc['content']|markdown|safe }}
|
||||
{% if model.contest.isOngoing(tdoc) %}
|
||||
{% if model.contest.isOngoing(tdoc, tsdoc) %}
|
||||
<blockquote class="warn">
|
||||
<p>{{ _('We will check code similarity after this contest.') }}</p>
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if model.contest.isOngoing(tdoc) or model.contest.isDone(tdoc, tsdoc) %}
|
||||
{% if model.contest.isOngoing(tdoc, tsdoc) or model.contest.isDone(tdoc, tsdoc) %}
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Problem') }}</h1>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
label:'Begin Date',
|
||||
name:'beginAtDate',
|
||||
placeholder:'YYYY-mm-dd',
|
||||
value:date_text,
|
||||
value:beginAt.format('%Y-%m-%d'),
|
||||
date:true,
|
||||
row:false
|
||||
}) }}
|
||||
@@ -55,7 +55,7 @@
|
||||
label:'Begin Time',
|
||||
name:'beginAtTime',
|
||||
placeholder:'HH:MM',
|
||||
value:time_text,
|
||||
value:beginAt.format('%H:%M'),
|
||||
time:true,
|
||||
row:false
|
||||
}) }}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
{%- for tdoc in tdocs -%}
|
||||
{% if model.contest.isOngoing(tdoc) %}
|
||||
{% if model.contest.isOngoing(tdoc, tsdoc) %}
|
||||
{{ render_important_contest('live', 'Live...', tdoc) }}
|
||||
{% elif model.contest.isUpcoming(tdoc) %}
|
||||
{{ render_important_contest('ready', 'Ready (☆▽☆)', tdoc) }}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<dl class="large horizontal">
|
||||
<dt>{{ _('Status') }}</dt>
|
||||
<dd>
|
||||
{{ _(model.contest.statusText(tdoc)) }}
|
||||
{{ _(model.contest.statusText(tdoc, tsdoc)) }}
|
||||
{% if tsdoc.attend %}
|
||||
({{ _('Attended') }})
|
||||
{% endif %}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<ol class="section__list contest__list">
|
||||
{%- for tdoc in tdocs -%}
|
||||
<li class="section__list__item contest__item contest-type--{{ tdoc.rule }} {% if model.contest.isOngoing(tdoc) %}{{ 'live' }}{% elif model.contest.isUpcoming(tdoc) %}{{ 'ready' }}{% endif %}">
|
||||
<li class="section__list__item contest__item contest-type--{{ tdoc.rule }} {% if model.contest.isOngoing(tdoc, tsdoc) %}{{ 'live' }}{% elif model.contest.isUpcoming(tdoc) %}{{ 'ready' }}{% endif %}">
|
||||
<div class="media">
|
||||
<div class="media__left medium">
|
||||
<div class="contest__date numbox">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if model.contest.isOngoing(tdoc) %}
|
||||
{% if model.contest.isOngoing(tdoc, tsdoc) %}
|
||||
{% if page_name == 'contest_detail_problem' %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link highlight" name="problem-sidebar__open-scratchpad" href="javascript:;" data-global-hotkey="alt+e">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Open Scratchpad') }} (Alt+E)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if model.contest.isOngoing(tdoc) or model.contest.isExtended(tdoc) %}
|
||||
{% if model.contest.isOngoing(tdoc, tsdoc) or model.contest.isExtended(tdoc, tsdoc) %}
|
||||
{% if page_name == 'homework_detail_problem' %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link highlight" name="problem-sidebar__open-scratchpad" href="javascript:;" data-global-hotkey="alt+e">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Open Scratchpad') }} (Alt+E)
|
||||
|
||||
Reference in new issue
Block a user