Browse Source

Swap contest 'not started' and 'ended' color

master
Menci 8 years ago
parent
commit
e1972504bd
  1. 4
      views/contests.ejs
  2. 4
      views/index.ejs

4
views/contests.ejs

@ -27,11 +27,11 @@
%> %>
<tr> <tr>
<% if (now < contest.start_time) { %> <% if (now < contest.start_time) { %>
<% tag = '<span class="ui header"><div class="ui mini grey label">未开始</div></span>' %> <% tag = '<span class="ui header"><div class="ui mini red label">未开始</div></span>' %>
<% } else if (now >= contest.start_time && now < contest.end_time) { %> <% } else if (now >= contest.start_time && now < contest.end_time) { %>
<% tag = '<span class="ui header"><div class="ui mini green label">进行中</div></span>' %> <% tag = '<span class="ui header"><div class="ui mini green label">进行中</div></span>' %>
<% } else { %> <% } else { %>
<% tag = '<span class="ui header"><div class="ui mini red label">已结束</div></span>' %> <% tag = '<span class="ui header"><div class="ui mini grey label">已结束</div></span>' %>
<% } %> <% } %>
<td><a href="<%= syzoj.utils.makeUrl(['contest', contest.id]) %>"><%= contest.title %> <%- tag %></a></td> <td><a href="<%= syzoj.utils.makeUrl(['contest', contest.id]) %>"><%= contest.title %> <%- tag %></a></td>

4
views/index.ejs

@ -155,11 +155,11 @@
%> %>
<tr> <tr>
<% if (now < contest.start_time) { %> <% if (now < contest.start_time) { %>
<% tag = '<span class="ui header"><div class="ui mini grey label">未开始</div></span>' %> <% tag = '<span class="ui header"><div class="ui mini red label">未开始</div></span>' %>
<% } else if (now >= contest.start_time && now < contest.end_time) { %> <% } else if (now >= contest.start_time && now < contest.end_time) { %>
<% tag = '<span class="ui header"><div class="ui mini green label">进行中</div></span>' %> <% tag = '<span class="ui header"><div class="ui mini green label">进行中</div></span>' %>
<% } else { %> <% } else { %>
<% tag = '<span class="ui header"><div class="ui mini red label">已结束</div></span>' %> <% tag = '<span class="ui header"><div class="ui mini grey label">已结束</div></span>' %>
<% } %> <% } %>
<td><a href="<%= syzoj.utils.makeUrl(['contest', contest.id]) %>"><%= contest.title %> <%- tag %></a></td> <td><a href="<%= syzoj.utils.makeUrl(['contest', contest.id]) %>"><%= contest.title %> <%- tag %></a></td>
<td><%= syzoj.utils.formatDate(contest.start_time) %></td> <td><%= syzoj.utils.formatDate(contest.start_time) %></td>

Loading…
Cancel
Save