-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Déplace calendrier des événements vers page séparée
- Loading branch information
1 parent
dd49642
commit 056849b
Showing
5 changed files
with
136 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Calendrier des événements | ||
menu: | ||
main: | ||
parent: evenements | ||
weight: 2 | ||
sitemap: | ||
changefreq: daily | ||
priority: 0.7 | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,39 +5,3 @@ | |
{{ define "main" }} | ||
{{ .Content }} | ||
{{ end }} | ||
|
||
{{ define "scripts" }} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/ical.min.js" integrity="sha256-uotVKltUv5neKsIlZxrxUccba0PaptusFj6p+w8Sons=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.global.min.js" integrity="sha256-ZztCtsADLKbUFK/X6nOYnJr0eelmV2X3dhLDB/JK6fM=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.global.min.js" integrity="sha256-4zHPHslCgpks0gXVzHuFcF3aL1y674HH8L9s3vQiJK4=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/locales-all.global.min.js" integrity="sha256-lzem0W8FCaLegnCNhEQnF4bMnpq9Du4IiUDonSOXCA8=" crossorigin="anonymous"></script> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", () => { | ||
const calendarEl = document.getElementById("events-calendar"); | ||
const calendar = new FullCalendar.Calendar(calendarEl, { | ||
initialView: "dayGridFourDay", | ||
headerToolbar: { | ||
center: "dayGridFourDay,dayGridMonth", | ||
}, | ||
locale: "fr", | ||
contentHeight: 400, | ||
events: { | ||
url: "https://bot.aediroum.ca/events.ics", | ||
format: "ics", | ||
}, | ||
views: { | ||
dayGridFourDay: { | ||
type: "dayGrid", | ||
duration: { days: 4 }, | ||
buttonText: "À venir" | ||
}, | ||
}, | ||
navLinks: true, | ||
navLinkDayClick: function(date, jsEvent) { | ||
calendar.changeView("dayGridFourDay", date); | ||
}, | ||
}); | ||
calendar.render(); | ||
}); | ||
</script> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{{ define "main" }} | ||
<h3>{{ .Title }}</h3> | ||
|
||
{{ .Content }} | ||
|
||
<p> | ||
<strong>Abonnement via</strong> | ||
<a href="webcal://bot.aediroum.ca/events.ics">Calendrier iCal</a> | ||
</p> | ||
|
||
<p> | ||
<button class="btn btn-dark" id="events-fullscreen">Passer en plein écran</button> | ||
</p> | ||
|
||
<div id="events-calendar"></div> | ||
{{ end }} | ||
|
||
{{ define "scripts" }} | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/ical.min.js" integrity="sha256-uotVKltUv5neKsIlZxrxUccba0PaptusFj6p+w8Sons=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.global.min.js" integrity="sha256-ZztCtsADLKbUFK/X6nOYnJr0eelmV2X3dhLDB/JK6fM=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/index.global.min.js" integrity="sha256-4zHPHslCgpks0gXVzHuFcF3aL1y674HH8L9s3vQiJK4=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/locales-all.global.min.js" integrity="sha256-lzem0W8FCaLegnCNhEQnF4bMnpq9Du4IiUDonSOXCA8=" crossorigin="anonymous"></script> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", () => { | ||
const calendarEl = document.getElementById("events-calendar"); | ||
const fullscreenEl = document.getElementById("events-fullscreen"); | ||
|
||
fullscreenEl.addEventListener("click", () => { | ||
calendarEl.requestFullscreen(); | ||
}); | ||
|
||
const calendar = new FullCalendar.Calendar(calendarEl, { | ||
/* Paramètres de langue. */ | ||
locale: "fr", | ||
firstDay: 0, | ||
|
||
/* Configuration des vues de calendrier. */ | ||
contentHeight: 500, | ||
initialView: "dayGridNextDays", | ||
headerToolbar: { | ||
center: "dayGridNextDays,dayGridMonth", | ||
}, | ||
views: { | ||
dayGridNextDays: { | ||
type: "dayGrid", | ||
duration: { days: 4 }, | ||
buttonText: "À venir" | ||
}, | ||
}, | ||
|
||
/* Charge le contenu depuis le flux ICS externe. */ | ||
events: { | ||
url: "https://bot.aediroum.ca/events.ics", | ||
format: "ics", | ||
}, | ||
|
||
/* Navigue vers la vue par journée lors du clic sur une date du mois. */ | ||
navLinks: true, | ||
navLinkDayClick: function(date, jsEvent) { | ||
calendar.changeView("dayGridNextDays", date); | ||
}, | ||
|
||
/* Change le rendu des événements pour ajouter la localisation. */ | ||
eventContent: function(info, createElement) { | ||
const time = document.createElement("div"); | ||
time.className = "fc-event-time"; | ||
time.textContent = info.timeText; | ||
|
||
const title = document.createElement("div"); | ||
title.className = "fc-event-title"; | ||
title.textContent = info.event.title; | ||
|
||
const location = document.createElement("div"); | ||
location.className = "fc-event-location"; | ||
location.textContent = info.event.extendedProps.location; | ||
|
||
return {domNodes: [time, title, location]}; | ||
}, | ||
}); | ||
calendar.render(); | ||
}); | ||
</script> | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters