From 774aff33adda7a2af6b6c576e5d26987b7a282b7 Mon Sep 17 00:00:00 2001
From: Pisces000221 <1786762946@qq.com>
Date: Sun, 5 Mar 2017 00:02:28 +0800
Subject: [PATCH 3/4] Hide problems list before start of a contest
---
views/contest.ejs | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/views/contest.ejs b/views/contest.ejs
index 8f06bb7..55f9815 100644
--- a/views/contest.ejs
+++ b/views/contest.ejs
@@ -8,22 +8,19 @@
<% 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 (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];
} %>
-
- <%= start %>
-
-
- <%= end %>
-
+
<%= 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)) { %>
+ <% if (unveiled) { %>
+ <% } %>
From 9c635ee1b30b4057f7892e8611229f9d3bd3cf1b Mon Sep 17 00:00:00 2001
From: Menci
Date: Tue, 7 Mar 2017 17:23:58 +0800
Subject: [PATCH 4/4] Update Hitokoto API argument
---
utility.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
});