mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01: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
@@ -129,6 +129,7 @@ env.addGlobal('size', misc.size);
|
||||
env.addGlobal('utils', { status });
|
||||
env.addGlobal('avatarUrl', avatar);
|
||||
env.addGlobal('formatSeconds', misc.formatSeconds);
|
||||
env.addGlobal('lib', global.Hydro.lib);
|
||||
env.addGlobal('model', global.Hydro.model);
|
||||
env.addGlobal('ui', global.Hydro.ui);
|
||||
env.addGlobal('isIE', (str) => (str ? (str.includes('MSIE') || str.includes('rv:11.0')) : false));
|
||||
|
||||
@@ -295,7 +295,6 @@ Enabled: 开启
|
||||
End at: 结束于
|
||||
End Date: 结束日期
|
||||
End Time: 结束时间
|
||||
English: 英文
|
||||
Enroll Training: 参加训练
|
||||
Enrolled: 已参加
|
||||
Enrollees: 参加人数
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.27.4",
|
||||
"version": "4.27.5",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
position: relative
|
||||
|
||||
.col--submit-at
|
||||
width: rem(120px)
|
||||
width: rem(115px)
|
||||
text-align: center
|
||||
|
||||
&.nojs .col--submit-at
|
||||
width: rem(160px)
|
||||
|
||||
.col--submit-by
|
||||
width: rem(120px)
|
||||
width: rem(140px)
|
||||
text-align: right
|
||||
|
||||
.col--time, .col--memory, .col--lang
|
||||
width: rem(100px)
|
||||
width: rem(95px)
|
||||
text-align: center
|
||||
|
||||
.col--status, .col--submit-by, .col--lang
|
||||
|
||||
@@ -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