From 2f9a1b8d581cd1b2d833f05606c84161fe8c3de8 Mon Sep 17 00:00:00 2001 From: Glen Robson Date: Tue, 22 Feb 2022 01:53:04 +0000 Subject: [PATCH] Adding upcoming calls --- source/_includes/blocks/event-cards.html | 43 +++++++++++++++++-- source/community/groups/3d/index.md | 2 + source/community/groups/D4H/index.md | 2 + source/community/groups/archives/index.md | 2 + source/community/groups/auth-tsg/index.md | 2 + source/community/groups/av/index.md | 2 + .../groups/content-search-tsg/index.md | 2 + source/community/groups/discovery/index.md | 2 + source/community/groups/manuscripts/index.md | 2 + source/community/groups/maps-tsg/index.md | 2 + source/community/groups/maps/index.md | 2 + source/community/groups/museums/index.md | 2 + source/community/groups/newspapers/index.md | 2 + source/community/groups/outreach/index.md | 2 + 14 files changed, 65 insertions(+), 4 deletions(-) diff --git a/source/_includes/blocks/event-cards.html b/source/_includes/blocks/event-cards.html index ce69b2240..f60b3ad82 100644 --- a/source/_includes/blocks/event-cards.html +++ b/source/_includes/blocks/event-cards.html @@ -90,10 +90,12 @@

{{ event.label }}

let eventDetails = createDiv(cardContent, "event-details has-text-left"); eventDetails.style.marginBottom = "0"; - createNode(eventDetails, "i", "fas fa-university"); - eventDetails.appendChild(document.createTextNode(" " + organiser)); - eventDetails.appendChild(document.createElement("br")); - + if(organiser) { + createNode(eventDetails, "i", "fas fa-university"); + eventDetails.appendChild(document.createTextNode(" " + organiser)); + eventDetails.appendChild(document.createElement("br")); + } + createNode(eventDetails, "i", "fas fa-map-marked-alt"); eventDetails.appendChild(document.createTextNode(" ")); if (location) { @@ -158,6 +160,31 @@

{{ event.label }}

} } + function findNextCall(parent, events, group) { + if (group in events.meetings) { + let event = events.meetings[group] + if ('next_call' in event) { + links = [] + if (location && location.link) { + links.push({ + 'label': 'Zoom Link', + 'link': location.link + }); + } + + links.push({ + 'label': 'Notes', + 'link': event.notes + }); + buildCard(parent, new Date(event.next_call), false, 'Next ' + event.label + ' community call', event.frequency, null, null, links); + } else { + console.log('Group: ' + group + ' does not have a next call in https://iiif.io/events/calendar.json'); + } + } else { + console.log('Group: ' + group + ' not in https://iiif.io/events/calendar.json'); + } + } + function addCalls(parent, events, limit) { let weeksCalls = events.week; if (weeksCalls.length < limit) { @@ -218,6 +245,14 @@

{{ event.label }}

.then(response => response.json()) .then(data => addCalls(parent, data, {{ include.limit | default: 10 }})); + {% elsif include.type and include.type == 'next_call' %} + {% else %}