forked from coderetreat/coderetreat.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
73 lines (65 loc) · 2.41 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
---
layout: default
title: Global Day of Coderetreat Events
description: List of events around the world!
---
<div id="map">
<div id="popup"></div>
</div>
<a href="/register-event/"><i class="fa fa-info-circle"></i> Register your event</a>
<h2>GDCR events in 2019</h2>
{% assign events_with_location = site.data.events_gdcr2019 | where_exp: 'event', 'event.location != "virtual"' %}
{% assign virtual_events = site.data.events_gdcr2019 | where_exp: 'event', 'event.location == "virtual"' %}
{% assign countries = events_with_location | map: 'location' | map: 'country' | uniq | sort %}
<form class="pure-form">
<fieldset>
<select id="gdcrCountry" style="font-family: sans-serif;">
<option selected disabled>Select your country...</option>
<option value="none">Show All</option>
<option disabled>-------------</option>
<option value="virtual">Virtual Events</option>
{% for country in countries %}
<option>{{ country }}</option>
{% endfor %}
</select>
</fieldset>
</form>
<table class="events-by-country">
<tbody>
{% for event in virtual_events %}
<tr data-country="virtual">
<td>Virtual</td>
{% include event-table-row.html event=event %}
</tr>
{% endfor %}
{% assign events = events_with_location | where_exp: 'name', '1' | sort: 'location.city' | sort: 'location.country' %}
{% for event in events %}
<tr data-country="{{event.location.country}}">
<td>{{ event.location.city }}, {{ event.location.country }}</td>
{% include event-table-row.html event=event %}
</tr>
{% endfor %}
</tbody>
</table>
<p class="last-section">
<a href="{% link register-event.md %}">Register your event</a>
</p>
<script>
$(function () {
$.get('/events/gdcr2019.json', function (eventsJson) {
var gdcrEvents = mapEventsDataToMapFormat(eventsJson);
addEventsToMap(gdcrEvents);
});
$('#gdcrCountry').on('change', function (e) {
var filter = e.target.value;
var rows = $('tbody tr');
var isDisabled = filter === 'none';
for (var i = 0; i < rows.length; i++) {
row = rows[i];
ctry = row.getAttribute("data-country");
row.classList.toggle('hidden', !(isDisabled || ctry === filter))
}
;
});
});
</script>