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.
Hydro/packages/ui-default/templates/contest_problemlist.html

186 lines
7.4 KiB
HTML

{% extends "layout/basic.html" %}
{% import "components/contest.html" as contest with context %}
{% import "components/record.html" as record with context %}
{% import "components/problem.html" as problem with context %}
{% block content %}
{{ set(UiContext, 'tdoc', tdoc) }}
{{ set(UiContext, 'tsdoc', tsdoc) }}
<div class="row" data-sticky-parent>
<div class="medium-9 columns">
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Problems') }}</h1>
</div>
<div class="section__body no-padding">
<table class="data-table">
<colgroup>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<col class="col--status">
<col class="col--submit-at">
{% endif %}
<col class="col--problem">
</colgroup>
<thead>
<tr>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
<th class="col--status record-status--border">{{ _('Status') }}</th>
<th class="col--submit-at">{{ _('Last Submit At') }}</th>
{% endif %}
<th class="col--problem">{{ _('Problem') }}</th>
</tr>
</thead>
<tbody>
{%- for pid in tdoc.pids -%}
<tr>
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
{% if psdict[pid] and psdict[pid].rid %}
{% set rdoc = rdict[psdict[pid].rid] %}
{% if model.contest.canShowSelfRecord.call(handler, tdoc) %}
{{ record.render_status_td(rdoc) }}
{% else %}
<td class="col--status record-status--border"><a href="{{ url('record_detail', rid=rdoc._id) }}">{{ _('Submitted') }}</a></td>
{% endif %}
<td class="col--submit-at">{{ datetimeSpan(rdoc._id)|safe }}</td>
{% else %}
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
<td class="col--submit-at">-</td>
{% endif %}
{% endif %}
<td class="col--problem col--problem-name">
<a href="{{ url('problem_detail', pid=pid, query={tid:tdoc.docId}) }}">
<b>{{ String.fromCharCode(65+loop.index0) }}</b>&nbsp;&nbsp;{{ pdict[pid].title }}
</a>
</td>
</tr>
{%- endfor -%}
</tbody>
</table>
</div>
</div>
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Submissions') }}</h1>
</div>
<div class="section__body no-padding">
{% if not canViewRecord %}
{{ nothing.render('According to the contest rules, you cannot view your submission details at current.') }}
{% elif not rdocs.length %}
{{ nothing.render('Oh, there is no submission!') }}
{% else %}
<table class="data-table record_main__table">
<colgroup>
<col class="col--status">
<col class="col--problem">
<col class="col--submit-by">
<col class="col--time">
<col class="col--memory">
<col class="col--lang">
<col class="col--submit-at">
</colgroup>
<thead>
<tr>
<th class="col--status record-status--border">{{ _('Status') }}</th>
<th class="col--problem">{{ _('Problem') }}</th>
<th class="col--submit-by">{{ _('Submit By') }}</th>
<th class="col--time">{{ _('Time') }}</th>
<th class="col--memory">{{ _('Memory') }}</th>
<th class="col--lang">{{ _('Language') }}</th>
<th class="col--submit-at">{{ _('Submit At') }}</th>
</tr>
</thead>
<tbody>
{%- for rdoc in rdocs -%}
{% set udoc = udict[rdoc['uid']] %}
{% set pdoc = pdict[rdoc['pid']] %}
{% include 'record_main_tr.html' %}
{%- endfor -%}
</tbody>
</table>
{% endif %}
</div>
</div>
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Contest Clarifications') }}</h1>
</div>
<div class="section__body">
{% if not tcdocs.length %}
{{ nothing.render('Oh, there is no clarification!') }}
{% else %}
<ul class="dczcomments__list">
{% for doc in tcdocs %}
<li class="dczcomments__item">
<div class="media">
<div class="media__body top">
<div class="clearfix">
<div class="supplementary dczcomments__supplementary">
{{_('Subject') }}: {{ contest.render_clarification_subject(tdoc,pdict,doc.subject) }} | {% if doc.owner == 0 %}<b>{{ _('Jury') }}</b>{% else %}{{ user.render_inline(udict[doc.owner], badge=false) }}{% endif %} @ {{ datetimeSpan(doc._id)|safe }}
</div>
</div>
<div class="typo" data-emoji-enabled>
{{ doc['content']|markdown|safe }}
</div>
</div>
</div>
<ul class="dczcomments__replies">
{%- for rdoc in doc['reply'] -%}
<li class="dczcomments__reply">
<div class="media">
<div class="media__left top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
<div class="media__body top">
<div class="clearfix">
<div class="supplementary dczcomments__supplementary">
<b>{{ _('Jury') }}</b> @ {{ datetimeSpan(rdoc['_id'])|safe }}
</div>
</div>
<div class="typo" data-emoji-enabled>
{{ rdoc['content']|markdown|safe }}
</div>
</div>
</div>
</li>
{%- endfor -%}
</ul>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% if tsdoc.attend %}
<div class="section__header">
<h1 class="section__title">{{ _('Send Clarification Request') }}</h1>
</div>
<div class="section__body typo">
<form method="post">
<input type="hidden" name="operation" value="clarification">
<div class="row">
<div class="medium-12 columns form__item">
<label>
{{ _('Subject') }}
<select name="subject" class="select">
<option value="0">{{ _('General Issue') }}</option>
<option value="-1">{{ _('Technical Issue') }}</option>
{% for pid in tdoc.pids %}
<option value="{{ pid }}">{{ String.fromCharCode(65+loop.index0) }}. {{ pdict[pid].title }}</option>
{% endfor %}
</select>
</label>
</div>
<div class="medium-12 columns form__item">
<label>
{{ _('Content') }}
<textarea name="content" class="textbox" data-markdown required></textarea>
</label>
</div>
</div>
<button type="submit" class="rounded primary button">{{ _('Submit') }}</button>
</div>
{% endif %}
</div>
</div>
<div class="medium-3 columns" data-sticky="large">
{% set owner_udoc = udict[tdoc.owner] %}
{% include "partials/contest_sidebar.html" %}
</div>
</div>
{% endblock %}