Browse Source

Fix seeResult.

master
t123yh 7 years ago
parent
commit
037c78d686
  1. 5
      views/contest.ejs

5
views/contest.ejs

@ -11,7 +11,8 @@
<h1><%= contest.title %></h1> <h1><%= contest.title %></h1>
<div style="margin-bottom: 30px;"><%- contest.subtitle %></div> <div style="margin-bottom: 30px;"><%- contest.subtitle %></div>
<% let unveiled = (isSupervisior || syzoj.utils.getCurrentDate() >= contest.start_time); %> <% let unveiled = (isSupervisior || syzoj.utils.getCurrentDate() >= contest.start_time); %>
<% const seeResult = (isSupervisior || contest.ended || (contest.allowedSeeingResult() && contest.allowedSeeingOthers())) %> <% const seeResult = (isSupervisior || contest.ended) %>
<% const seeRanklist = seeResult || (contest.allowedSeeingResult() && contest.allowedSeeingOthers() %>
<% let start = syzoj.utils.formatDate(contest.start_time), end = syzoj.utils.formatDate(contest.end_time); %> <% let start = syzoj.utils.formatDate(contest.start_time), end = syzoj.utils.formatDate(contest.end_time); %>
<% if (contest.running && start.split(' ')[0] === end.split(' ')[0]) { <% if (contest.running && start.split(' ')[0] === end.split(' ')[0]) {
start = start.split(' ')[1]; end = end.split(' ')[1]; start = start.split(' ')[1]; end = end.split(' ')[1];
@ -26,7 +27,7 @@
<div class="row"> <div class="row">
<div class="column"> <div class="column">
<div class="ui buttons"> <div class="ui buttons">
<% if(seeResult) { %> <% if(seeRanklist) { %>
<a class="ui small blue button" href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'ranklist']) %>">排行榜</a> <a class="ui small blue button" href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'ranklist']) %>">排行榜</a>
<% } %> <% } %>
<% let submissionsUrl = seeResult ? <% let submissionsUrl = seeResult ?

Loading…
Cancel
Save