mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui-default: init
将ui-default合并至主存储库便于维护
This commit is contained in:
1 parent
6317c9057f
commit
5faa54c7ca
564 files changed
+23083
-14
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<ul class="group-list" data-widget-cf-container>
|
||||
{%- for category, sub_categories in model.system.get('problem.categories')|parseYaml -%}
|
||||
<li class="group-list__item">
|
||||
<h2 class="section__title">
|
||||
<a href="{{ url('problem_category', category=category) }}" data-category="{{ category }}">{{ category }}</a>
|
||||
</h2>
|
||||
{% if sub_categories | length > 0 %}
|
||||
<ol class="chip-list">
|
||||
{%- for sub_category in sub_categories -%}
|
||||
<li class="chip-list__item">
|
||||
<a class="typo-a" href="{{ url('problem_category', category=(category + ',' + sub_category)) }}">{{ sub_category }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
{% endif %}
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
@@ -0,0 +1,92 @@
|
||||
{% import "components/user.html" as user with context %}
|
||||
{% import "components/contest.html" as contest with context %}
|
||||
<div class="section side">
|
||||
{% if page_name != 'contest_detail' %}
|
||||
<a class="contest-sidebar__bg" href="{{ url('contest_detail', tid=tdoc.docId) }}">
|
||||
<div class="section__body">
|
||||
<h1>{{ tdoc.title }}</h1>
|
||||
<div class="contest-sidebar__status">
|
||||
{% if attended %}
|
||||
<span class="icon icon-check"></span> {{ _('Attended') }}
|
||||
{% else %}
|
||||
<span class="icon icon-schedule"></span> {{ _('Not Attended') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if page_name != 'contest_detail' %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_detail', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-award"></span> {{ _('View Contest') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if not attended and not model.contest.isDone(tdoc) %}
|
||||
<li class="menu__item">
|
||||
{% if handler.user.hasPerm(perm.PERM_ATTEND_CONTEST) and handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<form action="{{ url('contest_detail', tid=tdoc.docId) }}" method="POST">
|
||||
<input type="hidden" name="operation" value="attend">
|
||||
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
||||
<button class="menu__link" type="submit">
|
||||
<span class="icon icon-add"></span> {{ _('Attend Contest') }}
|
||||
</button>
|
||||
</form>
|
||||
{% elif not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<a class="menu__link" href="javascript:showSignInDialog()">
|
||||
<span class="icon icon-add"></span> {{ _('Login to Attend Contest') }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="menu__link disabled" href="javascript:;">
|
||||
<span class="icon icon-add"></span> {{ _('No Permission to Attend Contest') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if handler.canShowScoreboard(tdoc, False) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_scoreboard', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-statistics"></span> {{ _('Scoreboard') }}
|
||||
</a></li>
|
||||
{% elif handler.canViewHiddenScoreboard(tdoc) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_scoreboard', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-statistics"></span> {{ _('Scoreboard (Hidden)') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if user._id == tdoc.owner 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') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_READ_RECORD_CODE) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_code', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-download"></span> {{ _('Export All Code') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('record_main', query={tid:tdoc.docId}) }}">
|
||||
<span class="icon icon-flag"></span> {{ _('All Submissions') }}
|
||||
</a></li>
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('wiki_help', anchor='contest') }}">
|
||||
<span class="icon icon-help"></span> {{ _('Help') }}
|
||||
</a></li>
|
||||
<li class="menu__seperator"></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section__body typo">
|
||||
<dl class="large horizontal">
|
||||
<dt>{{ _('Status') }}</dt><dd>{{ _(model.contest.statusText(tdoc)) }}</dd>
|
||||
<dt>{{ _('Rule') }}</dt><dd>{{ model.contest.RULES[tdoc.rule].TEXT }}</dd>
|
||||
<dt>{{ _('Problem') }}</dt><dd>{{ tdoc.pids.length }}</dd>
|
||||
<dt>{{ _('Start at') }}</dt><dd>{{ contest.render_time(tdoc.beginAt) }}</dd>
|
||||
<dt>{{ _('End at') }}</dt><dd>{{ contest.render_time(tdoc.endAt) }}</dd>
|
||||
<dt>{{ _('Duration') }}</dt><dd>{{ contest.render_duration(tdoc) }} {{ _('hour(s)') }}</dd>
|
||||
<dt>{{ _('Host') }}</dt><dd>{{ user.render_inline(owner_udoc, badge=false) }}</dd>
|
||||
<dt>{{ _('Partic.') }}</dt>
|
||||
<dd>
|
||||
{{ tdoc['attend']|default(0) }}
|
||||
{% if attended %}
|
||||
({{ _('Attended') }})
|
||||
{% endif %}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,46 @@
|
||||
{% import "components/form.html" as form with context %}
|
||||
<div class="row">
|
||||
<div class="medium-8 columns">
|
||||
<label>
|
||||
{{ _('Title') }}
|
||||
<input
|
||||
name="title" placeholder="{{ _('title') }}"
|
||||
value="{{ ddoc.title|default('') }}"
|
||||
class="textbox" autofocus>
|
||||
</label>
|
||||
</div>
|
||||
<div class="medium-2 columns">
|
||||
<label>
|
||||
{{ _('Highlight') }}
|
||||
<br>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="highlight" value="on"
|
||||
{%- if ddoc.highlight %} checked{% endif -%}
|
||||
{%- if not handler.user.hasPerm(perm.PERM_HIGHLIGHT_DISCUSSION) %} disabled{% endif -%}
|
||||
>{{ _('Highlight') }}
|
||||
</label>
|
||||
</label>
|
||||
</div>
|
||||
<div class="medium-2 columns">
|
||||
<label>
|
||||
{{ _('Pin') }}
|
||||
<br>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="pin" value="on"
|
||||
{%- if ddoc.pin %} checked{% endif -%}
|
||||
{%- if not handler.user.hasPerm(perm.PERM_PIN_DISCUSSION) %} disabled{% endif -%}
|
||||
>{{ _('Pin') }}
|
||||
</label>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{{ form.form_textarea({
|
||||
columns:12,
|
||||
label:'Content',
|
||||
name:'content',
|
||||
value:ddoc.content|default(''),
|
||||
hotkeys:'ctrl+enter:submit',
|
||||
markdown:true,
|
||||
required:true,
|
||||
extra_style:'height: 500px'
|
||||
}) }}
|
||||
@@ -0,0 +1,46 @@
|
||||
{% import "components/nothing.html" as nothing with context %}
|
||||
{% import "components/user.html" as user with context %}
|
||||
{% import "components/paginator.html" as paginator with context %}
|
||||
{% if not ddocs.length %}
|
||||
{{ nothing.render('no discussion yet...') }}
|
||||
{% else %}
|
||||
<ol class="section__list discussion__list">
|
||||
{%- for ddoc in ddocs -%}
|
||||
<li class="section__list__item discussion__item{% if ddoc.highlight %} highlight{% endif %}">
|
||||
<div class="media">
|
||||
<div class="media__left">
|
||||
<div class="discussion__replies numbox">
|
||||
<div class="numbox__num large">{{ ddoc.nReply }}</div>
|
||||
<div class="numbox__text">{{ _('Comments') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media__body top">
|
||||
<h1 class="discussion__title"><a href="{{ url('discussion_detail', did=ddoc._id, anchor=ddoc.updateAt.getTime()) }}" data-emoji-enabled>{{ ddoc['title'] }}</a></h1>
|
||||
<ul class="supplementary list">
|
||||
<li>
|
||||
<a class="discussion-node-tag" href="{{ url('discussion_node', type=model.discussion.typeDisplay[ddoc.parentType], name=ddoc.parentId) }}">
|
||||
{% if ddoc.parentType == model.document.TYPE_PROBLEM %}
|
||||
<span class="v-center icon icon-tag"></span>
|
||||
{% elif ddoc.parentType == model.document.TYPE_CONTEST %}
|
||||
<span class="v-center icon icon-award"></span>
|
||||
{% else %}
|
||||
<span class="v-center icon icon-flag"></span>
|
||||
{% endif %}
|
||||
{{ vndict[ddoc.parentType][ddoc.parentId].title|default(_('(missing)')) }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ user.render_inline(udict[ddoc.owner], badge=false) }}
|
||||
@
|
||||
{{ datetimeSpan(ddoc.updateAt)|safe }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
{% if page != undefined and dpcount != undefined %}
|
||||
{{ paginator.render(page, dpcount) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,17 @@
|
||||
<div class="section side">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Discussion Nodes') }}</h1>
|
||||
</div>
|
||||
<div class="section__body"><ul class="group-list">
|
||||
{%- for category, nodes in vnodes|groupby('content') -%}
|
||||
<li class="group-list__item">
|
||||
<h2 class="section__title">{{ category }}</h2>
|
||||
<ol class="chip-list">
|
||||
{%- for node in nodes -%}
|
||||
<li class="chip-list__item"><a class="typo-a" href="{{ url('discussion_node', type=model.discussion.typeDisplay[model.document.TYPE_DISCUSSION_NODE], name=node.docId) }}">{{ node.docId }}</a></li>
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul></div>
|
||||
</div>
|
||||
@@ -0,0 +1,75 @@
|
||||
{% if not isIE(handler.request.headers['user-agent']) %}
|
||||
<div class="footer">
|
||||
<div class="row"><div class="columns">
|
||||
{% if show_topics|default(true) %}
|
||||
<div class="row footer__links">
|
||||
<div class="medium-3 large-2 columns footer__category expandable">
|
||||
<h1>
|
||||
{{ _('Status') }}
|
||||
<span class="expand-icon">
|
||||
<span class="icon icon-expand_more"></span>
|
||||
</span>
|
||||
</h1>
|
||||
<div class="footer__category__expander"><ul class="footer__category__list">
|
||||
<li class="footer__category__item"><a href="{{ url('record_main') }}">{{ _('Judging Queue') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('status') }}">{{ _('Service Status') }}</a></li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="medium-3 large-2 columns footer__category expandable">
|
||||
<h1>
|
||||
{{ _('Development') }}
|
||||
<span class="expand-icon">
|
||||
<span class="icon icon-expand_more"></span>
|
||||
</span>
|
||||
</h1>
|
||||
<div class="footer__category__expander"><ul class="footer__category__list">
|
||||
<li class="footer__category__item"><a href="https://github.com/hydro-dev/Hydro" target="_blank">{{ _('Open Source') }}</a></li>
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_api') }}">{{ _('API') }}</a></li>
|
||||
</ul></div>
|
||||
</div>
|
||||
<div class="medium-3 large-2 columns footer__category expandable end">
|
||||
<h1>
|
||||
{{ _('Support') }}
|
||||
<span class="expand-icon">
|
||||
<span class="icon icon-expand_more"></span>
|
||||
</span>
|
||||
</h1>
|
||||
<div class="footer__category__expander"><ul class="footer__category__list">
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_help') }}">{{ _('Help') }}</a></li>
|
||||
<!--<li class="footer__category__item"><a href="#">{{ _('Blog') }}</a></li>-->
|
||||
<li class="footer__category__item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('QQ Group') }}</a></li>
|
||||
</ul></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="footer__extra-link clearfix">
|
||||
<div class="footer__extra-left">
|
||||
<ol class="clearfix">
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about') }}">{{ _('About') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='contact') }}">{{ _('Contact Us') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='privacy') }}">{{ _('Privacy') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="{{ url('wiki_about', anchor='tos') }}">{{ _('Terms of Service') }}</a></li>
|
||||
<li class="footer__extra-link-item"><a href="https://hydro.js.org/#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC">{{ _('Copyright Complaint') }}</a></li>
|
||||
<li class="footer__extra-link-item" data-dropdown-target="#menu-footer-lang">
|
||||
<span><span class="icon icon-global"></span> Language <span class="icon icon-expand_less"></span></span>
|
||||
<ol class="dropdown-target menu" id="menu-footer-lang">
|
||||
{%- for k, v in model.setting.SETTINGS_BY_KEY['viewLang'].range -%}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('switch_language', lang=k) }}">{{ v }}</a></li>
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer__extra-right">
|
||||
<ol class="clearfix">
|
||||
<!-- TODO -->
|
||||
{%- for html in (model.system.get('ui-default.footer_extra_html')|default('')).split('\n') -%}
|
||||
<li class="footer__extra-link-item">{{ html|safe }}</li>
|
||||
{%- endfor -%}
|
||||
<li class="footer__extra-link-item">Powered by <a href="https://hydro.js.org">Hydro</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,7 @@
|
||||
<button type="button" class="header__hamburger">
|
||||
<div class="hamburger hamburger--spin">
|
||||
<span class="hamburger-box">
|
||||
<span class="hamburger-inner"></span>
|
||||
</span>
|
||||
</div>
|
||||
</button>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="header{% if no_path_section %} mini{% endif %}">
|
||||
<div class="header__content"><div class="row"><div class="columns">
|
||||
<a class="header__logo" href="/" target="_self"></a>
|
||||
</div></div></div>
|
||||
{% include "partials/path.html" %}
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
{% if no_path_section %}
|
||||
<div class="header--mobile">
|
||||
<div class="row"><div class="columns clearfix">
|
||||
<div class="float-left">
|
||||
<a class="header--mobile__domain is--system" href="/" target="_self"> </a>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
{% include "partials/hamburger.html" %}
|
||||
</div>
|
||||
</div></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,6 @@
|
||||
# Format:
|
||||
# hours: coefficient
|
||||
1: 0.9
|
||||
3: 0.8
|
||||
12: 0.75
|
||||
9999: 0.5
|
||||
@@ -0,0 +1,85 @@
|
||||
{% import "components/user.html" as user with context %}
|
||||
{% import "components/homework.html" as homework with context %}
|
||||
<div class="section side">
|
||||
{% if page_name != 'homework_detail' %}
|
||||
<a class="contest-sidebar__bg" href="{{ url('homework_detail', tid=tdoc.docId) }}">
|
||||
<div class="section__body">
|
||||
<h1>{{ tdoc['title'] }}</h1>
|
||||
<div class="contest-sidebar__status">
|
||||
{% if attended %}
|
||||
<span class="icon icon-check"></span> {{ _('Claimed') }}
|
||||
{% else %}
|
||||
<span class="icon icon-schedule"></span> {{ _('Not Claimed') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if page_name != 'homework_detail' %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('homework_detail', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-homework"></span> {{ _('View Homework') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if not attended and not model.contest.isDone(tdoc) %}
|
||||
<li class="menu__item">
|
||||
{% if handler.user.hasPerm(perm.PERM_ATTEND_HOMEWORK) and handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<form action="{{ url('homework_detail', tid=tdoc.docId) }}" method="POST">
|
||||
<input type="hidden" name="operation" value="attend">
|
||||
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
||||
<button class="menu__link" type="submit">
|
||||
<span class="icon icon-add"></span> {{ _('Claim Homework') }}
|
||||
</button>
|
||||
</form>
|
||||
{% elif not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<a class="menu__link" href="javascript:showSignInDialog()">
|
||||
<span class="icon icon-add"></span> {{ _('Login to Claim Homework') }}
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="menu__link disabled" href="javascript:;">
|
||||
<span class="icon icon-add"></span> {{ _('No Permission to Claim Homework') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if handler.canShowScoreboard(tdoc, false) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('homework_scoreboard', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-statistics"></span> {{ _('Scoreboard') }}
|
||||
</a></li>
|
||||
{% elif handler.canViewHiddenScoreboard(tdoc) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('homework_scoreboard', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-statistics"></span> {{ _('Scoreboard (Hidden)') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if tdoc.owner == handler.user._id or handler.user.hasPerm(perm.PERM_EDIT_HOMEWORK) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('homework_edit', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit Homework') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_READ_RECORD_CODE) %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('homework_code', tid=tdoc.docId) }}">
|
||||
<span class="icon icon-download"></span> {{ _('Export All Code') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if attended %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('record_main', query={uidOrName:handler.user._id, tid:tdoc.docId}) }}">
|
||||
<span class="icon icon-flag"></span> {{ _('My Recent Submissions') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('wiki', page='help', anchor='homework') }}">
|
||||
<span class="icon icon-help"></span> {{ _('Help') }}
|
||||
</a></li>
|
||||
<li class="menu__seperator"></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section__body typo">
|
||||
<dl class="large horizontal">
|
||||
<dt>{{ _('Status') }}</dt><dd><span class="homework-status--text {{ model.contest.getStatus(tdoc) }}">{{ _(model.contest.statusText(tdoc)) }}</span></dd>
|
||||
<dt>{{ _('Problem') }}</dt><dd>{{ tdoc['pids']|length }}</dd>
|
||||
<dt>{{ _('Open Since') }}</dt><dd>{{ homework.render_time(tdoc['beginAt']) }}</dd>
|
||||
<dt>{{ _('Deadline') }}</dt><dd>{{ homework.render_time(tdoc['penaltySince']) }}</dd>
|
||||
<dt>{{ _('Can be Extended For') }}</dt><dd>{{ homework.render_extension(tdoc) }} {{ _('hour(s)') }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,53 @@
|
||||
<div class="dialog dialog--signin" style="display:none">
|
||||
<div class="dialog__content">
|
||||
<div class="dialog--signin__bg">
|
||||
<div class="dialog--signin__side">
|
||||
<h1>{{ _("Don't have an account?") }}</h1>
|
||||
<p>{{ _('By signing up a Hydro universal account, you can submit code and join discussions in all online judging services provided by us.') }}</p>
|
||||
<div><a href="{{ url('user_register') }}" class="inverse rounded button">{{ _('Sign Up Now') }}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialog--signin__main">
|
||||
<form action="{{ url('user_login') }}" method="post">
|
||||
<div class="dialog--signin__close-container supplementary">
|
||||
<a name="dialog--signin__close" href="javascript:;">{{ _('CLOSE') }}</a>
|
||||
</div>
|
||||
<h1 class="dialog--signin__title">{{ _('SIGN IN') }}</h1>
|
||||
<p class="dialog--signin__note">{{ _('Using your Hydro universal account') }}</p>
|
||||
{% if model.system.get('server.login') %}
|
||||
<div class="row"><div class="columns">
|
||||
<label class="material textbox">
|
||||
{{ _('Username') }}
|
||||
<input name="uname" type="text" data-autofocus>
|
||||
</label>
|
||||
</div></div>
|
||||
<div class="row"><div class="columns">
|
||||
<label class="material textbox">
|
||||
{{ _('Password') }}
|
||||
<input name="password" type="password">
|
||||
</label>
|
||||
</div></div>
|
||||
<div class="row"><div class="columns">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="rememberme">{{ _('Remember me') }}
|
||||
</label>
|
||||
</div></div>
|
||||
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
||||
<div class="row"><div class="columns">
|
||||
<input type="submit" value="{{ _('Sign In') }}" class="expanded rounded primary button">
|
||||
</div></div>
|
||||
{% endif %}
|
||||
{%- for v in handler.loginMethods -%}
|
||||
<div class="row"><div class="columns">
|
||||
<a href="{{ url('user_oauth', type=v.id) }}" class="expanded rounded button">{{ _(v.text) }}</a>
|
||||
</div></div>
|
||||
{%- endfor -%}
|
||||
<div class="row"><div class="columns">
|
||||
<div class="supplementary text-center">
|
||||
<a href="{{ url('user_lostpass') }}">{{ _('Forgot password or username?') }}</a>
|
||||
</div>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,77 @@
|
||||
{%- macro nav_item(target_page_name, target_page_args, target_page_prefix) -%}
|
||||
<li class="nav__list-item">
|
||||
<a href="{{ url(target_page_name, target_page_args) }}" class="nav__item{% if page_name.startsWith(target_page_prefix) %} nav--active{% endif %}">
|
||||
{{ _(target_page_name) }}
|
||||
</a>
|
||||
</li>
|
||||
{%- endmacro -%}
|
||||
|
||||
<nav class="nav slideout-menu" id="menu">
|
||||
<div class="row"><div class="columns clearfix">
|
||||
<ol class="nav__list nav__list--main clearfix">
|
||||
<li class="nav__list-item"><a href="/" class="nav__logo"> </a></li>
|
||||
{%- for item in ui.nodes.nav -%}
|
||||
{% if item.checker(handler) %}
|
||||
{{ nav_item(item.name, item.args, item.prefix) }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
<ol class="nav__list nav__list--secondary clearfix">
|
||||
{% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<li class="nav__list-item"><a href="{{ url('user_login') }}" class="nav__item" name="nav_login">{{ _('Login') }}</a></li>
|
||||
<li class="nav__list-item"><a href="{{ url('user_register') }}" class="nav__item--round">{{ _('Sign Up') }}</a></li>
|
||||
{% else %}
|
||||
<li class="nav__list-item" data-dropdown-pos="bottom right" data-dropdown-target="#menu-nav-user" data-dropdown-trigger-desktop-only>
|
||||
<a href="{{ url('user_detail', uid=handler.user._id) }}" class="nav__item">{{ handler.user.uname }} <span class="icon icon-expand_more nojs--hide"></span></a>
|
||||
<ol class="dropdown-target menu" id="menu-nav-user">
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('user_detail', uid=handler.user._id) }}" class="menu__link">
|
||||
<span class="icon icon-account--circle"></span> {{ _('My Profile') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('home_messages') }}" class="menu__link">
|
||||
<span class="icon icon-comment--multiple"></span> {{ _('home_messages') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('home_settings', category='domain') }}" class="menu__link">
|
||||
<span class="icon icon-web"></span> @ {{ handler.domain['name'] }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('home_settings', category='account') }}" class="menu__link">
|
||||
<span class="icon icon-wrench"></span> {{ _('home_account') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('home_settings', category='preference') }}" class="menu__link">
|
||||
<span class="icon icon-sliders"></span> {{ _('home_preference') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('home_security') }}" class="menu__link">
|
||||
<span class="icon icon-security"></span> {{ _('home_security') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('home_domain') }}" class="menu__link">
|
||||
<span class="icon icon-web"></span> {{ _('My Domains') }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item">
|
||||
<a href="{{ url('user_logout') }}" class="menu__link" name="nav_logout">
|
||||
<span class="icon icon-logout"></span> {{ _('Logout') }}
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div></div>
|
||||
</nav>
|
||||
<nav class="nav--shadow"></nav>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="location" data-fragment-id="path">
|
||||
{% if not no_path_section %}
|
||||
<div class="row"><div class="columns">
|
||||
<div class="media">
|
||||
<div class="media__body">
|
||||
<div class="location-path">
|
||||
{%- for c in path -%}
|
||||
/ {% if loop.index < path.length %}<a href="{{ url(c[1], c[2])|default('#') }}">{{ c[0] if c[3] else _(c[0]) }}</a>{% endif %}
|
||||
{%- endfor %}
|
||||
</div>
|
||||
<h1 class="location-current" data-emoji-enabled>{{ path[path.length - 1][0] if path[path.length - 1][3] else _(path[path.length - 1][0]) }}</h1>
|
||||
</div>
|
||||
<div class="media__right">
|
||||
{% include "partials/hamburger.html" %}
|
||||
</div>
|
||||
</div>
|
||||
</div></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
# Background
|
||||
Special for beginners, ^_^
|
||||
|
||||
# Description
|
||||
Given two integers x and y, print the sum.
|
||||
|
||||
# Format
|
||||
|
||||
## Input
|
||||
Two integers x and y, satisfying $0\leq x,y\leq 32767$ .
|
||||
|
||||
## Output
|
||||
One integer, the sum of x and y.
|
||||
|
||||
# Sample 1
|
||||
|
||||
## Input
|
||||
|
||||
```
|
||||
123 500
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
```
|
||||
623
|
||||
```
|
||||
|
||||
# Limitation
|
||||
1s, 1024KiB for each test case.
|
||||
@@ -0,0 +1,54 @@
|
||||
{% import "components/paginator.html" as paginator with context %}
|
||||
{% import "components/record.html" as record with context %}
|
||||
{% import "components/problem.html" as problem with context %}
|
||||
{% import "components/nothing.html" as nothing with context %}
|
||||
<div data-fragment-id="problem_list">
|
||||
{% if not pdocs.length %}
|
||||
{{ nothing.render('Sorry, there is no problem in the problem set') }}
|
||||
{% else %}
|
||||
<table class="data-table">
|
||||
<colgroup>
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<col class="col--status">
|
||||
{% endif %}
|
||||
<col class="col--name">
|
||||
<col class="col--submit_n">
|
||||
<col class="col--ac_rate">
|
||||
<col class="col--difficulty">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<th class="col--status record-status--border">{{ _('Status') }}</th>
|
||||
{% endif %}
|
||||
<th class="col--name">{{ _('Problem') }}</th>
|
||||
<th class="col--submit_n">{{ _('Submit') }}</th>
|
||||
<th class="col--ac_rate">% {{ _('AC') }}</th>
|
||||
<th class="col--difficulty">{{ _('Difficulty') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%- for pdoc in pdocs -%}
|
||||
{% set psdoc = psdict[pdoc['docId']] %}
|
||||
<tr>
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
{% if psdoc['rid'] %}
|
||||
{{ record.render_status_td(psdoc, rid_key='rid') }}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border">
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<td class="col--name col--problem-name">
|
||||
{{ problem.render_problem_title(pdoc) }}
|
||||
</td>
|
||||
<td class="col--submit_n">{{ pdoc['nSubmit'] }}</td>
|
||||
<td class="col--ac_rate">{{ (100 * pdoc['nAccept'] / pdoc['nSubmit'])|round|int if pdoc['nSubmit'] > 0 else _('?') }}</td>
|
||||
<td class="col--difficulty">{{ pdoc['difficulty'] or _('(None)') }}</td>
|
||||
</tr>
|
||||
{%- endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ paginator.render(page, ppcount) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<div data-fragment-id="problem_lucky">
|
||||
<p>
|
||||
<a href="{{ url('problem_random', query={category:category}) if category else url('problem_random') }}" class="expanded button" target="_blank">
|
||||
<span class="icon icon-feeling-lucky"></span> {{ _('Lucky') }}
|
||||
</a>
|
||||
</p>
|
||||
<div class="typo supplementary">
|
||||
<p>{{ _('Pick a problem randomly based on current filter') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
{% if tdoc %}
|
||||
{% if tdoc.docType == 60 %}
|
||||
{% include "partials/problem_sidebar_homework.html" %}
|
||||
{% if not owner_udoc %}
|
||||
{% set owner_udoc = udoc %}
|
||||
{% endif %}
|
||||
{% include "partials/homework_sidebar.html" %}
|
||||
{% else %}
|
||||
{% include "partials/problem_sidebar_contest.html" %}
|
||||
{% if not owner_udoc %}
|
||||
{% set owner_udoc = udoc %}
|
||||
{% endif %}
|
||||
{% include "partials/contest_sidebar.html" %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include "partials/problem_sidebar_normal.html" %}
|
||||
{% endif %}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% import "components/user.html" as user with context %}
|
||||
<div class="section side section--problem-sidebar">
|
||||
{% if page_name != 'problem_detail' and page_name != 'contest_detail_problem' %}
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ pdoc['title'] }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if model.contest.isOngoing(tdoc) %}
|
||||
{% 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)
|
||||
</a></li>
|
||||
<li class="menu__item non-scratchpad--hide"><a class="menu__link" name="problem-sidebar__quit-scratchpad" href="javascript:;" data-global-hotkey="alt+q">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Quit Scratchpad') }} (Alt+Q)
|
||||
</a></li>
|
||||
{% else %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('contest_detail_problem', tid=tdoc.docId, pid=pdoc.docId) }}">
|
||||
<span class="icon icon-flag"></span> {{ _('View Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'contest_detail_problem_submit' %} active{% endif %}" href="{{ url('contest_detail_problem_submit', tid=tdoc.docId, pid=pdoc.docId) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Submit') }}
|
||||
</a></li>
|
||||
{% elif model.contest.isDone(tdoc) %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link" href="{{ url('problem_detail', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Open in Problem Set') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if pdoc.owner == handler.user._id or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="{{ url('problem_edit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
</a></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_settings' %} active{% endif %}" href="{{ url('problem_settings', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-wrench"></span> {{ _('Settings') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,42 @@
|
||||
{% import "components/user.html" as user with context %}
|
||||
<div class="section side section--problem-sidebar">
|
||||
{% if page_name != 'problem_detail' and page_name != 'homework_detail_problem' %}
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ pdoc['title'] }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if model.contest.isOngoing(tdoc) or model.contest.isExtended(tdoc) %}
|
||||
{% 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)
|
||||
</a></li>
|
||||
<li class="menu__item non-scratchpad--hide"><a class="menu__link" name="problem-sidebar__quit-scratchpad" href="javascript:;" data-global-hotkey="alt+q">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Quit Scratchpad') }} (Alt+Q)
|
||||
</a></li>
|
||||
{% else %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('homework_detail_problem', tid=tdoc.docId, pid=pdoc.docId) }}">
|
||||
<span class="icon icon-flag"></span> {{ _('View Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'homework_detail_problem_submit' %} active{% endif %}" href="{{ url('homework_detail_problem_submit', tid=tdoc.docId, pid=pdoc.docId) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Submit') }}
|
||||
</a></li>
|
||||
{% elif model.contest.isDone(tdoc) %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link" href="{{ url('problem_detail', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Open in Problem Set') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if pdoc.owner == handler.user._id or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="{{ url('problem_edit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
</a></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_settings' %} active{% endif %}" href="{{ url('problem_settings', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-wrench"></span> {{ _('Settings') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,197 @@
|
||||
{% import "components/user.html" as user with context %}
|
||||
{% import "components/problem.html" as problem with context %}
|
||||
<div class="section side section--problem-sidebar">
|
||||
{% if page_name != 'problem_detail' and page_name != 'contest_detail_problem' %}
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ pdoc['title'] }}</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<ol class="menu">
|
||||
{% if page_name == 'discussion_node' or page_name == 'discussion_detail' %}
|
||||
{% if handler.user.hasPerm(perm.PERM_CREATE_DISCUSSION) %}
|
||||
<li class="menu__item"><a class="menu__link highlight" href="{{ url('discussion_create', type='problem', name=pdoc.docId) }}">
|
||||
<span class="icon icon-add"></span> {{ _('Create a Discussion') }}
|
||||
</a></li>
|
||||
{% else %}
|
||||
{% if not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<li class="menu__item"><a class="menu__link" href="javascript:showSignInDialog();">
|
||||
<span class="icon icon-add"></span> {{ _('Login to Create a Discussion') }}</a></li>
|
||||
{% else %}
|
||||
<li class="menu__item"><a class="menu__link disabled" href="javascript:;">
|
||||
<span class="icon icon-add"></span> {{ _('No Permission to Create a Discussion') }}</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<li class="menu__seperator"></li>
|
||||
{% endif %}
|
||||
{% if page_name == 'problem_detail' %}
|
||||
{% if handler.user.hasPerm(perm.PERM_SUBMIT_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)
|
||||
</a></li>
|
||||
<li class="menu__item non-scratchpad--hide"><a class="menu__link" name="problem-sidebar__quit-scratchpad" href="javascript:;" data-global-hotkey="alt+q">
|
||||
<span class="icon icon-enlarge"></span> {{ _('Quit Scratchpad') }} (Alt+Q)
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ url('problem_detail', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-flag"></span> {{ _('View Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_SUBMIT_PROBLEM) %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'problem_submit' %} active{% endif %}" href="{{ url('problem_submit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-send"></span> {{ _('Submit') }}
|
||||
</a></li>
|
||||
{% elif not handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'problem_submit' %} active{% endif %}" href="javascript:showSignInDialog();">
|
||||
<span class="icon icon-send"></span> {{ _('Login to Submit') }}
|
||||
</a></li>
|
||||
{% else %}
|
||||
<li class="menu__item scratchpad--hide"><a class="menu__link disabled{% if page_name == 'problem_submit' %} active{% endif %}" href="javascript:;">
|
||||
<span class="icon icon-send"></span> {{ _('No Permission to Submit') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_REJUDGE_PROBLEM) %}
|
||||
<li class="menu__item">
|
||||
<form method="post" action="{{ url('problem_detail', pid=pdoc.docId) }}">
|
||||
<input type="hidden" name="operation" value="rejudge">
|
||||
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
||||
<button type="submit" class="menu__link">
|
||||
<span class="icon icon-refresh"></span> {{ _('Rejudge all submissions') }}
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_VIEW_DISCUSSION) or handler.user.hasPerm(perm.PERM_VIEW_PROBLEM_SOLUTION) %}
|
||||
<li class="menu__seperator"></li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_VIEW_DISCUSSION) %}
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'discussion_node' or page_name == 'discussion_detail' %} active{% endif %}" href="{{ url('discussion_node', type='problem', name=pdoc.docId) }}">
|
||||
<span class="icon icon-comment--text"></span> {{ _('Discussions') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user.hasPerm(perm.PERM_VIEW_PROBLEM_SOLUTION) %}
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_solution' %} active{% endif %}" href="{{ url('problem_solution', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-comment--text"></span> {{ _('Solutions') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_files' %} active{% endif %}" href="{{ url('problem_files', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-file"></span> {{ _('Files') }}
|
||||
</a></li>
|
||||
{% if (handler.user._id == pdoc.owner and handler.user.hasPerm(perm.PERM_EDIT_PROBLEM_SELF)) or handler.user.hasPerm(perm.PERM_EDIT_PROBLEM) %}
|
||||
<li class="menu__seperator"></li>
|
||||
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="{{ url('problem_edit', pid=pdoc.pid|default(pdoc.docId)) }}">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if page_name == 'problem_detail' and (handler.user._id == pdoc.owner or handler.user.hasPerm(perm.PERM_READ_PROBLEM_DATA)) %}
|
||||
<div style="display: none" class="dialog__body--send-to">
|
||||
<div>
|
||||
<div class="row"><div class="columns">
|
||||
<h1>{{ _('Send Problem') }}</h1>
|
||||
</div></div>
|
||||
<div class="row"><div class="medium-12 columns">
|
||||
<label>
|
||||
{{ _('Target') }}
|
||||
<input name="target" type="text" class="textbox" data-autofocus>
|
||||
</label>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<li class="menu__item nojs--hide"><a class="menu__link" name="problem-sidebar__send-to" href="javascript:;">
|
||||
<span class="icon icon-copy"></span> {{ _('Send Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section side">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Information') }}</h1>
|
||||
</div>
|
||||
<div class="section__body typo">
|
||||
<dl class="large horizontal">
|
||||
<dt>{{ _('ID') }}</dt>
|
||||
<dd>{{ pdoc.docId }}</dd>
|
||||
{% if page_name != 'discussion_node' and page_name != 'discussion_detail' %}
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<dt>{{ _('Submission') }}</dt>
|
||||
<dd>
|
||||
{% if pdoc.psdoc.status %}
|
||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[pdoc['psdoc']['status']] }}"></span>
|
||||
<a href="{{ url('record_detail', rid=pdoc.psdoc.rid) }}" class="record-status--text {{ model.builtin.STATUS_CODES[pdoc['psdoc']['status']] }}">
|
||||
{{ model.builtin.STATUS_TEXTS[pdoc['psdoc']['status']] }}
|
||||
</a>
|
||||
{% else %}
|
||||
{{ _('(None)') }}
|
||||
{% endif %}
|
||||
{% if pdoc['acMsg'] and pdoc['psdoc']['status'] == STATUS.STATUS_ACCEPTED %}
|
||||
<dt>{{ _('AC Message') }}</dt>
|
||||
<dd>{{ pdoc['acMsg'] }}</dd>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<dt>{{ _('Difficulty') }}</dt>
|
||||
<dd>{{ pdoc['difficulty'] or _('(None)') }}</dd>
|
||||
<dt>{{ _('Category') }}</dt>
|
||||
<dd>
|
||||
{% if pdoc['category'] %}
|
||||
<span class="hasjs--hide" name="problem-sidebar__categories">
|
||||
{%- for category in pdoc['category'] -%}
|
||||
<a href="{{ url('problem_category', category=category) }}">{{ category }}</a>
|
||||
{% if loop.index < pdoc['category']|length %}
|
||||
{{ _('problem-subcategory-delim') }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
</span>
|
||||
<span class="nojs--hide">
|
||||
<a href="javascript:;" name="problem-sidebar__show-category">{{ _('page.problem_detail.sidebar.show_category') }}</a>
|
||||
</span>
|
||||
{% else %}
|
||||
{{ _('(None)') }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
<dt>{{ _('Tags') }}</dt>
|
||||
<dd>
|
||||
{{ problem.render_problem_tags(pdoc, true) }}
|
||||
</dd>
|
||||
<dt>{{ _('# Submissions') }}</dt>
|
||||
<dd><a href="{{ url('record_main', query={pid:pdoc.docId}) }}">{{ pdoc.nSubmit }}</a></dd>
|
||||
{% if page_name != 'discussion_node' and page_name != 'discussion_detail' %}
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<dt>{{ _('# My Submissions') }}</dt>
|
||||
<dd><a href="{{ url('record_main', query={pid:pdoc.docId, uidOrName:handler.user._id}) }}">{{ pdoc['psdoc'].nSubmit|default(0) }}</a></dd>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<dt>{{ _('Accepted') }}</dt>
|
||||
<dd>{{ pdoc.nAccept }}</dd>
|
||||
<dt>{{ _('Accepted Ratio') }}</dt>
|
||||
<dd>{% if pdoc.nSubmit > 0 %}{{ (100 * pdoc.nAccept / pdoc.nSubmit)|round|int }}%{% else %}{{ _('?') }}{% endif %}</dd>
|
||||
<dt>{{ _('Uploaded By') }}</dt>
|
||||
<dd>{{ user.render_inline(owner_udoc, badge=false) }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
{% if page_name == 'problem_detail' and (tdocs or ctdocs) %}
|
||||
<div class="section side">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Related') }}</h1>
|
||||
</div>
|
||||
<div class="section__body typo">
|
||||
{% if tdocs %}
|
||||
<p>{{ _('In following training plans') }}: </p>
|
||||
{%- for tdoc in tdocs -%}
|
||||
<p><a href="{{ url('training_detail', tid=tdoc.docId) }}">{{ tdoc.title }}</a></p>
|
||||
{%- endfor -%}
|
||||
{% endif %}
|
||||
{% if ctdocs %}
|
||||
<p>{{ _('In following contests') }}: </p>
|
||||
{%- for tdoc in ctdocs -%}
|
||||
<p><a href="{{ url('contest_detail', tid=tdoc.docId) }}">{{ tdoc.title }}</a></p>
|
||||
{%- endfor -%}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="section__body" data-fragment-id="problem_stat">
|
||||
<p>{{ _('{0} problems').format(pcount) }}</p>
|
||||
</div>
|
||||
@@ -0,0 +1,90 @@
|
||||
<form method="post">
|
||||
{%- for family, family_settings in settings|groupby('family') -%}
|
||||
<div class="section__header">
|
||||
<h1 class="section__title" id="{{ family }}" data-heading>{{ _(family) }}</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
{%- for setting in family_settings -%}
|
||||
{% if not setting.flag|bitand(model.setting.FLAG_HIDDEN) %}
|
||||
{% set secret = setting.flag|bitand(model.setting.FLAG_SECRET) != 0 %}
|
||||
{% if setting.type == 'text' or setting.type == 'password' or setting.type == 'number' %}
|
||||
{{ form.form_text({
|
||||
type:setting.type,
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:'' if secret else (current[setting.key]|default(setting.value)),
|
||||
disabled:setting.disabled,
|
||||
placeholder:_('(Not changed)') if secret else ''
|
||||
}) }}
|
||||
{% elif setting.type == 'select' %}
|
||||
{{ form.form_select({
|
||||
options:setting.range,
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:current[setting.key] or setting.value,
|
||||
disabled:setting.disabled
|
||||
}) }}
|
||||
{% elif setting.type == 'radio' %}
|
||||
{{ form.form_radio({
|
||||
options:setting.range,
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:current[setting.key] or setting.value,
|
||||
disabled:setting.disabled
|
||||
}) }}
|
||||
{% elif setting.type == 'image_radio' %}
|
||||
{{ form.form_image_radio({
|
||||
options:setting.range,
|
||||
image_class:setting.image_class,
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:current[setting.key] or setting.value,
|
||||
disabled:setting.disabled
|
||||
}) }}
|
||||
{% elif setting.type == 'textarea' %}
|
||||
{{ form.form_textarea({
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:'' if secret else (current[setting.key]|default(setting.value)),
|
||||
disabled:setting.disabled,
|
||||
placeholder:_('(Not changed)') if secret else ''
|
||||
}) }}
|
||||
{% elif setting.type == 'markdown' %}
|
||||
{{ form.form_textarea({
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:'' if secret else (current[setting.key]|default(setting.value)),
|
||||
markdown:true,
|
||||
disabled:setting.disabled,
|
||||
placeholder:_('(Not changed)') if secret else ''
|
||||
}) }}
|
||||
{% elif setting.type == 'boolean' %}
|
||||
{{ form.form_checkbox({
|
||||
label:setting.name,
|
||||
help_text:setting.desc,
|
||||
name:setting.key,
|
||||
value:current[setting.key] or setting.value,
|
||||
disabled:setting.disabled
|
||||
})}}
|
||||
{{ form.form_checkbox({
|
||||
label:setting.name,
|
||||
name:'booleanKeys.' + setting.key,
|
||||
value:true,
|
||||
extra_class:'display-hidden'
|
||||
})}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
{%- endfor -%}
|
||||
<div class="section__body">
|
||||
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
|
||||
<input type="submit" class="rounded primary button" value="{{ _('Save All Changes') }}">
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"_id": 1,
|
||||
"title": "最初的最初 - A+B Problem",
|
||||
"requireNids": [],
|
||||
"pids": [1000, "56c52ade2fefd90539000005"]
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"title": "最初的进阶",
|
||||
"requireNids": [1],
|
||||
"pids": [1001, 1002]
|
||||
}
|
||||
]
|
||||
Reference in new issue
Block a user