|
|
|
@ -103,9 +103,47 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% } %> |
|
|
|
|
<h4 class="ui top attached block header">近期比赛</h4> |
|
|
|
|
<div class="ui bottom attached <% if (!contests || !contests.length) { %>center aligned <% } %>segment"> |
|
|
|
|
<% if (!contests || !contests.length) { %> |
|
|
|
|
还没有举行过任何比赛 |
|
|
|
|
<% } else { %> |
|
|
|
|
<table class="ui very basic center aligned table"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th>比赛名称</th> |
|
|
|
|
<th>开始时间</th> |
|
|
|
|
</tr> |
|
|
|
|
</thead> |
|
|
|
|
<tbody> |
|
|
|
|
<% |
|
|
|
|
for (let contest of contests) { |
|
|
|
|
let now = syzoj.utils.getCurrentDate(); |
|
|
|
|
let tag = ''; |
|
|
|
|
%> |
|
|
|
|
<tr> |
|
|
|
|
<% if (now < contest.start_time) { %> |
|
|
|
|
<% tag = '<span class="ui header"><div class="ui mini grey label">未开始</div></span>' %> |
|
|
|
|
<% } else if (now >= contest.start_time && now < contest.end_time) { %> |
|
|
|
|
<% tag = '<span class="ui header"><div class="ui mini green label">进行中</div></span>' %> |
|
|
|
|
<% } else { %> |
|
|
|
|
<% tag = '<span class="ui header"><div class="ui mini red label">已结束</div></span>' %> |
|
|
|
|
<% } %> |
|
|
|
|
<td><a href="<%= syzoj.utils.makeUrl(['contest', contest.id]) %>"><%= contest.title %> <%- tag %></a></td> |
|
|
|
|
<td><%= syzoj.utils.formatDate(contest.start_time) %></td> |
|
|
|
|
</tr> |
|
|
|
|
<% } %> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
<h4 class="ui top attached block header">信息栏</h4> |
|
|
|
|
<div class="ui bottom attached segment"> |
|
|
|
|
<div class="ui bottom attached <% if (!syzoj.config.announcement) { %>center aligned <% } %>segment"> |
|
|
|
|
<% if (!syzoj.config.announcement) { %> |
|
|
|
|
无任何信息 |
|
|
|
|
<% } else { %> |
|
|
|
|
<p><%- syzoj.config.announcement %></p> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|