This repository has been archived by the owner on Oct 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublications.html
323 lines (307 loc) · 9.87 KB
/
publications.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
---
layout: internal
title: Publications
---
<!-- Page Header Section -->
<div class="container-fluid d-lg-block d-none background-indigo-500">
<div class="container py-5">
<h3 class="text-white">Publications</h3>
</div>
</div>
<div class="container-fluid d-lg-block d-none py-2 background-indigo-100"></div>
<div class="container-fluid d-lg-none d-block background-indigo-100">
<div class="container py-4">
<h3 class="color-indigo-900">Publications</h3>
</div>
</div>
<!-- Publications List Section -->
<div class="container-fluid">
<div class="container py-3">
<div class="row justify-content-between py-2">
<div class="col-12 col-lg-6 col-md-6 py-2">
<div id="publication-filter">
<div class="dropdown">
<button
class="nav-link dropdown-toggle color-indigo-900"
id="categoryDropdown"
role="button"
data-toggle="dropdown"
data-hover="dropdown"
>
All Categories
</button>
<div class="dropdown-menu" aria-labelledby="categoryDropdown">
{% for publication in site.publications %}
{% assign type = publication.type | split: ", " %}
{% assign types = types | concat: type %}
{% endfor %}
<button
class="dropdown-item button-filter categorized mr-3 mb-2 mb-sm-1"
onclick="changeType('all_types')"
>
All
</button>
{% if types contains 'publication' %}
<button
class="dropdown-item button-filter mr-3 mb-2 mb-sm-1"
onclick="changeType('publication')"
>
Publication
</button>
{% endif %}
{% if types contains 'book' %}
<button
class="dropdown-item button-filter mr-3 mb-2 mb-sm-1"
onclick="changeType('book')"
>
Book
</button>
{% endif %}
{% if types contains 'conference_item' %}
<button
class="dropdown-item button-filter mr-3 mb-2 mb-sm-1"
onclick="changeType('conference_item')"
>
Conference
</button>
{% endif %}
{% if types contains 'article' %}
<button
class="dropdown-item button-filter mr-3 mb-2 mb-sm-1"
onclick="changeType('article')"
>
Article
</button>
{% endif %}
{% if types contains 'thesis' %}
<button
class="dropdown-item button-filter mr-3 mb-0"
onclick="changeType('thesis')"
>
Thesis
</button>
{% endif %}
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 col-md-6 py-2 d-flex justify-content-lg-end">
<div>
<div id="date-filter">
<button
class="button-filter mr-3 mb-2 mb-sm-1 mb-0"
onclick="order_asc()"
>
Latest
</button>
</div>
<div id="alphabet-filter">
<button
class="button-filter mr-3 mb-2 mb-sm-1 mb-0"
onclick="order_alph()"
>
Alphabetical
</button>
</div>
<div id="year-filter">
<div class="dropdown">
<button
class="nav-link dropdown-toggle color-indigo-900"
id="yearDropdown"
role="button"
data-toggle="dropdown"
data-hover="dropdown"
>
By year
</button>
<div class="dropdown-menu" aria-labelledby="yearDropdown">
<button
class="dropdown-item button-filter filtered"
onclick="changeYear('year-all')"
>
All
</button>
{% assign years = "2020" | split: ", " %}
{% for publication in site.publications %}
{% assign year = publication.date | date: "%Y" | split: ", " %}
{% assign years = years | concat: year %}
{% endfor %}
{% assign years = years | uniq | sort %}
{% for year in years %}
<button
class="dropdown-item button-filter"
onclick="changeYear('year-{{ year }}')"
>
{{ year }}
</button>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
<div id="publications-container" class="row py-2">
{% assign publications = site.publications | sort: 'date' | reverse %}
{% for publication in publications %}
<div
class="col-lg-6 col-sm-12 article my-2 publications year-all all_types {{ publication.type }} year-{{ publication.date | date: '%Y' }}"
data-event-date="{{ publication.date }}"
>
<div
class="publication-card h-100 flex-column"
>
<p class="date mb-1">
<i class="far fa-clock mr-1"></i>
{{ publication.date | date: "%B %Y" }}
</p>
<a href="{{ publication.link }}" target="_blank" rel="noopener">
<h3 class="title">{{ publication.name }}</h3>
</a>
<details class="abstract">
<summary>
<strong>Abstract</strong>
</summary>
<div class="mt-1">{{ publication.abstract }}</div>
</details>
<p class="mb-0 collaborators">
{% for collaborator in publication.collaborators %}
<span class="collaborator">
{{ collaborator }}{% if forloop.last %}{% else %},{% endif %}
</span>
{% endfor %}
</p>
<div class="mt-auto d-flex flex-row align-items-center">
{% if publication.pdf %}
<a
href="{{ publication.pdf }}"
class="pdf"
target="_blank"
rel="noopener"
>
<i class="fas fa-file-pdf"></i>
<span>PDF</span>
</a>
{% endif %}
{% if publication.slides %}
<a
href="{{ publication.slides }}"
class="pdf"
target="_blank"
rel="noopener"
>
<i class="fas fa-video"></i>
<span>Slides</span>
</a>
{% endif %}
{% if publication.event %}
<span class="pill ml-auto my-2">{{ publication.event }}</span>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- Data filtering for publications -->
<script>
let currentYear = "year-all";
let currentType = "all_types";
update();
function changeType(type) {
currentType = type;
update();
}
function changeYear(year) {
currentYear = year;
update();
}
function update() {
document
.querySelectorAll("#publications-container > div")
.forEach((item) => {
if (item.classList.contains(currentType)) {
item.classList.add("visible");
} else {
item.classList.remove("visible");
}
if (!item.classList.contains(currentYear)) {
item.classList.remove("visible");
}
});
window.updateCards = update;
}
</script>
<!-- Alphabetical sorting -->
<script>
function order_alph() {
var container = $("#publications-container");
var $sections = container.children().detach();
$sections
.sort(function (a, b) {
if (
$(a).find(".title").text().toLowerCase() >
$(b).find(".title").text().toLowerCase()
)
return 1;
if (
$(a).find(".title").text().toLowerCase() <
$(b).find(".title").text().toLowerCase()
)
return -1;
return 0;
})
.each(function () {
container.prepend($sections);
});
}
</script>
<!-- Order filtering -->
<script>
function order_asc() {
var container = $("#publications-container");
var items = $(".article");
items.each(function () {
var BCDate = $(this).attr("data-event-date");
var standardDate = new Date(BCDate).getTime();
$(this).attr("data-event-date", standardDate);
});
items
.sort(function (a, b) {
a = parseFloat($(a).attr("data-event-date"));
b = parseFloat($(b).attr("data-event-date"));
return a > b ? -1 : a < b ? 1 : 0;
})
.each(function () {
container.prepend(this);
});
}
</script>
<script>
// Function to add selected class to the selected type filter
var btnContainer = document.getElementById("publication-filter");
var btns = btnContainer.getElementsByClassName("button-filter");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function () {
var current = document.getElementsByClassName(" categorized");
current[0].className = current[0].className.replace(" categorized", "");
this.className += " categorized";
});
}
</script>
<script>
// Function to add selected class to the selected year filter
var yearContainer = document.getElementById("year-filter");
var years = yearContainer.getElementsByClassName("button-filter");
for (var j = 0; j < years.length; j++) {
years[j].addEventListener("click", function () {
var currentYear = document.getElementsByClassName(" filtered");
currentYear[0].className = currentYear[0].className.replace(
" filtered",
""
);
this.className += " filtered";
});
}
</script>