mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: allow custom problem difficulty
This commit is contained in:
1 parent
7f74c11bbd
commit
073eaffbd3
14 files changed
+38
-17
No files matched your search
@@ -10,7 +10,7 @@
|
||||
<dt>{{ _('Memory') }}</dt>
|
||||
<dd>{{ pdoc.config.memoryMax if pdoc.config.memoryMax == pdoc.config.memoryMin else pdoc.config.memoryMin+'~'+pdoc.config.memoryMax }}MiB</dd>
|
||||
<dt>{{ _('Difficulty') }}</dt>
|
||||
<dd>{{ pdoc['difficulty'] or _('(None)') }}</dd>
|
||||
<dd>{{ pdoc['difficulty'] or lib.difficulty(pdoc.nSubmit, pdoc.nAccept) or _('(None)') }}</dd>
|
||||
<dt>{{ _('Category') }}</dt>
|
||||
<dd>
|
||||
{% if pdoc['category'] %}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</td>
|
||||
<td class="col--tried">{{ pdoc.nSubmit }}</td>
|
||||
<td class="col--ac">{{ pdoc.nAccept }}</td>
|
||||
<td class="col--difficulty">{{ pdoc['difficulty'] or _('(None)') }}</td>
|
||||
<td class="col--difficulty">{{ pdoc['difficulty'] or lib.difficulty(pdoc.nSubmit, pdoc.nAccept) or _('(None)') }}</td>
|
||||
</tr>
|
||||
{%- endfor -%}
|
||||
</tbody>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
{% if not tdoc %}
|
||||
<a class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item" href="{{ url('record_main', query={pid:pdoc.docId}) }}">{{ _('Tried') }}: {{ pdoc.nSubmit }}</a>
|
||||
<a class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item" href="{{ url('record_main', query={pid:pdoc.docId, status:1}) }}">{{ _('Accepted') }}: {{ pdoc.nAccept if ((not tdoc) or showAccept) else '?' }}</a>
|
||||
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('Difficulty') }}: {{ pdoc['difficulty'] or _('(None)') }}</span>
|
||||
<span class="bp3-tag bp3-large bp3-minimal problem__tag-item">{{ _('Difficulty') }}: {{ pdoc['difficulty'] or lib.difficulty(pdoc.nSubmit, pdoc.nAccept) or _('(None)') }}</span>
|
||||
{% endif %}
|
||||
<span class="bp3-tag bp3-large bp3-minimal bp3-interactive problem__tag-item">{{ _('Uploaded By') }}: {{ user.render_inline(udoc, badge=false) }}</span>
|
||||
{% if pdoc.tag.length %}
|
||||
|
||||
@@ -30,13 +30,24 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{{ form.form_text({
|
||||
columns:12,
|
||||
row:false,
|
||||
columns:8,
|
||||
label:'Tags',
|
||||
help_text:'Split by \', \'.',
|
||||
name:'tag',
|
||||
value:pdoc['tag']|default([])|join(', ')
|
||||
}) }}
|
||||
{{ form.form_text({
|
||||
row:false,
|
||||
columns:4,
|
||||
label:'Difficulty',
|
||||
help_text:'From 1-10',
|
||||
name:'difficulty',
|
||||
value:pdoc['difficulty']
|
||||
}) }}
|
||||
</div>
|
||||
<div class="section__tab-container nojs--hide">
|
||||
<div class="section__tab-header-wrapper">
|
||||
<ul class="section__tab-header">
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
</td>
|
||||
<td class="col--tried">{{ pdoc.nSubmit }}</td>
|
||||
<td class="col--ac">{{ pdoc.nAccept }}</td>
|
||||
<td class="col--difficulty">{{ pdoc['difficulty'] or _('(None)') }}</td>
|
||||
<td class="col--difficulty">{{ pdoc['difficulty'] or lib.difficulty(pdoc.nSubmit, pdoc.nAccept) or _('(None)') }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
{% set pdoc = {'_id': pid, 'hidden': true, 'title': '*'} %}
|
||||
|
||||
Reference in new issue
Block a user