-
Notifications
You must be signed in to change notification settings - Fork 26
/
template.ejs
135 lines (130 loc) · 10.3 KB
/
template.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="img/png" href="assets/images/favicon.png" />
<title>cp-itb/contests</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha256-m/h/cUDAhf6/iBRixTbuc8+Rg2cIETQtPcH9D3p2Kg0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" integrity="sha256-Zd1icfZ72UBmsId/mUcagrmN7IN5Qkrvh75ICHIQVTk=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.8.0/github-markdown.min.css" integrity="sha256-Lt9340Td+22fUGyXnrvSDEy9lnZunEDDyYyQ3QOGgeg=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.8.3/katex.min.css" integrity="sha384-B41nY7vEWuDrE9Mr+J2nBL0Liu+nl/rBXTdpQal730oTHdlrlXHzYMOhDU60cwde" crossorigin="anonymous">
<!-- Custom styles for this template -->
<link href="assets/css/style.css" rel="stylesheet">
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="#">cp-itb/contests</a>
</nav>
<div class="container-fluid">
<div class="row">
<nav class="col-8 col-sm-3 bg-light sidebar">
<ul class="nav nav-pills flex-column">
<% contests.forEach((contest) => { %>
<% if (contest.onlyround) { %>
<li class="nav-item nav-pills">
<a class="nav-link contest-tab" data-toggle="pill" href="#<%= contest.code %>">
<b><%= contest.name %> <%= contest.year %></b>
</a>
</li>
<% } else { %>
<li class="nav-item nav-pills">
<a class="nav-link contest-tab" href="#">
<b><%= contest.name %> <%= contest.year %></b>
</a>
<% contest.rounds.forEach((round) => { %>
<a class="nav-link contest-tab" data-toggle="pill" href="#<%= round.code %>">
<%= round.humanizedName %>
</a>
<% }) %>
</li>
<% } %>
<li class="divider"></li>
<% }) %>
</ul>
</nav>
<main class="ml-auto col-4 col-sm-9 pt-3" role="main">
<div class="mb-3">
<button class="btn btn-outline-primary active" id="sidebarToggleButton">Menu</button>
</div>
<div class="tab-content">
<% contests.forEach((contest) => { %>
<% contest.rounds.forEach((round) => { %>
<div class="tab-pane fade" id="<%= round.code %>">
<h5><%= round.humanizedFullName %></h5>
<nav class="nav nav-tabs">
<a class="nav-item nav-link" data-toggle="tab" href="#<%= round.code %>-overview">Overview</a>
<% round.problems.forEach((problem) => { %>
<a class="nav-item nav-link problem-tab" data-toggle="tab" href="#<%= round.code %>-<%= problem.code %>" id="<%= round.code %>-<%= problem.code %>-tab"><%= problem.code %></a>
<% }) %>
</nav>
<div class="tab-content">
<div class="tab-pane fade" id="<%= round.code %>-overview">
<ul>
<% round.problems.forEach((problem) => { %>
<li><a href="#<%= round.code %>-<%= problem.code %>-tab" class="problem-link">Problem <%= problem.code %> <%= problem.name ? '- ' + problem.name : '' %></a></li>
<% }) %>
</ul>
</div>
<% round.problems.forEach((problem) => { %>
<div class="tab-pane fade" id="<%= round.code %>-<%= problem.code %>">
<div class="row">
<div class="col-sm-3 col-md-2">
<div class="list-group" id="list-tab" role="tablist">
<a class="list-group-item list-group-item-action ajaxfileloader" data-toggle="list" href="#<%= round.code %>-<%= problem.code %>-problem"><b>Problem</b></a>
<% if (problem.editorial) { %>
<a class="list-group-item list-group-item-action ajaxfileloader" data-toggle="list" href="#<%= round.code %>-<%= problem.code %>-editorial"><b>Editorial</b></a>
<% } %>
<button class="list-group-item list-group-item-action"><b>Solutions</b></button>
<% problem.solutions.forEach((solution) => { %>
<a class="list-group-item list-group-item-action ajaxfileloader" id="list-messages-list" data-toggle="list" href="#<%= round.code %>-<%= problem.code %>-solution-<%= solution.escapedAuthor %>"><%= solution.author %></a>
<% }) %>
</div>
</div>
<div class="col-sm-9 col-md-10">
<div class="tab-content">
<% if (problem.statement) { %>
<div class="tab-pane fade show active" id="<%= round.code %>-<%= problem.code %>-problem" data-filesource="<%= problem.statement %>" data-fileloaded="false">
Loading...</div>
<% } else { %>
<div class="tab-pane fade show active" id="<%= round.code %>-<%= problem.code %>-problem">
No problem statement found. Try to find it <a href="https://www.google.com/?q=<%= encodeURIComponent(round.humanizedFullName) %>+Problem+<%= problem.code %>" target="_blank">here</a></div>
<% } %>
<% if (problem.editorial) { %>
<div class="tab-pane fade show active" id="<%= round.code %>-<%= problem.code %>-editorial" data-filesource="<%= problem.editorial %>" data-fileloaded="false">
Loading...</div>
<% } %>
<% problem.solutions.forEach((solution) => { %>
<div class="tab-pane fade" id="<%= round.code %>-<%= problem.code %>-solution-<%= solution.escapedAuthor %>" data-filesource="<%= solution.path %>">Loading...</div>
<% }) %>
</div>
</div>
</div>
</div>
<% }) %>
</div>
</div>
<% }) %>
<% }) %>
</div>
</main>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="assets/js/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha256-DiWJXXyq81WlPRnDfGmgYZj2aOVCKyEdJ1l+2TmDuAs=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js" integrity="sha256-/BfiIkHlHoVihZdc6TFuj7MmJ0TWcWsMXkeDFwhi0zw=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.7.4/showdown.min.js" integrity="sha256-ABe6QqWGbNFZSCvuF6dKVgf0yWKGwtvcm5mbPBQdZH0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.8.3/katex.min.js" integrity="sha384-L9gv4ooDLrYwW0QCM6zY3EKSSPrsuUncpx26+erN0pJX4wv1B1FzVW1SvpcJPx/8" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.8.3/contrib/auto-render.min.js" integrity="sha384-RkgGHBDdR8eyBOoWeZ/vpGg1cOvSAJRflCUDACusAAIVwkwPrOUYykglPeqWakZu" crossorigin="anonymous"></script>
<script src="assets/js/script.js"></script>
</body>
</html>