mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
210 lines
8.5 KiB
HTML
210 lines
8.5 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) }}
|
|
{% set hasCorrection = correction and Object.keys(correction).length %}
|
|
<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 %}
|
|
{% if showScore %}
|
|
<col class="col--score">
|
|
{% 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>
|
|
{% if hasCorrection %}
|
|
<th class="col--correction">{{ _('Correction') }}</th>
|
|
{% else %}
|
|
<th class="col--submit-at">{{ _('Last Submit At') }}</th>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if showScore %}
|
|
<th class="col--score">{{ _('Score') }}</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) %}
|
|
{% set displayScore = ((tdoc.score[pid]|default(100)) * (psdict[pid].score|default(0)) / 100) if showScore else (psdict[pid].penaltyScore|default(psdict[pid].score)) %}
|
|
{{ record.render_status_td(rdoc, displayScore=displayScore) }}
|
|
{% else %}
|
|
<td class="col--status record-status--border"><a href="{{ url('record_detail', rid=rdoc._id) }}">{{ _('Submitted') }}</a></td>
|
|
{% endif %}
|
|
{% if not hasCorrection %}
|
|
<td class="col--submit-at">{{ datetimeSpan(rdoc._id)|safe }}</td>
|
|
{% endif %}
|
|
{% else %}
|
|
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
|
|
{% if not hasCorrection %}
|
|
<td class="col--submit-at">-</td>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if hasCorrection %}
|
|
{% if correction[pid] %}
|
|
{{ record.render_status_td(rdict[correction[pid].rid], class="col--correction") }}
|
|
{% else %}
|
|
<td class="col--correction">-</td>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if showScore %}
|
|
<td class="col--score">{{ tdoc.score[pid]|default(100) }}</td>
|
|
{% endif %}
|
|
<td class="col--problem col--problem-name">
|
|
{{ problem.render_problem_title(pdict[pid], tdoc, alphabetic=true) }}
|
|
</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 richmedia" 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"> </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 richmedia" 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 }}">{{ utils.getAlphabeticId(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 %} |