Browse Source

Hide problems list before start of a contest

pull/6/head
Pisces000221 8 years ago
parent
commit
774aff33ad
  1. 15
      views/contest.ejs

15
views/contest.ejs

@ -8,22 +8,19 @@
<% include header %>
<div class="padding">
<h1 style="margin-bottom: 30px; "><%= contest.title %></h1>
<% let unveiled = (contest.allowedEdit || syzoj.utils.getCurrentDate() >= contest.start_time); %>
<% let start = syzoj.utils.formatDate(contest.start_time), end = syzoj.utils.formatDate(contest.end_time); %>
<% if (syzoj.utils.getCurrentDate() >= contest.start_time && syzoj.utils.getCurrentDate() < contest.end_time && start.split(' ')[0] === end.split(' ')[0]) {
<% if (contest.running && start.split(' ')[0] === end.split(' ')[0]) {
start = start.split(' ')[1]; end = end.split(' ')[1];
} %>
<div class="ui pointing below left label">
<%= start %>
</div>
<div class="ui pointing below right label">
<%= end %>
</div>
<div class="ui pointing below left label"><%= start %></div>
<div class="ui pointing below right label"><%= end %></div>
<% let timePercentage = Math.floor(Math.min(1, (syzoj.utils.getCurrentDate() - contest.start_time) / (contest.end_time - contest.start_time)) * 100); %>
<div id="timer-progress" class="ui tiny indicating progress<% if (timePercentage == 100) { %> success<% } %>" data-percent="<%= timePercentage %>">
<div class="bar" style="width: <%= timePercentage %>%;"></div>
</div>
<div class="ui grid">
<% if (contest.allowedEdit || !contest.running) { %>
<% if (contest.allowedEdit || (unveiled && !contest.running)) { %>
<div class="row">
<div class="column">
<div class="ui buttons">
@ -43,6 +40,7 @@
</div>
</div>
</div>
<% if (unveiled) { %>
<div class="row">
<div class="column">
<table class="ui selectable celled table">
@ -84,6 +82,7 @@
</table>
</div>
</div>
<% } %>
</div>
</div>

Loading…
Cancel
Save