-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html.erb
73 lines (66 loc) · 1.8 KB
/
index.html.erb
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
<html>
<head>
<style>
* {
font-family: Lato;
font-size: 14px;
}
body {
background-color: #16171b;
color: rgba(255, 255, 255);
}
a { color: #c0c0c0; text-decoration: none; }
a:hover { color: #6795de; }
td.solved, td.unsolved { text-align: center; }
section, footer {
background-color: #27272a;
max-width: 600px;
margin: 0 auto;
padding: 10px;
}
footer {
margin-top: 20px;
}
</style>
</head>
<body>
<section>
<h1>DevPT codewars leaderboard</h1>
<table>
<thead>
<tr>
<td></td>
<td></td>
<% challenges.each do |challenge| %>
<% if challenge.kata %>
<td><a href="https://codewars.com/kata/<%= challenge.kata %>"><%= challenge.year %>w<%= challenge.week %></a></td>
<% else %>
<td><%= challenge.year %>w<%= challenge.week %></td>
<% end %>
<% end %>
</tr>
</thead>
<tbody>
<% users.each do |user| %>
<tr>
<td><a href="https://codewars.com/users/<%= user.username %>"><%= user.username %></a></td>
<td><%= user.score(challenges) %></td>
<% user.points(challenges).each do |points| %>
<% if points == 3 %>
<td class='solved'>✔✔</td>
<% elsif points == 1 %>
<td class='solved'>✓</td>
<% elsif points.nil? %>
<td class='unsolved'>-</td>
<% end %>
<% end %>
</tr>
<% end %>
</tbody>
</table>
</section>
<footer>
<p><a href="https://github.com/hugopeixoto/devpt-codewars">Software licensed under AGPL-3.0-only</a>
</footer>
</body>
</html>