Browse Source

Auto expand if single subtask.

pull/6/head
t123yh 7 years ago
parent
commit
fd2d4aab38
  1. 9
      views/submission_content.ejs

9
views/submission_content.ejs

@ -27,7 +27,7 @@
<div class="ui styled fluid accordion" v-if="detailResult && detailResult.judge && detailResult.judge.subtasks"> <div class="ui styled fluid accordion" v-if="detailResult && detailResult.judge && detailResult.judge.subtasks">
<template v-for="subtask, $index in detailResult.judge.subtasks"> <template v-for="subtask, $index in detailResult.judge.subtasks">
<div class="title"> <div class="title" :class="singleSubtask ? 'active' : ''">
<div class="ui grid"> <div class="ui grid">
<div class="three wide column"> <div class="three wide column">
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
@ -41,7 +41,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="content"> <div class="content" :class="singleSubtask ? 'active' : ''">
<div class="accordion"> <div class="accordion">
<template v-for="curCase, $caseIndex in subtask.cases"> <template v-for="curCase, $caseIndex in subtask.cases">
<div class="title"> <div class="title">
@ -154,6 +154,11 @@ const vueApp = new Vue({
code: <%- JSON.stringify(code) %>, code: <%- JSON.stringify(code) %>,
detailResult: <%- JSON.stringify(detailResult) %> detailResult: <%- JSON.stringify(detailResult) %>
}, },
computed: {
singleSubtask() {
return this.detailResult.judge.subtasks.length === 1;
}
},
methods: { methods: {
getStatusString(statusCode) { getStatusString(statusCode) {
return statusToString[statusCode]; return statusToString[statusCode];

Loading…
Cancel
Save