diff --git a/dockerfiles/grist/Dockerfile b/dockerfiles/grist/Dockerfile index 65c8c96..97209b8 100644 --- a/dockerfiles/grist/Dockerfile +++ b/dockerfiles/grist/Dockerfile @@ -19,7 +19,8 @@ RUN apt-get update &&\ apt-get remove --purge -y wget COPY ressources/* /grist/static/ -RUN mv /grist/static/marianne-48x48.png /grist/static/ui-icons/Logo/ +RUN mv /grist/static/GristGouvLogo.svg /grist/static/ui-icons/Logo/ &&\ + mv /grist/static/favicon.png /grist/static/icons/favicon.png # Variable to force grist to use custom.css and dinum-custom.js ENV APP_STATIC_INCLUDE_CUSTOM_CSS true diff --git a/dockerfiles/grist/ressources/GristGouvLogo.svg b/dockerfiles/grist/ressources/GristGouvLogo.svg new file mode 100644 index 0000000..a5befb9 --- /dev/null +++ b/dockerfiles/grist/ressources/GristGouvLogo.svg @@ -0,0 +1,133 @@ + + + + + + Slice 1 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Slice 1 + + + + diff --git a/dockerfiles/grist/ressources/custom.css b/dockerfiles/grist/ressources/custom.css index a996fbc..3228c92 100644 --- a/dockerfiles/grist/ressources/custom.css +++ b/dockerfiles/grist/ressources/custom.css @@ -2,7 +2,7 @@ :root { /* logo */ - --icon-GristLogo: url("ui-icons/Logo/marianne-48x48.png") !important; + --icon-GristLogo: url("ui-icons/Logo/GristGouvLogo.svg") !important; --grist-logo-bg: #ffffff !important; --grist-logo-size: 22px 22px !important; diff --git a/dockerfiles/grist/ressources/dinum-custom.js b/dockerfiles/grist/ressources/dinum-custom.js index 27e0a2a..77fc16f 100644 --- a/dockerfiles/grist/ressources/dinum-custom.js +++ b/dockerfiles/grist/ressources/dinum-custom.js @@ -8,7 +8,7 @@ selectedTz: 'CEST', // Date du début de la maintenance - startDateWithoutTimezone: '2024-04-18T17:30:00', + startDateWithoutTimezone: '2024-04-10T13:00:00', // Durée de la maitenance prévue (en minutes). // ASTUCE: Si la maintenance dure moins longtemps que prévu, réduire a postériori la valeur de cette variable de sorte à ce qu'elle n'apparaisse plus. @@ -27,7 +27,7 @@ })(); - function showDialog() { + function showMaitainanceDialog() { const dialog = document.createElement('dialog'); dialog.id = 'maintenancePopin'; const dateFormatter = new Intl.DateTimeFormat('fr-FR', { @@ -66,7 +66,59 @@ if (Date.now() < maintainanceEndDate.getTime() && (!localStorage.maintainanceStartDateAgreement || localStorage.maintainanceStartDateAgreement !== maintainanceStartDate.toISOString())) { - window.addEventListener('load', showDialog); + window.addEventListener('load', showMaitainanceDialog); + } + + /** + * Creates a link (anchor element) given the text and the href (link) passed. + * We use this method to prevent XSS injection. + */ + function makeLink(text, href) { + const a = document.createElement('a'); + a.textContent = text; + a.href = href; + a.target = "_blank"; + a.rel = 'nofollow'; + return a; + } + + function showAgreementDialog() { + const { termsOfServiceUrl } = window.gristConfig; + if (!termsOfServiceUrl) { + return; + } + + const dialog = document.createElement('dialog'); + dialog.id = 'agreementPopin'; + const cguLinkHtml = makeLink("les conditions d'utilisation", termsOfServiceUrl).outerHTML; + dialog.innerHTML = ` +

+ Veuillez accepter ${cguLinkHtml} de Grist avant de continuer. +

+

+ Vous pourrez les retrouvez à tout moment via le lien en bas
+ à gauche de la page d'accueil de Grist. +

+
+

+ + +

+ +
+ `; + document.body.appendChild(dialog); + document.getElementById('fermerPopinAgreement').onclick = function onMessageUnderstood() { + localStorage.gcuAgreementDate = new Date().toISOString(); + } + document.getElementById('jaccepte').onchange = function (ev) { + document.getElementById('fermerPopinAgreement').disabled = !ev.target.checked; + } + dialog.showModal(); + } + + if (!localStorage.gcuAgreementDate) { + window.addEventListener('load', showAgreementDialog); } })(); diff --git a/dockerfiles/grist/ressources/favicon.png b/dockerfiles/grist/ressources/favicon.png new file mode 100644 index 0000000..2f8daad Binary files /dev/null and b/dockerfiles/grist/ressources/favicon.png differ diff --git a/dockerfiles/grist/ressources/marianne-48x48.png b/dockerfiles/grist/ressources/marianne-48x48.png deleted file mode 100644 index 894bbe3..0000000 Binary files a/dockerfiles/grist/ressources/marianne-48x48.png and /dev/null differ