diff --git a/utility.js b/utility.js index 7618582..6140f42 100644 --- a/utility.js +++ b/utility.js @@ -250,7 +250,8 @@ module.exports = { return await request({ uri: 'http://api.hitokoto.us/rand', qs: { - encode: 'json' + encode: 'json', + cat: 'a' }, json: true }); diff --git a/views/contest.ejs b/views/contest.ejs index 1b477bb..55f9815 100644 --- a/views/contest.ejs +++ b/views/contest.ejs @@ -1,9 +1,26 @@ <% this.title = contest.title + ' - 比赛' %> + <% include header %>

<%= contest.title %>

+ <% 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 (contest.running && start.split(' ')[0] === end.split(' ')[0]) { + start = start.split(' ')[1]; end = end.split(' ')[1]; + } %> +
<%= start %>
+
<%= end %>
+ <% let timePercentage = Math.floor(Math.min(1, (syzoj.utils.getCurrentDate() - contest.start_time) / (contest.end_time - contest.start_time)) * 100); %> +
+
+
- <% if (contest.allowedEdit || !contest.running) { %> + <% if (contest.allowedEdit || (unveiled && !contest.running)) { %>
@@ -23,6 +40,7 @@
+ <% if (unveiled) { %>
@@ -64,6 +82,18 @@
+ <% } %>
+ + <% include footer %>