Skip to content

Commit 6285f15

Browse files
committed
Added leaderboard page
1 parent 461d3ff commit 6285f15

File tree

2 files changed

+168
-0
lines changed

2 files changed

+168
-0
lines changed

leaderboard.html

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Leaderboard | NJACK Winter of Code</title>
7+
8+
<meta name="description" content="NWoC is a program that helps students understand the paradigm of Open Source contribution and gives them real world software development experience." />
9+
<meta NAME="Keywords" CONTENT="Njack,winter,code,nwoc,iit,iitp,patna,indian institute of technology">
10+
<!-- Schema.org markup for Google+ -->
11+
<meta itemprop="name" content="NJACK Winter of Code">
12+
<meta itemprop="description" content="NWoC is a program that helps students understand the paradigm of Open Source contribution and gives them real world software development experience.">
13+
<meta itemprop="image" content="https://njackwinterofcode.github.io/nwocLogo.jpg">
14+
15+
<!-- Twitter Card data -->
16+
<meta name="twitter:card" content="summary_large_image">
17+
<meta name="twitter:site" content="@njackiitp">
18+
<meta name="twitter:title" content="NJACK Winter of Code">
19+
<meta name="twitter:description" content="NWoC is a program that helps students understand the paradigm of Open Source contribution and gives them real world software development experience.">
20+
<meta name="twitter:creator" content="@njackiitp">
21+
<!-- Twitter summary card with large image must be at least 280x150px -->
22+
<meta name="twitter:image:src" content="https://njackwinterofcode.github.io/nwocLogo.jpg">
23+
24+
<!-- Open Graph data -->
25+
<meta property="og:title" content="NJACK Winter of Code" />
26+
<meta property="og:type" content="article" />
27+
<meta property="og:url" content="https://njackwinterofcode.github.io/" />
28+
<meta property="og:image" content="https://njackwinterofcode.github.io/nwocLogo.jpg" />
29+
<meta property="og:description" content="NWoC is a program that helps students understand the paradigm of Open Source contribution and gives them real world software development experience." />
30+
<meta property="og:site_name" content="NWoC" />
31+
<meta property="article:published_time" content="2018-10-11T05:59:00+01:00" />
32+
<meta property="article:modified_time" content="2018-10-12T19:08:47+01:00" />
33+
<meta property="article:section" content="NJACK Winter of Code is an initiative by Open Source Department of NJACK, IIT Patna for the students, who have never participated in Free or Open Source Software (FOSS) development before, to get them involved during the winter vacations and break the ice of Open Source contributions." />
34+
<meta property="article:tag" content="NWoC" />
35+
36+
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
37+
<link rel="canonical" href="https://njackwinterofcode.github.io/codeofconduct.html"/>
38+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons|Roboto">
39+
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.blue-indigo.min.css" />
40+
<link rel="stylesheet" href="style.css" />
41+
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
42+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
43+
44+
<script type="text/javascript">
45+
$(document).ready(function() {
46+
$('.nwoc-drawer-item').click(function() {
47+
$( '.mdl-layout__drawer, .mdl-layout__obfuscator' ).removeClass( 'is-visible' );
48+
});
49+
});
50+
</script>
51+
</head>
52+
<body>
53+
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-layout--no-desktop-drawer-button">
54+
<header class="mdl-layout__header mdl-layout__header--scroll nwoc-header">
55+
<div class="mdl-layout__header-row">
56+
<a href="/" style="text-decoration:none;">
57+
<span class="mdl-layout-title nwoc-menu-title">
58+
<span class="nwoc-menu-njack">NJACK</span> Winter of Code
59+
</span>
60+
</a>
61+
<div class="mdl-layout-spacer"></div>
62+
<nav class="mdl-navigation mdl-layout--large-screen-only">
63+
<a class="mdl-navigation__link nwoc-menu-item" href="/#how-it-works">How it works</a>
64+
<a class="mdl-navigation__link nwoc-menu-item" href="/#timeline">Timeline</a>
65+
<a class="mdl-navigation__link nwoc-menu-item" href="/projects.html">Projects</a>
66+
<a class="mdl-navigation__link nwoc-menu-item" href="/#register">Register</a>
67+
<a class="mdl-navigation__link nwoc-menu-item" href="/contact.html">Contact</a>
68+
</nav>
69+
</div>
70+
</header>
71+
72+
<div class="mdl-layout__drawer nwoc-drawer">
73+
<div class="nwoc-close-button-div">
74+
<button class="mdl-button mdl-js-button nwoc-close-button nwoc-drawer-item">
75+
<i class="material-icons">close</i>
76+
</button>
77+
</div>
78+
<nav class="mdl-navigation">
79+
<a class="mdl-navigation__link nwoc-drawer-item" href="/#how-it-works">How it works</a>
80+
<a class="mdl-navigation__link nwoc-drawer-item" href="/#timeline">Timeline</a>
81+
<a class="mdl-navigation__link nwoc-drawer-item" href="/projects.html">Projects</a>
82+
<a class="mdl-navigation__link nwoc-menu-item" href="/#register">Register</a>
83+
<a class="mdl-navigation__link nwoc-drawer-item" href="/contact.html">Contact</a>
84+
</nav>
85+
</div>
86+
87+
<main class="mdl-layout__content">
88+
<div class="nwoc-content" style="min-height:calc(100vh - 235px);">
89+
<h3>Leaderboard</h3>
90+
<div id="leader-div" style='overflow-x:auto'>
91+
<p>Leaderboard loading...</p>
92+
</div>
93+
<script type="text/javascript">
94+
$.ajax({
95+
url: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRis-_Sey_IwrnrvEqZBDLnYRHyMn5l4RAhtwKxIGo411LmtF94BkhPmVl6bG-jplBi6dx5c91x50wf/pub?gid=346190118&single=true&output=csv',
96+
dataType: 'text',
97+
success: maketable,
98+
error: function() {$('#leader-div').html('<p>Leaderboard could not be fetched.</p>');}
99+
});
100+
101+
function maketable(data) {
102+
var rows = data.split(/\r?\n|\r/);
103+
if (rows.length <= 1) {
104+
$('#leader-div').html('<p>Data could not be parsed.</p>');
105+
return;
106+
}
107+
var table = '<table class=\'leaderboard\'><thead><th>Position</th><th class=\'handle\'>GitHub Handle</th><th>Score</th></thead><tbody>';
108+
var pos = 0, currScore = -1;
109+
110+
for(var i = 0; i<(rows.length<=25?rows.length:25); i++) {
111+
var cells = rows[i].split(',');
112+
if (cells.length != 2) {
113+
$('#leader-div').html('<p>Data could not be parsed.</p>');
114+
return;
115+
}
116+
117+
if (cells[1] != currScore) {
118+
pos = i+1;
119+
}
120+
121+
currScore = cells[1];
122+
123+
if (currScore <= 1) {
124+
break;
125+
}
126+
127+
table += '<tr>';
128+
table += '<td>'+pos+'</td>';
129+
table += '<td class=\'handle\'><a href=\'https://github.com/'+cells[0]+'\'>'+cells[0]+'</a></td>';
130+
table += '<td>'+cells[1]+'</td>';
131+
table += '</tr>';
132+
}
133+
134+
table += '</tbody>';
135+
table += '</table>';
136+
table += '</div>';
137+
$('#leader-div').html(table);
138+
}
139+
</script>
140+
</div>
141+
142+
<footer class="mdl-mini-footer">
143+
<div class="nwoc-footer">
144+
<div class="mdl-mini-footer__left-section">
145+
<div class="mdl-logo">© NJACK 2018</div>
146+
<ul class="mdl-mini-footer__link-list">
147+
<li><a href="mailto:[email protected]?subject=[NWOC]" target="_blank">Email</a></li>
148+
<li><a href="https://www.facebook.com/njack.iitp/" target="_blank">Facebook</a></li>
149+
<li><a href="https://twitter.com/njackiitp" target="_blank">Twitter</a></li>
150+
<li><a href="https://github.com/Njack-IITP/" target="_blank">GitHub</a></li>
151+
</ul>
152+
</div>
153+
</div>
154+
</footer>
155+
156+
</main>
157+
</div>
158+
</body>
159+
</html>

style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,12 @@ a {
327327
padding: 1px 30px;
328328
}
329329
}
330+
331+
.leaderboard .handle {
332+
text-align: left;
333+
padding: 0 30px;
334+
}
335+
336+
.leaderboard td,th {
337+
text-align: center;
338+
}

0 commit comments

Comments
 (0)