-
Notifications
You must be signed in to change notification settings - Fork 13
/
organizations.html
67 lines (59 loc) · 2.36 KB
/
organizations.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
---
title: Organizations
layout: default
permalink: /organizations/
---
{% include breadcrumbs.html %}
{% assign org_count = site.organizations | size %}
<h1>Organizations</h1>
<h2 id="orgs-count">{{ org_count }} organizations</h2>
<input type="text" id="org-search" class="form-control" placeholder="Search..." style="margin-bottom:2rem;">
<div id="org-list">
{% for organization in site.organizations %}
{% assign dataset_count = site.datasets | where:"organization", organization.title | size %}
{% assign org_type = organization.type | first %}
<div class="media org-parent" data-org-name="{{ organization.title }}" data-org-type="{{ org_type }}" data-org-description="{{ organization.description }}">
<div class="media-left">
{% if organization.logo and organization.logo != empty %}
<a href="{{ site.baseurl }}{{ organization.url }}" class="organization-thumbnail">
<img class="media-object" src="{{ organization.logo }}" alt="{{ organization.title }}" />
</a>
{% else %}
<a href="{{ site.baseurl }}{{ organization.url }}" class="organization-thumbnail">
<img class="media-object" src="{{ site.baseurl }}{{ site.default_org_icon }}" alt="{{ organization.title }}" />
</a>
{% endif %}
</div>
<div class="media-body">
<h3 class="media-heading">
<a href="{{ site.baseurl }}{{ organization.url }}">{{ organization.title }}</a>
<small style="margin-left: 0.5rem">{{ org_type }}</small>
</h3>
<p>{{ organization.description }}</p>
<p>
<a href="{{ site.baseurl }}/datasets/?organization={{ organization.title | slugify }}">{{ dataset_count }} datasets</a>
</p>
</div>
</div>
{% endfor %}
</div>
<script>
document.getElementById("org-search").addEventListener("keyup", function (e) {
let searchTerm = e.srcElement.value;
let orgElements = document.querySelectorAll("#org-list .org-parent")
let orgShownCount = 0;
let orgCountDisplay = document.getElementById("orgs-count");
orgElements.forEach(org => {
if (org.dataset.orgName.toLowerCase().includes(searchTerm.toLowerCase()) ||
org.dataset.orgType.toLowerCase().includes(searchTerm.toLowerCase()) ||
org.dataset.orgDescription.toLowerCase().includes(searchTerm.toLowerCase())) {
org.style.display = "block";
orgShownCount++
}
else {
org.style.display = "none";
}
orgCountDisplay.innerText = `${orgShownCount} organizations`;
})
});
</script>