forked from vbaraku/SYSTRON
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpublications.html
More file actions
119 lines (100 loc) · 3.58 KB
/
publications.html
File metadata and controls
119 lines (100 loc) · 3.58 KB
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
---
layout: page
title: Publications
background: "/img/smart-cities.jpg"
---
<div class="projects-controls">
<div class="projects-controls-row">
<div class="projects-control">
<input
id="publicationsSearch"
class="projects-input"
type="text"
placeholder="Search by Title, Authors, Description, Venue, Date"
/>
</div>
</div>
<div class="projects-meta">
<span id="publicationsCount"></span>
</div>
</div>
<br />
<div id="publicationsGrid">
{% for publication in site.publications reversed %}
<article
class="publication-item post-preview card mb-3"
data-title="{{ publication.title | downcase | escape }}"
data-authors="{{ publication.authors | array_to_sentence_string | downcase | escape }}"
data-desc="{{ publication.excerpt | strip_html | downcase | escape }}"
data-venue="{% if publication.venue %}{{ publication.venue | downcase | escape }}{% endif %}"
data-date="{{ publication.date | date: '%d %B %Y' | downcase | escape }}"
data-year="{{ publication.date | date: '%Y' | escape }}"
>
<a class="stretched-link" href="{{ publication.url | prepend: site.baseurl | replace: '//', '/' }}" aria-label="{{ publication.title }}"></a>
<div class="card-body">
<h3 class="post-title">{{ publication.title }}</h2>
<p class="post-subtitle">
{{ publication.authors | array_to_sentence_string | truncatewords: 30 }}
</p>
<p class="post-meta">
{% if publication.venue %} Published in {{ publication.venue }} ·
{% endif %} Published on {{ publication.date | date: '%d %B %Y' }} {% if
publication.preprint %} · Preprint {% endif %}
</p>
</div>
</article>
{% endfor %}
</div>
<script>
(function () {
var grid = document.getElementById("publicationsGrid");
if (!grid) return;
var items = Array.prototype.slice.call(
grid.querySelectorAll(".publication-item"),
);
var seps = Array.prototype.slice.call(
grid.querySelectorAll(".publication-sep"),
);
var searchEl = document.getElementById("publicationsSearch");
var countEl = document.getElementById("publicationsCount");
function norm(s) {
return (s || "").toString().trim().toLowerCase();
}
function applyFilters() {
var q = norm(searchEl && searchEl.value);
var shown = 0;
items.forEach(function (el, idx) {
var title = norm(el.getAttribute("data-title"));
var authors = norm(el.getAttribute("data-authors"));
var desc = norm(el.getAttribute("data-desc"));
var venue = norm(el.getAttribute("data-venue"));
var dateStr = norm(el.getAttribute("data-date"));
var year = norm(el.getAttribute("data-year"));
var matchesSearch =
!q ||
title.indexOf(q) !== -1 ||
authors.indexOf(q) !== -1 ||
desc.indexOf(q) !== -1 ||
venue.indexOf(q) !== -1 ||
dateStr.indexOf(q) !== -1 ||
year.indexOf(q) !== -1;
if (matchesSearch) {
el.classList.remove("is-hidden");
if (seps[idx]) seps[idx].classList.remove("is-hidden");
shown += 1;
} else {
el.classList.add("is-hidden");
if (seps[idx]) seps[idx].classList.add("is-hidden");
}
});
if (countEl) {
countEl.textContent =
shown + " of " + items.length + " Publications Shown";
}
}
if (searchEl) {
searchEl.addEventListener("input", applyFilters);
}
applyFilters();
})();
</script>