mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge, problem_settings, problem_upload
This commit is contained in:
1 parent
5b4f5b6520
commit
b3024bebb0
45 files changed
+598
-250
No files matched your search
@@ -10,7 +10,7 @@
|
||||
<div class="clearfix">
|
||||
<div class="supplementary dczcomments__supplementary">
|
||||
{{ user.render_inline(udoc, dudict[udoc['_id']], avatar=false) }}
|
||||
@ {{ datetime_span(rdoc['_id'].generation_time) }}
|
||||
@ {{ datetime_span(rdoc['_id'].generationTime) }}
|
||||
</div>
|
||||
{{ comment_base.reply_operations(doc, rdoc) }}
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
<div class="clearfix">
|
||||
<div class="supplementary dczcomments__supplementary">
|
||||
{{ user.render_inline(udoc, dudict[udoc['_id']], avatar=false) }}
|
||||
@ {{ datetime_span(doc['_id'].generation_time) }}
|
||||
@ {{ datetime_span(doc['_id'].generationTime) }}
|
||||
</div>
|
||||
{{ comment_base.comment_operations(doc) }}
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="clearfix">
|
||||
<div class="supplementary dczcomments__supplementary">
|
||||
{{ user.render_inline(udoc, badge=false) }}
|
||||
@ {{ datetime_span(rdoc['_id'].generation_time) }}
|
||||
@ {{ datetime_span(rdoc['_id'].generationTime) }}
|
||||
</div>
|
||||
{{ comment_base.reply_operations(doc, rdoc) }}
|
||||
</div>
|
||||
@@ -65,7 +65,7 @@
|
||||
<div class="clearfix">
|
||||
<div class="supplementary dczcomments__supplementary">
|
||||
{{ user.render_inline(udoc, dudict[udoc['_id']]) }}
|
||||
@ {{ datetime_span(doc['_id'].generation_time) }}
|
||||
@ {{ datetime_span(doc['_id'].generationTime) }}
|
||||
</div>
|
||||
{{ comment_base.comment_operations(doc) }}
|
||||
</div>
|
||||
|
||||
@@ -71,19 +71,19 @@
|
||||
name="{{ args.name }}"
|
||||
{{ form_attr('select', args) }}
|
||||
>
|
||||
{% for item in args.options %}
|
||||
<option value="{{ item.id }}"{% if value == item.id %} selected{% endif %}>
|
||||
{{ _(item.name) }}
|
||||
{% for k, v in args.options %}
|
||||
<option value="{{ k }}"{% if value == k %} selected{% endif %}>
|
||||
{{ _(v) }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_select(columns=5, args) %}
|
||||
{{ form_begin({columns:columns}|assign(args)) }}
|
||||
{{ select({columns:columns}|assign(args)) }}
|
||||
{{ form_end({columns:columns}|assign(args)) }}
|
||||
{% macro form_select(args) %}
|
||||
{{ form_begin({columns:5}|assign(args)) }}
|
||||
{{ select(args) }}
|
||||
{{ form_end(args) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro radio(args) %}
|
||||
@@ -91,24 +91,24 @@
|
||||
name="form_item_{{ args.name }}"
|
||||
{{ container_attr('radiobox-container', args) }}
|
||||
>
|
||||
{% for item in options %}
|
||||
{% for k, v in options %}
|
||||
<label class="radiobox">
|
||||
<input
|
||||
value="{{ item.id }}"
|
||||
value="{{ k }}"
|
||||
type="radio"
|
||||
name="{{ args.name }}"
|
||||
name="{{ v }}"
|
||||
{{ form_attr('radiobox__input', args) }}
|
||||
{% if value == args.id %} checked{% endif %}
|
||||
/> {{ _(item.name) }}
|
||||
/> {{ _(v) }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_radio(columns=5, args) %}
|
||||
{{ form_begin({columns:columns, label_wrap:false}|assign(args)) }}
|
||||
{{ radio({columns:columns}|assign(args)) }}
|
||||
{{ form_end({columns:columns, label_warp:false}|assign(args)) }}
|
||||
{% macro form_radio(args) %}
|
||||
{{ form_begin({columns:5, label_wrap:false}|assign(args)) }}
|
||||
{{ radio(args) }}
|
||||
{{ form_end({label_warp:false}|assign(args)) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro image_radio(args) %}
|
||||
@@ -116,27 +116,27 @@
|
||||
name="form_item_{{ args.name }}"
|
||||
{{ container_attr('radiobox-container with-image', args) }}
|
||||
>
|
||||
{% for item in options %}
|
||||
{% for k, v in options %}
|
||||
<label class="radiobox with-image">
|
||||
<input
|
||||
value="{{ item.id }}"
|
||||
value="{{ k }}"
|
||||
type="radio"
|
||||
name="{{ name }}"
|
||||
name="{{ args.name }}"
|
||||
{{ form_attr('radiobox__input', args) }}
|
||||
{% if value == item.id %} checked{% endif %}
|
||||
{% if value == k %} checked{% endif %}
|
||||
/>
|
||||
<div class="radiobox__image-container" data-tooltip="{{ _(item.name) }}">
|
||||
<div class="radiobox__image {{ image_class.format(item.id) }}"></div>
|
||||
<div class="radiobox__image-container" data-tooltip="{{ _(v) }}">
|
||||
<div class="radiobox__image {{ image_class.format(k) }}"></div>
|
||||
</div>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_image_radio(columns=8, args) %}
|
||||
{{ form_begin({columns:columns, label_warp:false}|assign(args)) }}
|
||||
{{ image_radio({columns:columns}|assign(args)) }}
|
||||
{{ form_end({columns:columns, label_warp:false}|assign(args)) }}
|
||||
{% macro form_image_radio(args) %}
|
||||
{{ form_begin({columns:8, label_warp:false}|assign(args)) }}
|
||||
{{ image_radio(args) }}
|
||||
{{ form_end({label_warp:false}|assign(args)) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro text(args) %}
|
||||
@@ -154,10 +154,10 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_text(columns=5, args) %}
|
||||
{{ form_begin({columns:columns}|assign(args)) }}
|
||||
{{ text({columns:columns}|assign(args)) }}
|
||||
{{ form_end({columns:columns}|assign(args)) }}
|
||||
{% macro form_text(args) %}
|
||||
{{ form_begin({columns:5}|assign(args)) }}
|
||||
{{ text(args) }}
|
||||
{{ form_end(args) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro textarea(args) %}
|
||||
@@ -175,10 +175,10 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_textarea(columns=8) %}
|
||||
{{ form_begin({columns:columns}|assign(args)) }}
|
||||
{{ textarea({columns:columns}|assign(args)) }}
|
||||
{{ form_end({columns:columns}|assign(args)) }}
|
||||
{% macro form_textarea(args) %}
|
||||
{{ form_begin({columns:8}|assign(args)) }}
|
||||
{{ textarea(args) }}
|
||||
{{ form_end(args) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro checkbox(args) %}
|
||||
@@ -194,8 +194,8 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro form_checkbox(columns=5, args) %}
|
||||
{{ form_begin({columns:columns, no_label:true}|assign(args)) }}
|
||||
{{ checkbox({columns:columns}|assign(args)) }}
|
||||
{{ form_end({columns:columns, no_label:true}|assign(args)) }}
|
||||
{% macro form_checkbox(args) %}
|
||||
{{ form_begin({columns:5, no_label:true}|assign(args)) }}
|
||||
{{ checkbox(args) }}
|
||||
{{ form_end({no_label:true}|assign(args)) }}
|
||||
{% endmacro %}
|
||||
@@ -1,8 +1,8 @@
|
||||
{% macro render_status_td(rdoc, rid_key='_id') %}
|
||||
<td class="col--status record-status--border {{ status.STATUS_CODES[rdoc['status']] }}">
|
||||
<td class="col--status record-status--border {{ builtin.STATUS_CODES[rdoc['status']] }}">
|
||||
<div class="col--status__text">
|
||||
<span class="icon record-status--icon {{ status.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
<a href="{{ reverse_url('record_detail', rid=rdoc[rid_key], domain_id=rdoc['domain_id']) }}" class="record-status--text {{ status.STATUS_CODES[rdoc['status']] }}">
|
||||
<span class="icon record-status--icon {{ builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
<a href="/r/{{ rdoc._id }}" class="record-status--text {{ builtin.STATUS_CODES[rdoc['status']] }}">
|
||||
{{ status.STATUS_TEXTS[rdoc['status']] }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
{% if handler.can_show_record(tdoc) %}
|
||||
{{ record.render_status_td(rdoc) }}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border"><a href="{{ reverse_url('record_detail', rid=rdoc['_id'], domain_id=handler.domain_id) }}">{{ _('Submitted') }}</a></td>
|
||||
<td class="col--status record-status--border"><a href="/r/{{ rdoc._id }}">{{ _('Submitted') }}</a></td>
|
||||
{% endif %}
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generation_time) }}</td>
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generationTime) }}</td>
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<li>
|
||||
{{ user.render_inline(udict[ddoc['owner_uid']], dudict[ddoc['owner_uid']]) }}
|
||||
@
|
||||
{{ datetime_span(ddoc['_id'].generation_time) }}
|
||||
{{ datetime_span(ddoc['_id'].generationTime) }}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="typo topic__content" data-emoji-enabled data-raw-url="{{ reverse_url('discussion_detail_raw', did=ddoc['_id']) }}">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% if handler.has_priv(vj4.model.builtin.PRIV_CREATE_DOMAIN) %}
|
||||
<a class="primary rounded button" href="{{ reverse_url('home_domain_create') }}"><span class="icon icon-add"></span> {{ _('Create Domain') }}</a>
|
||||
{% endif %}
|
||||
<a class="tool-button" href="{{ reverse_url('wiki_help') }}#domain"><span class="icon icon-help"></span> {{ _('What\'s domain?') }}</a>
|
||||
<a class="tool-button" href="/wiki/help#domain"><span class="icon icon-help"></span> {{ _('What\'s domain?') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% if pending_ddocs|length > 0 %}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{% if handler.has_priv(vj4.model.builtin.PRIV_CREATE_FILE) %}
|
||||
<a class="primary rounded button" href="{{ reverse_url('fs_upload') }}" target="_blank"><span class="icon icon-add"></span> {{ _('Upload File') }}</a>
|
||||
{% endif %}
|
||||
<a class="tool-button" href="{{ reverse_url('wiki_help') }}#file"><span class="icon icon-help"></span> {{ _('What\'s file?') }}</a>
|
||||
<a class="tool-button" href="/wiki/help#file"><span class="icon icon-help"></span> {{ _('What\'s file?') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section__body no-padding">
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
{% if handler.can_show_record(tdoc) %}
|
||||
{{ record.render_status_td(rdoc) }}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border"><a href="{{ reverse_url('record_detail', rid=rdoc['_id'], domain_id=handler.domain_id) }}">{{ _('Submitted') }}</a></td>
|
||||
<td class="col--status record-status--border"><a href="/r/{{ rdoc._id }}">{{ _('Submitted') }}</a></td>
|
||||
{% endif %}
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generation_time) }}</td>
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generationTime) }}</td>
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
<td class="col--status record-status--border">{{ _('No Submissions') }}</td>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<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">
|
||||
<li class="menu__item"><a class="menu__link" href="/wiki/help#contest">
|
||||
<span class="icon icon-help"></span> {{ _('Help') }}
|
||||
</a></li>
|
||||
<li class="menu__seperator"></li>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<li>
|
||||
{{ user.render_inline(udict[ddoc['owner_uid']], dudoc=dudoc if dudoc else dudict[ddoc['owner_uid']], badge=false) }}
|
||||
@
|
||||
{{ datetime_span(ddoc['update_at'] or ddoc['_id'].generation_time) }}
|
||||
{{ datetime_span(ddoc['update_at'] or ddoc['_id'].generationTime) }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<span class="icon icon-flag"></span> {{ _('My Recent Submissions') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('wiki_help') }}#homework">
|
||||
<li class="menu__item"><a class="menu__link" href="/wiki/help#homework">
|
||||
<span class="icon icon-help"></span> {{ _('Help') }}
|
||||
</a></li>
|
||||
<li class="menu__seperator"></li>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<div data-fragment-id="problem_lucky">
|
||||
<p>
|
||||
<a href="{% if not category %}{{ reverse_url('problem_random') }}{% else %}{{ reverse_url('problem_category_random', category=category) }}{% endif %}" 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>
|
||||
<p>
|
||||
<a href="/problem/random{% if category %}?category={{ category }}{% endif %}" 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>
|
||||
@@ -70,7 +70,7 @@
|
||||
<span class="icon icon-copy"></span> {{ _('Copy Problem') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
{% if handler.user._id == pdoc.owner or handler.has_perm(perm.PERM_EDIT_PROBLEM) %}
|
||||
{% if 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="/p/{{ pdoc.pid }}/edit">
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
@@ -98,8 +98,8 @@
|
||||
<dt>{{ _('Submission') }}</dt>
|
||||
<dd>
|
||||
{% if 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']] }}">
|
||||
<span class="icon record-status--icon {{ builtin.STATUS_CODES[pdoc['psdoc']['status']] }}"></span>
|
||||
<a href="/r/{{ pdoc['psdoc']['rid'] }}" class="record-status--text {{ builtin.STATUS_CODES[pdoc['psdoc']['status']] }}">
|
||||
{{ status.STATUS_TEXTS[pdoc['psdoc']['status']] }}
|
||||
</a>
|
||||
{% else %}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<blockquote class="warn">
|
||||
<p>{{ _('No dataset at present.') }}</p>
|
||||
</blockquote>
|
||||
{% elif pdoc.data.startsWith('from:') %}
|
||||
{% elif typeof(pdoc.data) == 'string' %}
|
||||
<blockquote class="note">
|
||||
<p>{{ _('Test data comes from') }} <a href="#" target="_blank">{{ pdoc.data.split(':')[1] }}</a></p>
|
||||
</blockquote>
|
||||
|
||||
@@ -6,19 +6,18 @@
|
||||
<div class="section__body">
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="medium-8 columns">
|
||||
<div class="medium-7 columns">
|
||||
<label>
|
||||
{{ _('Title') }}
|
||||
<input name="title" placeholder="{{ _('title') }}" value="{{ pdoc['title']|default('') }}" class="textbox" autofocus>
|
||||
</label>
|
||||
</div>
|
||||
{% if page_name == 'problem_create' %}
|
||||
<div class="medium-2 columns">
|
||||
<div class="medium-3 columns">
|
||||
<label>
|
||||
{{ _('Settings') }}
|
||||
{{ _('pid') }}
|
||||
<br>
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="numeric_pid" value="on" checked>{{ _('Numeric PID') }}
|
||||
<label>
|
||||
<input name="pid" placeholder="{{ _('Leave blank to use numeric pid.') }}" value="{{ pdoc['pid']|default('') }}" class="textbox">
|
||||
</label>
|
||||
</label>
|
||||
</div>
|
||||
@@ -30,7 +29,6 @@
|
||||
</label>
|
||||
</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="row"><div class="columns">
|
||||
<label>
|
||||
@@ -49,9 +47,6 @@
|
||||
{{ _('Create') }}
|
||||
</button>
|
||||
{% endif %}
|
||||
<button type="button" class="rounded button" onclick="window.history.go(-1)">
|
||||
{{ _('Cancel') }}
|
||||
</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -61,7 +56,6 @@
|
||||
{% if page_name == 'problem_edit' %}
|
||||
{% set owner_udoc=udoc %}{% set owner_dudoc=dudoc %}
|
||||
{% include "partials/problem_sidebar.html" %}
|
||||
{% endwith %}
|
||||
{% else %}
|
||||
{% include 'components/md_hint.html' %}
|
||||
{% endif %}
|
||||
|
||||
+16
-17
@@ -1,3 +1,4 @@
|
||||
{% set page_name = "problem_main" %}
|
||||
{% import "components/record.html" as record with context %}
|
||||
{% import "components/problem.html" as problem with context %}
|
||||
{% extends "layout/basic.html" %}
|
||||
@@ -24,23 +25,21 @@
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<ul class="group-list" data-widget-cf-container>
|
||||
{% for category in builtin.CATEGORIES %}
|
||||
{% for sub_categories in category %}
|
||||
<li class="group-list__item">
|
||||
<h2 class="section__title">
|
||||
<a href="/p?category={{ category|urlencode }}">{{ 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="/p?category={{ category|urlencode + ',' + sub_category|urlencode }}">{{ sub_category }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% for category, sub_categories in builtin.CATEGORIES %}
|
||||
<li class="group-list__item">
|
||||
<h2 class="section__title">
|
||||
<a href="/p?category={{ category|urlencode }}">{{ 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="/p?category={{ category|urlencode + ',' + sub_category|urlencode }}">{{ sub_category }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{% set page_name = "problem_settings" %}
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
@@ -7,9 +8,9 @@
|
||||
<h1 class="section__title">{{ _('Dataset') }}</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<iframe src="{{ reverse_url('problem_upload', pid=pdoc['_id']) }}" frameborder="0" style="width: 100%; height: 100px;"></iframe>
|
||||
<p class="help-text">{{ _('Hint') }}: <a href="{{ reverse_url('wiki_help') }}#upload">{{ _('Dataset Format') }}</a>, {{ _('An example of dataset') }}: <a href="https://github.com/vijos/jd4/blob/master/jd4/testdata/aplusb-legacy.zip?raw=true">{{ _('Download') }}</a></p>
|
||||
{% if pdoc and (handler.own(pdoc, perm.PERM_READ_PROBLEM_DATA_SELF) or handler.has_perm(perm.PERM_READ_PROBLEM_DATA) or handler.has_priv(vj4.model.builtin.PRIV_READ_PROBLEM_DATA)) %}
|
||||
<iframe src="/p/{{ pdoc.pid }}/upload" frameborder="0" style="width: 100%; height: 100px;"></iframe>
|
||||
<p class="help-text">{{ _('Hint') }}: <a href="/wiki/help#upload">{{ _('Dataset Format') }}</a>, {{ _('An example of dataset') }}: <a href="https://github.com/vijos/jd4/blob/master/jd4/testdata/aplusb-legacy.zip?raw=true">{{ _('Download') }}</a></p>
|
||||
{% if pdoc and (pdoc.owner == user._id or handler.has_perm(perm.PERM_READ_PROBLEM_DATA)) %}
|
||||
<p><a href="/p/{{ pdoc.pid }}/data" class="expanded button">{{ _('Download Dataset') }}</a></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
@@ -20,27 +21,31 @@
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<form method="post">
|
||||
{{ form.form_checkbox(label='Hidden', help_text='Note: Problem title may not be hidden.', name='hidden', value=pdoc['hidden']) }}
|
||||
{{ form.form_text(columns=12, label='Category', help_text='Format: category 1, sub category 1.1, sub category 1.2, ..., sub category 1.x, ..., category n, sub category n.1, sub category n.2, ..., sub category n.m, ...', name='category', value=pdoc['category']|join(', ')) }}
|
||||
{{ form.form_text(columns=12, label='Tags', help_text='Splitted by \', \'.', name='tag', value=pdoc['tag']|join(', ')) }}
|
||||
{{ form.form_text(columns=12, label='AC Message', help_text='This message will be presented to those whose submissions are accepted.', name='ac_msg', value=(pdoc['ac_msg'] or '' )) }}
|
||||
<div class="row">
|
||||
{{ form.form_select(columns=4, label='Difficulty', name='difficulty_setting', options=vj4.model.adaptor.problem.SETTING_DIFFICULTY_RANGE.items(), value=pdoc['difficulty_setting']|default(0), row=false) }}
|
||||
{{ form.form_text(columns=4, label='Evaluated difficulty', help_text='Effects only when Difficulty is not \'Use algorithm calculated\'.', name='difficulty_admin', placeholder='9', value=pdoc['difficulty_admin'] or '', row=False) }}
|
||||
<div class="medium-4 columns">
|
||||
<p class="help-text">{{ _('Difficulty displayed') }}: {{ pdoc['difficulty'] or _('(None)') }}</p>
|
||||
<p class="help-text">{{ _('Difficulty by algorithm') }}: {{ pdoc['difficulty_algo'] or _('(None)') }}</p>
|
||||
<p class="help-text">{{ _('Difficulty by admin') }}: {{ pdoc['difficulty_admin'] or _('(None)') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{ form.form_checkbox({
|
||||
label:'Hidden',
|
||||
help_text:'Note: Problem title may not be hidden.',
|
||||
name:'hidden',
|
||||
value:pdoc['hidden']
|
||||
}) }}
|
||||
{{ form.form_text({
|
||||
columns:12,
|
||||
label:'Category',
|
||||
help_text:'Format: category 1, sub category 1.1, sub category 1.2, ..., sub category 1.x, ..., category n, sub category n.1, sub category n.2, ..., sub category n.m, ...',
|
||||
name:'category',
|
||||
value:pdoc['category']|join(', ')
|
||||
}) }}
|
||||
{{ form.form_text({
|
||||
columns:12,
|
||||
label:'Tags',
|
||||
help_text:'Splitted by \', \'.',
|
||||
name:'tag',
|
||||
value:pdoc['tag']|join(', ')
|
||||
}) }}
|
||||
<div class="row"><div class="columns">
|
||||
<input type="hidden" name="csrf_token" value="{{ handler.csrf_token }}">
|
||||
<button type="submit" class="rounded primary button">
|
||||
{{ _('Update') }}
|
||||
</button>
|
||||
<button type="button" class="rounded button" onclick="window.history.go(-1)">
|
||||
{{ _('Cancel') }}
|
||||
</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -50,8 +55,7 @@
|
||||
<h1 class="section__title">{{ _('Categories') }} ({{ _('click to add') }})</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<!-- TODO: chip -->
|
||||
{% for category, sub_categories in categories.items() %}
|
||||
{% for category, sub_categories in builtin.CATEGORIES %}
|
||||
<div>
|
||||
<h2 class="section__title"><a class="category-a" href="javascript:;" data-category="{{ category }}">{{ category }}</a></h2>
|
||||
<ol>
|
||||
@@ -67,7 +71,6 @@
|
||||
<div class="medium-3 columns">
|
||||
{% set owner_udoc=udoc %}{% set owner_dudoc=dudoc %}
|
||||
{% include "partials/problem_sidebar.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -6,7 +6,7 @@
|
||||
{% if not tdoc or rdocs %}
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Recent {0} Records').format(10) }}</h1>
|
||||
<h1 class="section__title">{{ _('Recent 10 Records') }}</h1>
|
||||
</div>
|
||||
<div class="section__body no-padding">
|
||||
{% if not rdocs %}
|
||||
@@ -23,7 +23,6 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col--status record-status--border">{{ _('Status') }}</th>
|
||||
<th class="col--pretest">{{ _('Pretest?') }}</th>
|
||||
<th class="col--memory">{{ _('Peak Memory') }}</th>
|
||||
<th class="col--time">{{ _('Total Time') }}</th>
|
||||
<th class="col--submit-at">{{ _('Submit At') }}</th>
|
||||
@@ -45,8 +44,8 @@
|
||||
</div>
|
||||
<div class="section__body">
|
||||
<form method="post">
|
||||
{{ form.form_select(label='Code language', options=builtin.LANGS, name='lang', value=handler.user.codeLang) }}
|
||||
{{ form.form_textarea(label='Code', columns=12, name='code', extra_class='monospace', autofocus=true) }}
|
||||
{{ form.form_select({label:'Code language', options:builtin.LANG_TEXTS, name:'lang', value:handler.user.codeLang}) }}
|
||||
{{ form.form_textarea({label:'Code', columns:12, name:'code', extra_class:'monospace', autofocus:true}) }}
|
||||
<div class="row"><div class="columns">
|
||||
<input type="hidden" name="csrf_token" value="{{ handler.csrf_token }}">
|
||||
<input type="submit" class="rounded primary button" value="{{ _('Submit') }}">
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
<td class="col--time">
|
||||
{{ (rdoc.time / 1000)|round(1) }}s
|
||||
</td>
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generation_time) }}</td>
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generationTime) }}</td>
|
||||
</tr>
|
||||
@@ -1,17 +1,16 @@
|
||||
{% extends 'layout/simple.html' %}
|
||||
{% block body %}
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% if pdoc['data'].startsWith('from:') %}
|
||||
<p><b>{{ _('Current dataset comes from') }} <a href="{{ pdoc.data.split('from:')[1] }}" target="_blank">{{ pdoc.data.split('from:')[1] }}</a></b></p>
|
||||
{% else %}
|
||||
<p>{{ _('Current dataset: {0}').format(pdoc['data']|default(_('(None)'))) }}</p>
|
||||
<p>{{ _('MD5: {0}').format(md5|default(_('(None)'))) }}</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
{{ _('New dataset') }}:
|
||||
<input type="hidden" name="csrf_token" value="{{ handler.csrf_token }}">
|
||||
<input type="file" name="file">
|
||||
<input type="submit" value="{{ _('Upload') }}" class="rounded primary button">
|
||||
</p>
|
||||
{% if (typeof(pdoc.data) == 'string') %}
|
||||
<p><b>{{ _('Current dataset comes from') }} <a href="{{ pdoc.data.split('from:')[1] }}" target="_blank">{{ pdoc.data.split('from:')[1] }}</a></b></p>
|
||||
{% else %}
|
||||
<p>{{ _('Current dataset: {0}').format(pdoc['data'].toString()|default(_('(None)'))) }}</p>
|
||||
<p>{{ _('MD5: {0}').format(md5|default(_('(None)'))) }}</p>
|
||||
{% endif %}
|
||||
<p>{{ _('New dataset') }}:
|
||||
<input type="hidden" name="csrf_token" value="{{ handler.csrf_token }}">
|
||||
<input type="file" name="file">
|
||||
<input type="submit" value="{{ _('Upload') }}" class="rounded primary button">
|
||||
</p>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -1,5 +1,6 @@
|
||||
{% extends "layout/basic.html" %}
|
||||
{% set page_name = "record_detail" %}
|
||||
{% import "components/problem.html" as problem with context %}
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<script>
|
||||
var Context = {
|
||||
@@ -77,10 +78,7 @@
|
||||
</dd>
|
||||
{% endif %}{# tdoc['doc_type'] == vj4.model.document.TYPE_CONTEST #}
|
||||
{% endif %}{# tdoc #}
|
||||
{% if rdoc['type'] == vj4.constant.record.TYPE_PRETEST and (handler.own(rdoc, priv=vj4.model.builtin.PRIV_READ_PRETEST_DATA_SELF, field='uid') or handler.has_priv(vj4.model.builtin.PRIV_READ_PRETEST_DATA)) %}
|
||||
<dt>{{ _('Pretest Data') }}</dt>
|
||||
<dd><a href="{{ reverse_url('record_pretest_data', rid=rdoc['_id']) }}"><span class="icon icon-download"></span> {{ _('Download') }}</a></dd>
|
||||
{% elif rdoc['type'] == vj4.constant.record.TYPE_SUBMISSION and pdoc and (handler.own(pdoc, perm.PERM_READ_PROBLEM_DATA_SELF) or handler.has_perm(perm.PERM_READ_PROBLEM_DATA) or handler.has_priv(vj4.model.builtin.PRIV_READ_PROBLEM_DATA)) %}
|
||||
{% if pdoc and (user._id == pdoc.owner or handler.has_perm(perm.PERM_READ_PROBLEM_DATA)) %}
|
||||
<dt>{{ _('Problem Data') }}</dt>
|
||||
<dd><a href="/p/{{ pdoc.pid }}/data"><span class="icon icon-download"></span> {{ _('Download') }}</a></dd>
|
||||
{% endif %}
|
||||
@@ -92,11 +90,11 @@
|
||||
{{ _('Submit At') }}
|
||||
</dt>
|
||||
<dd>
|
||||
{{ datetime_span(rdoc['_id'].generation_time) }}
|
||||
{{ datetime_span(rdoc['_id'].generationTime)|safe }}
|
||||
</dd>
|
||||
{% if rdoc['judge_at'] %}
|
||||
{% if rdoc.judgeAt %}
|
||||
<dt>{{ _('Judged At') }}</dt>
|
||||
<dd>{{ datetime_span(rdoc['judge_at']) }}</dd>
|
||||
<dd>{{ datetime_span(rdoc.judgeAt)|safe }}</dd>
|
||||
{% endif %}
|
||||
{% if judge_udoc %}
|
||||
<dt>{{ _('Judged By') }}</dt>
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
<div class="section visible" id="status">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">
|
||||
<span class="icon record-status--icon {{ status.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ status.STATUS_CODES[rdoc['status']] }}">
|
||||
{{ status.STATUS_TEXTS[rdoc['status']] }}
|
||||
<span class="icon record-status--icon {{ builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ builtin.STATUS_CODES[rdoc['status']] }}">
|
||||
{{ builtin.STATUS_TEXTS[rdoc['status']] }}
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
{% if rdoc.compilerTexts %}
|
||||
<div class="section__body">
|
||||
<pre class="compiler-text">{{ rdoc.compilerTexts|join('\n') }}</pre>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if rdoc.judgeTexts %}
|
||||
<div class="section__body">
|
||||
<pre class="judge-text">{{ rdoc.judgeTexts|join('\n') }}</pre>
|
||||
@@ -35,16 +37,16 @@
|
||||
<tbody>
|
||||
{% for rcdoc in rdoc['cases'] %}
|
||||
<tr>
|
||||
<td class="col--case record-status--border {{ status.STATUS_CODES[rcdoc['status']] }}">
|
||||
<td class="col--case record-status--border {{ builtin.STATUS_CODES[rcdoc['status']] }}">
|
||||
#{{ loop.index }}
|
||||
</td>
|
||||
<td class="col--status">
|
||||
<span class="icon record-status--icon {{ status.STATUS_CODES[rcdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ status.STATUS_CODES[rcdoc['status']] }}">
|
||||
<span class="icon record-status--icon {{ builtin.STATUS_CODES[rcdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ builtin.STATUS_CODES[rcdoc['status']] }}">
|
||||
{{ status.STATUS_TEXTS[rcdoc['status']] }}
|
||||
</span>
|
||||
<span>{{ rcdoc['judge_text'] }}</span>
|
||||
<a class="tool-button" href="{{ reverse_url('wiki_help') }}#status"><span class="icon icon-help"></span></a>
|
||||
<span>{{ rcdoc['judgeText'] }}</span>
|
||||
<a class="tool-button" href="/wiki/help#status"><span class="icon icon-help"></span></a>
|
||||
</td>
|
||||
<td class="col--time">{% if rcdoc['status'] == status.STATUS_TIME_LIMIT_EXCEEDED or rcdoc['status'] == status.STATUS_MEMORY_LIMIT_EXCEEDED or rcdoc['status'] == status.STATUS_OUTPUT_LIMIT_EXCEEDED %}≥{% endif %}{{ rcdoc['time_ms'] }}ms</td>
|
||||
<td class="col--memory">{% if rcdoc['status'] == status.STATUS_TIME_LIMIT_EXCEEDED or rcdoc['status'] == status.STATUS_MEMORY_LIMIT_EXCEEDED or rcdoc['status'] == status.STATUS_OUTPUT_LIMIT_EXCEEDED %}≥{% endif %}{{ rcdoc['memory_kb']|format_size(1024) }}</td>
|
||||
|
||||
@@ -29,5 +29,5 @@
|
||||
<td class="col--time">{% if rdoc['status'] == status.STATUS_TIME_LIMIT_EXCEEDED or rdoc['status'] == status.STATUS_MEMORY_LIMIT_EXCEEDED or rdoc['status'] == status.STATUS_OUTPUT_LIMIT_EXCEEDED %}≥{% endif %}{{ rdoc.time }}ms</td>
|
||||
<td class="col--memory">{% if rdoc['status'] == status.STATUS_TIME_LIMIT_EXCEEDED or rdoc['status'] == status.STATUS_MEMORY_LIMIT_EXCEEDED or rdoc['status'] == status.STATUS_OUTPUT_LIMIT_EXCEEDED %}≥{% endif %}{{ rdoc.memory|format_size(1024) }}</td>
|
||||
<td class="col--lang">{{ vj4.constant.language.LANG_TEXTS[rdoc['lang']] }}</td>
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generation_time) }}</td>
|
||||
<td class="col--submit-at">{{ datetime_span(rdoc['_id'].generationTime) }}</td>
|
||||
</tr>
|
||||
@@ -180,7 +180,7 @@
|
||||
<span class="icon icon-edit"></span> {{ _('Edit') }}
|
||||
</a></li>
|
||||
{% endif %}
|
||||
<li class="menu__item"><a class="menu__link" href="{{ reverse_url('wiki_help') }}#training">
|
||||
<li class="menu__item"><a class="menu__link" href="/wiki/help#training">
|
||||
<span class="icon icon-help"></span> {{ _('Help') }}
|
||||
</a></li>
|
||||
<li class="menu__seperator"></li>
|
||||
|
||||
Reference in new issue
Block a user