record_main & record_detail

This commit is contained in:
masnn committed 2020-04-04 12:14:10 +08:00
1 parent ffa193b5dd
commit 5b4f5b6520
37 files changed
+231 -275

No files matched your search

+4 -4
View File
@@ -2,7 +2,7 @@
{% import "components/contest.html" as contest with context %}
<div class="section side">
{% if page_name != 'contest_detail' %}
<a class="contest-sidebar__bg" href="{{ reverse_url('contest_detail', tid=tdoc['doc_id']) }}">
<a class="contest-sidebar__bg" href="/t/{{ tdoc._id }}">
<div class="section__body">
<h1>{{ tdoc['title'] }}</h1>
<div class="contest-sidebar__status">
@@ -34,14 +34,14 @@
<li class="menu__seperator"></li>
{% endif %}
{% if page_name != 'contest_detail' %}
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('contest_detail', tid=tdoc['doc_id']) }}">
<li class="menu__item"><a class="menu__link" href="/t/{{ tdoc._id }}">
<span class="icon icon-award"></span> {{ _('View Contest') }}
</a></li>
{% endif %}
{% if not attended and not handler.is_done(tdoc) %}
<li class="menu__item">
{% if handler.has_perm(perm.PERM_ATTEND_CONTEST) and handler.has_perm(perm.PERM_LOGGEDIN) %}
<form action="{{ reverse_url('contest_detail', tid=tdoc['doc_id']) }}" method="POST">
<form action="/t/{{ tdoc._id }}" method="POST">
<input type="hidden" name="operation" value="attend">
<input type="hidden" name="csrf_token" value="{{ handler.csrf_token }}">
<button class="menu__link" type="submit">
@@ -78,7 +78,7 @@
<span class="icon icon-download"></span> {{ _('Export All Code') }}
</a></li>
{% endif %}
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('record_main') }}?tid={{ tdoc['doc_id'] }}">
<li class="menu__item"><a class="menu__link" href="/r?tid={{ tdoc['doc_id'] }}">
<span class="icon icon-flag"></span> {{ _('All Submissions') }}
</a></li>
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('wiki_help') }}#contest">
+1 -4
View File
@@ -10,7 +10,7 @@
</span>
</h1>
<div class="footer__category__expander"><ul class="footer__category__list">
<li class="footer__category__item"><a href="{{ reverse_url('record_main') }}">{{ _('Judging Queue') }}</a></li>
<li class="footer__category__item"><a href="/r">{{ _('Judging Queue') }}</a></li>
<li class="footer__category__item"><a href="#">{{ _('Service Status') }}</a></li>
</ul></div>
</div>
@@ -34,9 +34,6 @@
</span>
</h1>
<div class="footer__category__expander"><ul class="footer__category__list">
{% if domain_id != vj4.model.builtin.DOMAIN_ID_SYSTEM %}
<li class="footer__category__item"><a href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}">{{ _('Vijos') }}</a></li>
{% endif %}
<li class="footer__category__item"><a href="//vijos.github.io/about-vijos/">{{ _('Help') }}</a></li>
<!--<li class="footer__category__item"><a href="#">{{ _('Blog') }}</a></li>-->
<li class="footer__category__item"><a href="//vijos.github.io/about-vijos/about/contact-us/">{{ _('QQ Group') }}</a></li>
+1 -6
View File
@@ -2,12 +2,7 @@
<div class="header--mobile">
<div class="row"><div class="columns clearfix">
<div class="float-left">
{% if domain_id == vj4.model.builtin.DOMAIN_ID_SYSTEM %}
<a class="header--mobile__domain is--system" href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}" target="_self">&nbsp;</a>
{% else %}
<a class="header--mobile__domain" href="{{ reverse_url('domain_main') }}" target="_self">{{ domain['name'] }}</a>
<a class="header--mobile__system" href="{{ reverse_url('domain_main', domain_id=vj4.model.builtin.DOMAIN_ID_SYSTEM) }}" target="_blank">Powered by Vijos</a>
{% endif %}
<a class="header--mobile__domain is--system" href="/" target="_self">&nbsp;</a>
</div>
<div class="float-right">
{% include "partials/hamburger.html" %}
+1 -1
View File
@@ -63,7 +63,7 @@
</a></li>
{% endif %}
{% if attended %}
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('record_main') }}?uid_or_name={{ handler.user['_id'] }}&tid={{ tdoc['doc_id'] }}">
<li class="menu__item"><a class="menu__link" href="/r?uid_or_name={{ handler.user['_id'] }}&tid={{ tdoc['doc_id'] }}">
<span class="icon icon-flag"></span> {{ _('My Recent Submissions') }}
</a></li>
{% endif %}
@@ -30,10 +30,10 @@
{% endif %}
{% if handler.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.has_perm(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="{{ reverse_url('problem_edit', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="/p/{{ pdoc.pid }}/edit">
<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="{{ reverse_url('problem_settings', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_settings' %} active{% endif %}" href="/p/{{ pdoc.pid }}/settings">
<span class="icon icon-wrench"></span> {{ _('Settings') }}
</a></li>
{% endif %}
@@ -30,10 +30,10 @@
{% endif %}
{% if handler.own(pdoc, perm.PERM_EDIT_PROBLEM_SELF) or handler.has_perm(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="{{ reverse_url('problem_edit', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="/p/{{ pdoc.pid }}/edit">
<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="{{ reverse_url('problem_settings', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_settings' %} active{% endif %}" href="/p/{{ pdoc.pid }}/settings">
<span class="icon icon-wrench"></span> {{ _('Settings') }}
</a></li>
{% endif %}
+13 -13
View File
@@ -39,7 +39,7 @@
</a></li>
{% endif %}
{% if handler.has_perm(perm.PERM_SUBMIT_PROBLEM) %}
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'problem_submit' %} active{% endif %}" href="{{ reverse_url('problem_submit', pid=pdoc['_id']) }}">
<li class="menu__item scratchpad--hide"><a class="menu__link{% if page_name == 'problem_submit' %} active{% endif %}" href="/p/{{ pdoc.pid }}/submit">
<span class="icon icon-send"></span> {{ _('Submit') }}
</a></li>
{% elif not handler.has_perm(perm.PERM_LOGGEDIN) %}
@@ -60,7 +60,7 @@
</a></li>
{% endif %}
{% if handler.has_perm(perm.PERM_VIEW_PROBLEM_SOLUTION) %}
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_solution' %} active{% endif %}" href="{{ reverse_url('problem_solution', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_solution' %} active{% endif %}" href="/p/{{ pdoc.pid }}/solution">
<span class="icon icon-comment--text"></span> {{ _('Solutions') }}
</a></li>
{% endif %}
@@ -72,10 +72,10 @@
{% endif %}
{% if handler.user._id == pdoc.owner or handler.has_perm(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="{{ reverse_url('problem_edit', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_edit' %} active{% endif %}" href="/p/{{ pdoc.pid }}/edit">
<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="{{ reverse_url('problem_settings', pid=pdoc['_id']) }}">
<li class="menu__item"><a class="menu__link{% if page_name == 'problem_settings' %} active{% endif %}" href="/p/{{ pdoc.pid }}/settings">
<span class="icon icon-wrench"></span> {{ _('Settings') }}
</a></li>
{% endif %}
@@ -98,15 +98,15 @@
<dt>{{ _('Submission') }}</dt>
<dd>
{% if pdoc['psdoc']['status'] %}
<span class="icon record-status--icon {{ vj4.constant.record.STATUS_CODES[pdoc['psdoc']['status']] }}"></span>
<a href="{{ reverse_url('record_detail', rid=pdoc['psdoc']['rid'], domain_id=pdoc['psdoc']['domain_id']) }}" class="record-status--text {{ vj4.constant.record.STATUS_CODES[pdoc['psdoc']['status']] }}">
{{ vj4.constant.record.STATUS_TEXTS[pdoc['psdoc']['status']] }}
<span class="icon record-status--icon {{ status.STATUS_CODES[pdoc['psdoc']['status']] }}"></span>
<a href="/r/{{ pdoc['psdoc']['rid'] }}" class="record-status--text {{ status.STATUS_CODES[pdoc['psdoc']['status']] }}">
{{ status.STATUS_TEXTS[pdoc['psdoc']['status']] }}
</a>
{% else %}
{{ _('(None)') }}
{% endif %}
</dd>
{% if pdoc['ac_msg'] and pdoc['psdoc']['status'] == vj4.constant.record.STATUS_ACCEPTED %}
{% if pdoc['ac_msg'] and pdoc['psdoc']['status'] == status.STATUS_ACCEPTED %}
<dt>{{ _('AC Message') }}</dt>
<dd>{{ pdoc['ac_msg'] }}</dd>
{% endif %}
@@ -141,17 +141,17 @@
{{ problem.render_problem_tags(pdoc, true) }}
</dd>
<dt>{{ _('# Submissions') }}</dt>
<dd><a href="{{ reverse_url('record_main') }}?pid={{ pdoc['_id'] }}">{{ pdoc['num_submit'] }}</a></dd>
<dd><a href="/r?pid={{ pdoc['_id'] }}">{{ pdoc.nSubmit }}</a></dd>
{% if page_name != 'discussion_node' and page_name != 'discussion_detail' %}
{% if handler.has_perm(perm.PERM_LOGGEDIN) %}
<dt>{{ _('# My Submissions') }}</dt>
<dd><a href="{{ reverse_url('record_main') }}?pid={{ pdoc['_id'] }}&uid_or_name={{ handler.user['_id'] }}">{{ pdoc['psdoc']['num_submit']|default(0) }}</a></dd>
<dd><a href="/r?pid={{ pdoc['_id'] }}&uid_or_name={{ handler.user['_id'] }}">{{ pdoc['psdoc'].nSubmit|default(0) }}</a></dd>
{% endif %}
{% endif %}
<dt>{{ _('Accepted') }}</dt>
<dd>{{ pdoc['num_accept'] }}</dd>
<dd>{{ pdoc.nAccept }}</dd>
<dt>{{ _('Accepted Ratio') }}</dt>
<dd>{% if pdoc['num_submit'] > 0 %}{{ (100 * pdoc['num_accept'] / pdoc['num_submit'])|round|int }}%{% else %}{{ _('?') }}{% endif %}</dd>
<dd>{% if pdoc.nSubmit > 0 %}{{ (100 * pdoc.nAccept / pdoc.nSubmit)|round|int }}%{% else %}{{ _('?') }}{% endif %}</dd>
{% if pdoc['num_be_copied'] %}
<dt>{{ _('Be Copied') }}</dt>
<dd>{{ pdoc['num_be_copied'] }}</dd>
@@ -178,7 +178,7 @@
{% if ctdocs %}
<p>{{ _('In following contests') }}: </p>
{% for tdoc in ctdocs %}
<p><a href="{{ reverse_url('contest_detail', tid=tdoc['doc_id']) }}">{{ tdoc['title'] }}</a></p>
<p><a href="/t/{{ tdoc._id }}">{{ tdoc['title'] }}</a></p>
{% endfor %}
{% endif %}
{% if htdocs %}