mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: record_detail: simplify subtask display logic
This commit is contained in:
1 parent
a31b890c25
commit
a665db80c7
2 files changed
+8
-14
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.37.20",
|
||||
"version": "4.37.21",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -36,26 +36,20 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%- for subtaskId,rcdocs in rdoc.testCases|sort(false,false,'id')|groupby('subtaskId') -%}
|
||||
{% if rcdocs.length != 1 and rcdocs.length != rdoc.testCases.length %}
|
||||
{% set _key = 'id' if rdoc.testCases|groupby('subtaskId')|length == 1 else 'subtaskId' %}
|
||||
{%- for subtaskId, rcdocs in rdoc.testCases|sort(false,false,_key)|groupby(_key) -%}
|
||||
{% if rcdocs.length > 1 %}
|
||||
<tr class="subtask">
|
||||
<td class="col--case">
|
||||
#{{ subtaskId|int|default(0) }}
|
||||
#{{ subtaskId|int|default(1) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{%- for rcdoc in rcdocs -%}
|
||||
{% if rcdocs.length != 1 %}
|
||||
<tr class="case">
|
||||
{%- for rcdoc in rcdocs|sort(false,false,'id') -%}
|
||||
<tr class="{{ 'subtask-case' if rcdocs.length == 1 else 'case' }}">
|
||||
<td class="col--case record-status--border {{ model.builtin.STATUS_CODES[rcdoc['status']] }}">
|
||||
#{% if rcdocs.length != rdoc.testCases.length %}{{ rcdoc.subtaskId|int|default(0) }}-{% endif %}{{ rcdoc.id|default(loop.index) }}
|
||||
#{{ subtaskId|int|default(1) }}{% if rcdocs.length > 1 %}-{{ rcdoc.id|default(loop.index) }}{% endif %}
|
||||
</td>
|
||||
{% else %}
|
||||
<tr class="subtask-case">
|
||||
<td class="col--case record-status--border {{ model.builtin.STATUS_CODES[rcdoc['status']] }}">
|
||||
#{{ rcdoc.subtaskId|int|default(0) }}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="col--status">
|
||||
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rcdoc['status']] }}"></span>
|
||||
<span class="record-status--text {{ model.builtin.STATUS_CODES[rcdoc['status']] }}">
|
||||
|
||||
Reference in new issue
Block a user