mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core&ui: fix record display (#693)
This commit is contained in:
1 parent
323f6b72f1
commit
e0db6c6d47
4 files changed
+12
-2
No files matched your search
@@ -280,6 +280,12 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler {
|
||||
await record.getMulti(domainId, { contest: tid, uid: this.user._id })
|
||||
.sort({ _id: -1 }).toArray(),
|
||||
]);
|
||||
if (!this.user.own(this.tdoc) && !this.user.hasPerm(PERM.PERM_EDIT_CONTEST)) {
|
||||
this.response.body.rdocs = this.response.body.rdocs.map((rdoc) => contest.applyProjection(this.tdoc, rdoc, this.user));
|
||||
for (const psdoc of psdocs) {
|
||||
this.response.body.rdict[psdoc.rid] = contest.applyProjection(this.tdoc, this.response.body.rdict[psdoc.rid], this.user);
|
||||
}
|
||||
}
|
||||
this.response.body.canViewRecord = true;
|
||||
} else {
|
||||
for (const i of psdocs) this.response.body.rdict[i.rid] = { _id: i.rid };
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
href="{{ url('record_detail', rid=rdoc[rid_key], domainId=rdoc.domainId) if allDomain else url('record_detail', rid=rdoc[rid_key]) }}"
|
||||
class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.status] }}"
|
||||
>
|
||||
{% if typeof(rdoc['score']) == 'number' %}
|
||||
<span style="color: {{ utils.status.getScoreColor(rdoc.score|default(0)) }}">{{ rdoc.score|default(0) }}</span>
|
||||
{% endif %}
|
||||
{{ model.builtin.STATUS_SHORT_TEXTS[rdoc.status] if short else model.builtin.STATUS_TEXTS[rdoc.status] }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">
|
||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc['status']] }}"></span>
|
||||
{% if typeof(rdoc['score']) == 'number' %}
|
||||
<span style="color: {{ utils.status.getScoreColor(rdoc.score|default(0)) }}">{{ rdoc.score|default(0) }}</span>
|
||||
{% endif %}
|
||||
<span class="record-status--text {{ model.builtin.STATUS_CODES[rdoc['status']] }}">
|
||||
{{ model.builtin.STATUS_TEXTS[rdoc['status']] }}
|
||||
</span>
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
<td class="col--time">{% if [STATUS.STATUS_TIME_LIMIT_EXCEEDED, STATUS.STATUS_MEMORY_LIMIT_EXCEEDED, STATUS.STATUS_OUTPUT_LIMIT_EXCEEDED].includes(rdoc['status']) %}≥{% endif %}{{ rdoc.time|round|int }}ms</td>
|
||||
<td class="col--memory">{% if [STATUS.STATUS_TIME_LIMIT_EXCEEDED, STATUS.STATUS_MEMORY_LIMIT_EXCEEDED, STATUS.STATUS_OUTPUT_LIMIT_EXCEEDED].includes(rdoc['status']) %}≥{% endif %}{{ size(rdoc.memory, 1024) }}</td>
|
||||
<td class="col--time">{% if rdoc['time'] %}{% if [STATUS.STATUS_TIME_LIMIT_EXCEEDED, STATUS.STATUS_MEMORY_LIMIT_EXCEEDED, STATUS.STATUS_OUTPUT_LIMIT_EXCEEDED].includes(rdoc['status']) %}≥{% endif %}{{ rdoc.time|round|int }}ms{% else %}-{% endif %}</td>
|
||||
<td class="col--memory">{% if rdoc['memory'] %}{% if [STATUS.STATUS_TIME_LIMIT_EXCEEDED, STATUS.STATUS_MEMORY_LIMIT_EXCEEDED, STATUS.STATUS_OUTPUT_LIMIT_EXCEEDED].includes(rdoc['status']) %}≥{% endif %}{{ size(rdoc.memory, 1024) }}{% else %}-{% endif %}</td>
|
||||
<td class="col--lang">{{ model.setting.langs[rdoc['lang']].display }}</td>
|
||||
<td class="col--submit-at">{{ datetimeSpan(rdoc['_id'])|safe }}</td>
|
||||
</tr>
|
||||
Reference in new issue
Block a user