-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
406 lines (352 loc) · 14.2 KB
/
index.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<html>
<head>
<meta charset="UTF-8">
<title>Linux Install Fest</title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.0.0/mapbox.js'></script>
<script src='https://code.jquery.com/jquery-1.11.1.min.js'></script>
<script type="text/javascript" src='tabletop.js/tabletop.js'></script>
<script type="text/javascript" src='http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.2/handlebars.min.js'></script>
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js'></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.0/mapbox.css' rel='stylesheet' />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,600|Merriweather:400,700' rel='stylesheet' />
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="lifContent" class="container"></div>
<script id="lifTemplate" type="text/x-handlebars-template">
<!-- Header START -->
<h1 class="header row">
{{# if logo}}
<img id="editionLogo" src={{logo}} />
{{else}}
<img id="editionLogo" src="res/2013.png" />
{{/if}}
Ediția {{ year }}
<a id="logo" href="http://rosedu.org"><img src="res/rosedu_logo.png" /></a>
</h1>
<!-- Header END -->
<!-- NavBar START -->
<nav class="header row">
<a href="?year=2017">2017</a>
<a href="?year=2016">2016</a>
<a href="?year=2015">2015</a>
<a href="?year=2014">2014</a>
<a href="?year=2013">2013</a>
<a href="?year=2012">2012</a>
<a href="?year=2011">2011</a>
</nav>
<!-- NavBar END -->
<div class="content row">
{{# if participants}}
<div class="row">
<h2 class="content"> <b class="largeText">{{ participants }}</b> participants </h2>
</div>
{{/if}}
{{#if participants}}
<div class="col-sm-9">
<div class="col-sm-5">
<h2> Distributions </h2>
<canvas id="distributions" height="400"></canvas>
</div>
{{# if facultyData}}
<div class="col-sm-5">
<h2> Faculty </h2>
<canvas id="faculty" height="400"></canvas>
</div>
{{/if}}
<div class="col-sm-12">
<h2> Helpers </h2>
<canvas id="helpers" height="400"></canvas>
</div>
<div class="col-sm-12">
<h2> Participants <h2>
<input id="participantsFilter" type="text" placeholder="Search.."></input>
<div id="participants"></div>
</div>
</div>
<div id="partners" class="col-sm-3">
<h2>Partners</h2>
{{#each partners}}
<a href={{this.url}}> <img class={{this.type}} src={{this.src}} /> </a>
{{/each}}
<iframe src="http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Frosedu.org&width=200&height=290&colorscheme=light&show_faces=true&header=true&stream=false&show_border=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:290px;" allowTransparency="true"></iframe>
</div>
{{else}}
<div class="description col-sm-9">
<strong>ROSEdu</strong> pregătește cea de a 12-a ediție a
<a href="https://www.facebook.com/events/700233610181801/"><strong>Linux Install Fest</strong></a>.
<div>
Ai posibilitatea, alături de noi, să îți instalezi orice distribuție Linux pe laptopul sau computerul tău.
Vom fi alături de tine pentru a rezolva problemele legate de drivere, partiționare sau migrarea datelor între sisteme de operare diferite.
</div>
<div>
<strong>Linux Install Fest</strong> își propune să aducă împreună timp de câteva ore oameni pasionați din diverse comunități Linux.
</div>
<div class="note">
*Dacă ai un sistem desktop îți poți aduce doar unitatea. Noi vom pune la dispoziție monitoare, tastaturi și mouse-uri.
</div>
<div>
<strong>Când</strong>
</div>
<div class="time">
Sâmbătă, <strong> 7 Octombrie </strong> - Între <strong> 10:00 și 16:00 </strong>.
</div>
<div class="date">
</div>
<div>
<strong>Unde</strong>
<div>
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2848.874500050395!2d26.04556341503424!3d44.43573650949483!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x40b201ebafcdf7a3%3A0xeafb513bd76c5277!2sFacultatea+de+Automatic%C4%83+%C8%99i+Calculatoare!5e0!3m2!1sen!2sro!4v1476197569903" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>
</div>
<div id="partners" class="col-sm-3">
<h2>Partners</h2>
{{#each partners}}
<a href={{this.url}}> <img class={{this.type}} src={{this.src}} /> </a>
{{/each}}
<iframe src="http://www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Frosedu.org&width=200&height=290&colorscheme=light&show_faces=true&header=true&stream=false&show_border=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:200px; height:290px;" allowTransparency="true"></iframe>
</div>
{{/if}}
</div>
<footer>
This website is open sourced on GitHub. <a href="https://github.com/rosedu/lif" title="GitHub Repository">Feel free to contribute</a>
</footer>
</script>
<script id="participantsTemplate" type="text/x-handlebars-template">
<table class="table table-boxed table-hover">
<tr><th class="tHeader">Name</th><th class="tHeader">Distribution</th><th class="tHeader">Helper</th></tr>
<tbody>
{{#each rows}}
<tr><td>{{this.name}}</td><td>{{this.distribution}}</td><td>{{this.helper}}</td></tr>
{{/each}}
</tbody>
</table>
</div>
</script>
<script type="text/javascript">
// Get URL from request
var sheet_urls = {
2017: "1dUeXNEpgDvS5itv5ZrE9CmKSdF4_et4W1IggUFnT7CE",
2016: "19VmXZipGCQv2QCcKVi-JfyRtBWvRUK-jIRFnSNKV9dw",
2015: "1RA8VPzhFoJyVDF9TCV-mtH8Ocq98Wmo05CQICapL9e4",
2014: "1jvi-V3dKKF_YYEOsR0T8V_9SBskRacyB-1GjKzYNHGA",
2013: "0AnGjdmqOroGfdFRJQjhsMUI2cnR2VjhqVVZSaV93d2c",
2012: "0AnGjdmqOroGfdHdQYzZBejVzVHlQemM0cGMyZDNIRmc",
2011: "0AnGjdmqOroGfdGw0WGozLUZVQXRvWGJ5QjNGWW5OaEE"
}
var logos = {
2017: "res/2013.png",
2016: "res/2013.png",
2015: "res/2013.png",
2014: "res/2013.png",
2013: "res/2013.png",
2012: "res/2012.png",
}
var partners = {
2017: [
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"},
{ url: "http://www.ixiacom.com", src: "res/ixia.png", type: "sponsor"}
],
2016: [
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"},
{ url: "http://www.ixiacom.com", src: "res/ixia.png", type: "sponsor"}
],
2015: [
{ url: "http://www.eaudeweb.ro/", src: "res/edw.png", type: "sponsor"},
{ url: "http://www.ixiacom.com", src: "res/ixia.png", type: "sponsor"},
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"}
],
2014: [
{ url: "http://www.ixiacom.com", src: "res/ixia.png", type: "sponsor"},
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"}
],
2013: [
{ url: "http://www.ixiacom.com", src: "res/ixia.png", type: "sponsor"},
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"},
{ url: "http://ubuntu.ro", src: "res/ubunturo.png", type: "support"},
{ url: "http://www.archlinux.ro", src: "res/arch.png", type: "support"},
{ url: "http://www.suseromania.ro", src: "res/opensuse.png", type: "support"}
],
2012: [
{ url: "http://www.crisoft.ro", src: "res/crisoft.png", type: "sponsor" },
{ url: "http://www.anis.ro", src: "res/anis.png", type: "sponsor"},
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"},
{ url: "http://ubuntu.ro", src: "res/ubunturo.png", type: "support"},
{ url: "http://www.fedoraproject.ro", src: "res/fedora.png", type: "support"},
{ url: "http://www.suseromania.ro", src: "res/opensuse.png", type: "support"}
],
2011: [
{ url: "http://acs.pub.ro", src: "res/cs.png", type: "sponsor"},
{ url: "http://ubuntu.ro", src: "res/ubunturo.png", type: "support"},
]
}
var query = window.location.search.substring(1);
var vars = query.split('&');
YEAR = 2017
URL = sheet_urls[YEAR]
PARTNERS = partners[YEAR]
LOGO = 0
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) == "year") {
YEAR = parseInt(pair[1]);
URL = sheet_urls[YEAR]
PARTNERS = partners[YEAR]
LOGO = logos[YEAR]
}
}
</script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
Tabletop.init({key: URL,
callback: showInfo,
simpleSheet: true});
setInterval(
function() { Tabletop.init({key: URL,
callback: showInfo,
simpleSheet: true }); },
100000);
});
function getCounts(data, field, sort) {
occ = {};
for (var i = 0; i < data.length; i++) {
key = data[i][field];
if(key === undefined) // if the field does not exist in the data set
return false;
count = occ[key];
occ[key] = count ? count + 1 : 1;
}
occ_arr = [];
for (key in occ) {
occ_arr.push({'label': key, 'value': occ[key]});
}
if (sort)
occ_arr.sort(function(a, b) { return b.value - a.value; });
res = {'values': [],
'labels': []};
for (var i = 0; i < occ_arr.length; i++) {
obj = occ_arr[i];
key = obj.label;
count = obj.value;
res.labels.push(obj.label ? key + ' - ' + count : 'Not Set - ' + count);
res.values.push(count);
}
return res;
}
function showParticipants(data, filter_key) {
var shown_data = data;
if (filter_key) {
shown_data = [];
for (var i = 0; i < data.length; i++) {
obj = data[i];
if (data[i].name.toLowerCase().indexOf(filter_key.toLowerCase()) > -1)
shown_data.push(obj);
}
}
var participants_src = $("#participantsTemplate").html();
var participants_template = Handlebars.compile(participants_src);
var part_context = {rows: shown_data};
var part_html = participants_template(part_context);
$("#participants").html(part_html);
}
function showInfo(data) {
var gData = data;
var facultyData = getCounts(gData, 'faculty', false); // fetch faculty chart data before rendering template because ar rendering it needs to know weather this data is available
var source = $("#lifTemplate").html();
var template = Handlebars.compile(source);
var context = {
year: YEAR,
participants: gData.length,
partners: PARTNERS,
logo: LOGO,
facultyData: facultyData != false, // tells the template weather to show or not the faculty char section
};
var html = template(context);
// Perform the main layout
$("#lifContent").html(html);
var ColorPool = {
idx: 0,
pool: [
{
color:"#F7464A",
highlight: "#FF5A5E",
},
{
color: "#46BFBD",
highlight: "#5AD3D1",
},
{
color: "#FDB45C",
highlight: "#FFC870",
},
],
next: function(){
if(this.idx >= this.pool.length){
this.idx = 1;
return 0;
}
else
return this.idx++;
},
giveMeColors: function(){
return this.pool[this.next()];
},
}
var FoarmatData = {
Bars: function(data){
return {
labels: data.labels.map(function(elem){return elem.split("-")[0];}),
datasets: [{
label: 'People Helped',
fillColor: "rgba(151,187,205,0.5)",
strokeColor: "rgba(151,187,205,0.8)",
highlightFill: "rgba(151,187,205,0.75)",
highlightStroke: "rgba(151,187,205,1)",
data: data.values,
}],
};
},
Pie: function(data){
var formated_data = [];
data.labels.forEach(function(label, idx){
var colors = ColorPool.giveMeColors();
formated_data.push({
label: label.split('-')[0],
value: data.values[idx],
color: colors.color,
highlight: colors.highlight,
})
});
return formated_data;
}
};
//document.getElementById('js-legend').innerHTML = myNewChart.generateLegend();
var pieData = getCounts(gData, 'distribution', false);
var distributionsData = FoarmatData.Pie(pieData);
var ctx = document.getElementById("distributions").getContext("2d");
new Chart(ctx).Pie(distributionsData);
if( facultyData ){
var facultyData = FoarmatData.Pie(facultyData);
var ctx = document.getElementById("faculty").getContext("2d");
new Chart(ctx).Pie(facultyData)
}
var hbarData = getCounts(gData, 'helper', true);
var helpersData = FoarmatData.Bars(hbarData);
var ctx = document.getElementById("helpers").getContext("2d");
new Chart(ctx).Bar(helpersData, {
barValueSpacing : 1,
barDatasetSpacing : 1,
barShowStroke : false,
});
showParticipants(gData, "");
$('#participantsFilter').on('input', function() {
text = $(this).val();
showParticipants(gData, text);
});
}
</script>
</body>
</html>