mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: contest(OI): 订正模式
This commit is contained in:
1 parent
e70beab967
commit
15827eeabb
7 files changed
+65
-31
No files matched your search
@@ -66,6 +66,7 @@ class Nunjucks extends nunjucks.Environment {
|
||||
this.addFilter('base64_encode', (s) => Buffer.from(s).toString('base64'));
|
||||
this.addFilter('base64_decode', (s) => Buffer.from(s, 'base64').toString());
|
||||
this.addFilter('bitand', (self, val) => self & val);
|
||||
this.addFilter('replaceBr', (self) => self.toString().replace(/\n/g, '<br>'));
|
||||
this.addFilter('toString', (self) => (typeof self === 'string' ? self : JSON.stringify(self, replacer)));
|
||||
this.addFilter('content', (content, language, html) => {
|
||||
let s = '';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.8.29",
|
||||
"version": "4.8.30",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -41,10 +41,21 @@
|
||||
{{ user.render_inline(udict[column.raw], badge=false) }}
|
||||
{% elif column.type == 'record' and column.raw %}
|
||||
<a href="{{ url('record_detail', rid=column.raw) }}">
|
||||
<span style="font-weight:bold;color:{{ utils.status.getScoreColor(column.value) }}">{{ column.value|safe }}</span>
|
||||
<span style="font-weight:bold;color:{{ utils.status.getScoreColor(column.score|default(column.value)) }}">{{ column.value|replaceBr|safe }}</span>
|
||||
</a>
|
||||
{% elif column.type == 'records' %}
|
||||
{%- for record in column.raw -%}
|
||||
{% if loop.index0 %}/{% endif %}
|
||||
{% if record.raw %}
|
||||
<a href="{{ url('record_detail', rid=record.raw) }}">
|
||||
<span style="font-weight:bold;color:{{ utils.status.getScoreColor(record.score|default(record.value)) }}">{{ record.value|replaceBr|safe }}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
{{ record.value|replaceBr|safe }}
|
||||
{% endif %}
|
||||
{%- endfor -%}
|
||||
{% else %}
|
||||
{{ column.value|safe }}
|
||||
{{ column.value|replaceBr|safe }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{%- endfor -%}
|
||||
|
||||
Reference in new issue
Block a user