-
Notifications
You must be signed in to change notification settings - Fork 10
/
events.html
151 lines (126 loc) · 4.25 KB
/
events.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
---
layout: default
title: Events
stylesheet: events.css
permalink: /events/
ogImage: Events-Banner.jpg
---
{% include pageHeader.html
img="Events-Banner.jpg"
header="Events"
text="Learn about the webinars and other events we have coming up. Contact us about teaching a blockchain workshop for your organization."
%}
<script>
setTimeout(checkEventType, 1000);
setTimeout(setEventClickListener, 1000);
function setEventClickListener() {
var eventsButtons = document.getElementsByClassName('eventsNav')
for (button of eventsButtons) {
button.addEventListener('click', function () {
clearEventFilters()
checkEventType()
})
}
}
function checkEventType() {
var currentUrlParts = window.location.href.split('/');
var searchString = "";
// first, remove slashes and header elements
for (var x = 4; x < currentUrlParts.length; x++) {
searchString += " " + decodeURIComponent(currentUrlParts[x])
}
searchString.replace(/[^a-zA-Z ]/g, "")
if ("#Community" == searchString.trim()) {
filterEvents('Community')
} else if ("#Classroom" == searchString.trim()) {
filterEvents('Classroom')
} else {
// no events filter specified
}
}
function filterEvents(type) {
var events = document.getElementsByClassName('eventTile')
for (e of events) {
if (e.className.includes(type)) {
} else {
e.className = e.className + " d-none"
}
}
setFilterMessage(type)
}
function clearEventFilters() {
var eventTiles = document.getElementsByClassName('eventTile')
for (e of eventTiles) {
e.className = e.className.split('d-none').join(' ')
}
unsetFilterMessage()
}
function setFilterMessage(type) {
document.getElementsByClassName('eventFilterNotification')[0].className = document.getElementsByClassName('eventFilterNotification')[0].className.replace('d-none', '')
document.getElementsByClassName('eventFilter')[0].textContent = type
}
function unsetFilterMessage() {
if (!document.getElementsByClassName('eventFilterNotification')[0].className.includes('d-none')) {
document.getElementsByClassName('eventFilterNotification')[0].className = document.getElementsByClassName('eventFilterNotification')[0].className + ' d-none'
document.getElementsByClassName('eventFilter')[0].textContent = ""
}
}
</script>
<section class="header">
<p>Blockchain Institute is a proud sponsor of educational endeavors such as <a class="externaLink"
href="https://www.meetup.com/Bitcoin-Open-Blockchain-Community-Chicago/" target="_blank" rel="noopener"
data-ce-key="816">The Chicago Bitcoin and Open Blockchain Meetup</a>, <a class="externaLink"
href="http://chicagoblockchainproject.com/voice-of-blockchain/" target="_blank" rel="noopener"
data-ce-key="817">The Voice of Blockchain Conference</a>, and online resources like Blockchain.wtf.
Get in touch with us about sponsorships, speakers, or running a
workshop for your next event. In need of space? Our headquarters at the <a class="externaLink"
href="https://hackha.us/" target="_blank" rel="noopener">HackHaus</a> in Chicago provides an
environment for a wide range of activities.</p>
<a onclick="clearEventFilters()">
<span class="eventFilterNotification d-none">
Filter Applied: <strong class="eventFilter"></strong> (click to clear)
</span>
</a>
</section>
{% assign sorted = site.events | sort: 'date' | reverse %}
{% assign futureposts = 0 %}
{% for event in sorted %}
{% if event.date > site.time %}
{% assign futureposts = futureposts | plus:1 %}
{% endif %}
{% endfor %}
{% if futureposts > 0 %}
<section class="eventsList upcoming">
<h1>Upcoming Events</h1>
<div class="row">
{% for event in sorted %}
{% if event.date > site.time %}
{% include eventTile.html
link=event.permalink
image=event.image
title=event.title
date=event.eventdate
type=event.eventType
%}
{% endif %}
{% endfor %}
</div>
</section>
{% endif %}
<section class="eventsList past">
<h1>Past Events</h1>
<div class="row">
{% for event in sorted %}
{% if event.date < site.time %}
{% include eventTile.html
link=event.permalink
image=event.image
title=event.title
date=event.eventdate
type=event.eventType
%}
{% endif %}
{% endfor %}
</div>
</section>
{% include getInvolved.html %}