-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathorganizations.html
More file actions
108 lines (93 loc) · 4.66 KB
/
organizations.html
File metadata and controls
108 lines (93 loc) · 4.66 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
---
title: Organizations
layout: default
permalink: /organizations/
---
{% include breadcrumbs.html %}
{% assign org_count = site.organizations | size %}
{% assign published_org_count = 0 %}
{% for organization in site.organizations %}
{% assign dataset_count = site.datasets | where:"organization", organization.title | size %}
{% if dataset_count > 0 %}
{% assign published_org_count = published_org_count | plus: 1 %}
{% endif %}
{% endfor %}
{% assign unpublished_org_count = org_count | minus: published_org_count %}
<style>
#org-list[data-show-empty-orgs="false"] .org-parent[data-has-datasets="false"] {
display: none !important;
}
</style>
<h1>Organizations</h1>
<h2 id="orgs-count">{{ published_org_count }} organizations with published datasets</h2>
<div class="mb-4">
<input type="text" id="org-search" class="form-control" placeholder="Search organizations...">
<div class="form-check my-3">
<input class="form-check-input" type="checkbox" id="show-empty-orgs">
<label class="form-check-label" for="show-empty-orgs">
Include organizations with no datasets published{% if unpublished_org_count > 0 %} ({{ unpublished_org_count }}){% endif %}
</label>
</div>
<div class="alert alert-info" role="alert">
Only organizations with 1 or more published datasets are shown by default, to keep this list focused on active publishers. Enable the checkbox to include organizations that have not published any datasets yet, that we hope to see publishing in the future!
</div>
</div>
<div id="org-list" data-show-empty-orgs="false">
{% for organization in site.organizations %}
{% assign dataset_count = site.datasets | where:"organization", organization.title | size %}
{% assign org_type = organization.type | first %}
<div class="d-flex gap-3 align-items-start org-parent mb-3 pb-3 border-bottom" data-org-name="{{ organization.title | escape }}" data-org-type="{{ org_type | default: '' | escape }}" data-org-description="{{ organization.description | default: '' | escape }}" data-dataset-count="{{ dataset_count }}" data-has-datasets="{% if dataset_count > 0 %}true{% else %}false{% endif %}">
<div class="flex-shrink-0">
{% if organization.logo and organization.logo != empty %}
<a href="{{ site.baseurl }}{{ organization.url }}" class="organization-thumbnail d-inline-flex align-items-center justify-content-center p-2 bg-body-tertiary border rounded-3 shadow-sm">
<img class="img-fluid" src="{{ organization.logo }}" alt="{{ organization.title }}" onerror="this.onerror=null;this.src='{{ site.baseurl }}{{ site.default_org_icon }}';" />
</a>
{% else %}
<a href="{{ site.baseurl }}{{ organization.url }}" class="organization-thumbnail d-inline-flex align-items-center justify-content-center p-2 bg-body-tertiary border rounded-3 shadow-sm">
<img class="img-fluid" src="{{ site.baseurl }}{{ site.default_org_icon }}" alt="{{ organization.title }}" />
</a>
{% endif %}
</div>
<div class="flex-grow-1">
<h3>
<a href="{{ site.baseurl }}{{ organization.url }}">{{ organization.title }}</a>
<small class="text-body-secondary fs-5 ms-1">{{ org_type }}</small>
</h3>
<p class="text-body-secondary mb-0">{{ organization.description }}</p>
<p>
<a href="{{ site.baseurl }}/datasets/?organization={{ organization.title | slugify }}">{{ dataset_count }} datasets</a>
</p>
</div>
</div>
{% endfor %}
</div>
<script>
const orgSearch = document.getElementById("org-search");
const showEmptyOrgs = document.getElementById("show-empty-orgs");
const orgList = document.getElementById("org-list");
const orgElements = document.querySelectorAll("#org-list .org-parent");
const orgCountDisplay = document.getElementById("orgs-count");
function updateOrganizationList() {
const searchTerm = orgSearch.value.trim().toLowerCase();
const includeEmptyOrgs = showEmptyOrgs.checked;
let orgShownCount = 0;
orgList.dataset.showEmptyOrgs = includeEmptyOrgs ? "true" : "false";
orgElements.forEach(org => {
const matchesSearch = org.dataset.orgName.toLowerCase().includes(searchTerm) ||
org.dataset.orgType.toLowerCase().includes(searchTerm) ||
org.dataset.orgDescription.toLowerCase().includes(searchTerm);
const hasDatasets = org.dataset.hasDatasets === "true";
const isVisible = matchesSearch && (includeEmptyOrgs || hasDatasets);
org.classList.toggle("d-none", !isVisible);
if (isVisible) {
orgShownCount++;
}
});
orgCountDisplay.innerText = includeEmptyOrgs
? `${orgShownCount} organizations`
: `${orgShownCount} organizations with published datasets`;
}
orgSearch.addEventListener("input", updateOrganizationList);
showEmptyOrgs.addEventListener("change", updateOrganizationList);
updateOrganizationList();
</script>