From 1fc8aedb67b28759b039cb7ae045d92c87971dbb Mon Sep 17 00:00:00 2001 From: betalabmi Date: Wed, 17 Mar 2021 18:04:05 +0100 Subject: [PATCH] Ajout de boutons pour choisir le contexte --- CHANGELOG.md | 15 +++++- README.md | 2 + package-lock.json | 2 +- package.json | 2 +- src/certificate.pdf | Bin 173576 -> 173632 bytes src/css/main.css | 122 ++++++++++++++++++++++++++++++++++++++++++-- src/form-data.json | 8 +-- src/index.html | 4 +- src/js/form-util.js | 46 +++++++++++++---- src/js/form.js | 60 ++++++++++++++-------- src/js/pdf-util.js | 22 ++++---- src/robots.txt | 2 +- src/sitemap.xml | 8 +-- 13 files changed, 235 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6effb0..76acd8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,28 @@ # Changelog +## [2.2.0] + +- Ajout de boutons pour choisir le contexte +- Correction de liens erronés, et informations manquantes + +## [2.1.0] + +- Correction de motif +- Reconstruction du formulaire +- Modification du pdf (certificate.pdf) +- Repositionnement des textes ajoutés + ## [2.0.0] - Reconstruction du formulaire - Modification du pdf - Repositionnement des textes ajoutés + ## [1.1.0] - Modification du pdf (certificate.pdf) - Repositionnement des textes ajoutés -- Accessibilité : ajout d'un texte (en blanc) pour indiquer aux lecteurs de pdf audio la présence d'un QR-code dans le document généré +- Accessibilité : ajout d'un texte (en blanouton pour choisir le contextec) pour indiquer aux lecteurs de pdf audio la présence d'un QR-code dans le document généré ## [1.1.1] diff --git a/README.md b/README.md index 041b933..52f9a31 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ Les projets open source suivants ont été utilisés pour le développement de c service : - [PDF-LIB](https://pdf-lib.js.org/) +- [remove-accents](https://github.com/tyxla/remove-accents) +- [secure-ls](https://github.com/softvar/secure-ls) - [qrcode](https://github.com/soldair/node-qrcode) - [Bootstrap](https://getbootstrap.com/) - [Font Awesome](https://fontawesome.com/license) diff --git a/package-lock.json b/package-lock.json index 0bfa314..4919aee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "attestation-derogatoire-de-deplacement", - "version": "2.0.0", + "version": "2.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7656563..aab63e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "attestation-derogatoire-de-deplacement", - "version": "2.0.0", + "version": "2.2.0", "description": "Générateur d'attestation de déplacement dérogatoire'", "main": "certificate.js", "scripts": { diff --git a/src/certificate.pdf b/src/certificate.pdf index 7dfd0a121815cf27e4c527bdfaca4bc535cf542e..5da392c54a407dc751c408ad3d8692316e2c2453 100644 GIT binary patch delta 7090 zcmbuDWl&Y&y2t5m=|);WcCmv-8l;u34I(Aoxj|5rmM#hD?rxCYG>AwG(y;{urM#Yd z=iWKz_~CrG>%*G0{`17|`OkXaS@XU@lk}iTYM60QPyi4rElp11;puLJbRsA5%^Hwe za$jmmI4K>K*>x(Z1V*$_Z|RRdjkTT}IpzV|4(jc2r4uSy(HxH^+&5ayy6rz>@RO9b zsNGcxgJCxf-tR1p93TyGhA;=o<7VAp#Z+LTl<@5w%X$9Y5dVcOgVPr zd4uzff|r{v{-^ei8QFn-?a{}>yo=~Zc>G>y$1`Mu0mYygZ*cw!$vWupdN~8I< ze+&7#AtN6b@%Jr{>~eIcwdYJsh_0r6WpF`N@9X{sOrpeoqh4onjL)|D1)g3lMD1}T zmjCv>JM8mZub#{ypF$2KqAx**3QY3*5fbB?GIcb3txX9~ zF%=GVeeEx-o{v+t@FPc2EG)+=Lm4*j;D4X{K_J=tt6gB;*YJp`Ob&eYbEK-C1bI(l zDy|5xv!k~AH&x*?Kr8y^p)q$P1@+a%M$h)m`wJBUKsMPbm2ZGSZbGme9qs3c*UvWaOv})m=n=>T&M{-k9lF2bYEkMM}qyH`|j{W$-1Abq`M#P1+H-&1y9 z%9sY$z=GMwJxK@Lr}TI`E7v7~GK!Syq3#^P6<%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b/src/css/main.css @@ -129,6 +129,34 @@ a { } } +@media (prefers-color-scheme: dark) { + a.curfew-button { + color: white; + background-color: #43436B; + } +} + +@media (prefers-color-scheme: dark) { + #curfew-reason-fieldset.targeted { + color: white; + background-color: #43436B; + } +} + +@media (prefers-color-scheme: dark) { + #curfew-reason-fieldset.targeted.in-quarantine { + color: white; + background-color: #6B0B0B; + } +} + +@media (prefers-color-scheme: dark) { + #quarantine-reason-fieldset.targeted { + color: white; + background-color: #6B0B0B; + } +} + p { color: black; } @@ -664,10 +692,10 @@ input[type=number] { } .fieldset { - margin-left: -1.25em; - margin-right: -1.25em; - padding-left: 1.25em; - padding-right: 1.25em; + margin-left: -1.5rem; + margin-right: -1.5rem; + padding-left: 1.5rem; + padding-right: 1.5rem; border: 3px solid transparent; } @@ -678,3 +706,89 @@ input[type=number] { .fieldset-error { border: 3px solid red; } + +.sanitary-context ~ * { + display: none +} + +.sanitary-context ~ label { + display: block +} + +.sanitary-context:checked ~ * { + display: block; +} + +#curfew-reason-fieldset { + display: none; + background: #DDF; +} +#curfew-reason-fieldset.targeted, +#quarantine-reason-fieldset.targeted { + display: block; +} +#quarantine-reason-fieldset { + display: none; + background: #FEE; +} + +.curfew-button { + display: block; + width: 40%; + text-decoration: none; + background: #DDF; +} + +.quarantine-button { + display: block; + width: 40%; + text-decoration: none; + background: #FEE; +} + +#formgroup-storedata { + clear: both; + padding-top: 2rem !important; +} + +.context-title { + font-size: 1.2em; + font-weight: bold; +} +.context-subtitle { + font-size: 0.8rem; +} + +.context-wrapper-error { + border: 1px solid red; + padding: 1%; +} + +.context-wrapper-error .context-title { + color: red; +} + +.button-wrapper { + display: flex; + justify-content: space-between; +} + +#curfew-reason-fieldset.in-quarantine { + background: #FEE; +} + +#curfew-reason-fieldset.targeted { + display: block; +} + +.fieldset-wrapper.fieldset-error { + margin-left: -1.5rem; + margin-right: -1.5rem; + padding-left: 1.5rem; + padding-right: 1.5rem; +} + +.quarantine-subtitle, +.curfew-subtitle { + padding: 1rem 0; +} \ No newline at end of file diff --git a/src/form-data.json b/src/form-data.json index 88b8ccf..f5e246d 100644 --- a/src/form-data.json +++ b/src/form-data.json @@ -103,7 +103,7 @@ "items": [ { "code": "travail", - "label": " 1. Activité professionnelle enseignement et formation
Déplacements entre le domicile et le lieu d’exercice de l’activité professionnelle ou le lieu d’enseignement et de formation, déplacements professionnels ne pouvant être différés ;" + "label": " 1. Activité professionnelle, enseignement et formation
Déplacements entre le domicile et le lieu d’exercice de l’activité professionnelle ou le lieu d’enseignement et de formation, déplacements professionnels ne pouvant être différés ;" }, { "code": "sante", @@ -119,7 +119,7 @@ }, { "code": "judiciaire", - "label": " 5. Convocation judiciaire ou administrative
Déplacements pour répondre à une convocation judiciaire ou administrative. ;" + "label": " 5. Convocation judiciaire ou administrative
Déplacements pour répondre à une convocation judiciaire ou administrative, déplacements pour se rendre chez un professionnel du droit, pour un acte ou une démarche qui ne peuvent être réalisés à distance ;" }, { "code": "missions", @@ -132,7 +132,7 @@ { "code": "animaux", "label": " 8. Animaux de compagnie
Déplacements brefs autour du domicile pour les besoins des animaux de compagnie [2] ;" - }, + } ] }, { @@ -153,7 +153,7 @@ }, { "code": "demarche", - "label": " 12. Démarches administratives ou juridiques
Déplacements pour se rendre dans un service public ou chez un professionnel du droit, pour un acte ou une démarche qui ne peuvent être réalisés à distance." + "label": " 12. Démarches administratives ou juridiques
Déplacements pour se rendre dans un service public." } ] } diff --git a/src/index.html b/src/index.html index 61ec941..1942460 100644 --- a/src/index.html +++ b/src/index.html @@ -15,8 +15,8 @@ - - + + diff --git a/src/js/form-util.js b/src/js/form-util.js index 3633ae1..ff75ba2 100644 --- a/src/js/form-util.js +++ b/src/js/form-util.js @@ -133,7 +133,7 @@ export function getReasons (reasonInputs) { return reasons } -export function prepareInputs (formInputs, reasonInputs, reasonFieldset, reasonAlert, snackbar, releaseDateInput) { +export function prepareInputs (formInputs, reasonInputs, reasonFieldsetsWrapper, reasonAlerts, snackbar, releaseDateInput, contextWrapper) { const lsProfile = secureLS.get('profile') // Continue to store data if already stored @@ -167,8 +167,8 @@ export function prepareInputs (formInputs, reasonInputs, reasonFieldset, reasonA reasonInputs.forEach(radioInput => { radioInput.addEventListener('change', function (event) { const isInError = reasonInputs.every(input => !input.checked) - reasonFieldset.classList.toggle('fieldset-error', isInError) - reasonAlert.classList.toggle('hidden', !isInError) + reasonFieldsetsWrapper.classList.toggle('fieldset-error', isInError) + reasonAlerts.map(reasonAlert => reasonAlert.classList.toggle('hidden', !isInError)) }) }) $('#cleardata').addEventListener('click', () => { @@ -183,11 +183,15 @@ export function prepareInputs (formInputs, reasonInputs, reasonFieldset, reasonA $('#generate-btn').addEventListener('click', async (event) => { event.preventDefault() + if ($$('.targeted').length === 0) { + contextWrapper.classList.add('context-wrapper-error') + } + const reasons = getReasons(reasonInputs) if (!reasons) { - reasonFieldset.classList.add('fieldset-error') - reasonAlert.classList.remove('hidden') - reasonFieldset.scrollIntoView && reasonFieldset.scrollIntoView() + reasonFieldsetsWrapper.classList.add('fieldset-error') + reasonAlerts.map(reasonAlert => reasonAlert.classList.remove('hidden')) + // reasonFieldsetsWrapper.scrollIntoView && reasonFieldsetsWrapper.scrollIntoView() return } @@ -207,15 +211,39 @@ export function prepareInputs (formInputs, reasonInputs, reasonFieldset, reasonA downloadBlob(pdfBlob, `attestation-${creationDate}_${creationHour}.pdf`) showSnackbar(snackbar, 6000) }) + + const curfewFieldset = $('#curfew-reason-fieldset') + const quarantineFieldset = $('#quarantine-reason-fieldset') + const curfewSubtitle = $('.curfew-subtitle') + const quarantineSubtitle = $('.quarantine-subtitle') + $$('.context-button').map(anchor => anchor.addEventListener('click', (event) => { + contextWrapper.classList.remove('context-wrapper-error') + reasonFieldsetsWrapper.classList.toggle('hidden', false) + if (event.target.className.includes('curfew-button')) { + curfewFieldset.classList.toggle('in-quarantine', false) + curfewFieldset.classList.toggle('targeted', true) + quarantineFieldset.classList.toggle('targeted', false) + curfewSubtitle.classList.toggle('hidden', false) + quarantineSubtitle.classList.toggle('hidden', true) + } + if (event.target.className.includes('quarantine-button')) { + curfewFieldset.classList.toggle('in-quarantine', true) + curfewFieldset.classList.toggle('targeted', true) + quarantineFieldset.classList.toggle('targeted', true) + curfewSubtitle.classList.toggle('hidden', true) + quarantineSubtitle.classList.toggle('hidden', false) + } + })) } export function prepareForm () { const formInputs = $$('#form-profile input') const snackbar = $('#snackbar') const reasonInputs = [...$$('input[name="field-reason"]')] - const reasonFieldset = $('#reason-fieldset') - const reasonAlert = reasonFieldset.querySelector('.msg-alert') + const reasonFieldsetsWrapper = $('.fieldset-wrapper') + const reasonAlerts = $$('.msg-alert') const releaseDateInput = $('#field-datesortie') + const contextWrapper = $('.context-wrapper') setReleaseDateTime(releaseDateInput) - prepareInputs(formInputs, reasonInputs, reasonFieldset, reasonAlert, snackbar, releaseDateInput) + prepareInputs(formInputs, reasonInputs, reasonFieldsetsWrapper, reasonAlerts, snackbar, releaseDateInput, contextWrapper) } diff --git a/src/js/form.js b/src/js/form.js index cd294ff..c7946b3 100644 --- a/src/js/form.js +++ b/src/js/form.js @@ -11,7 +11,6 @@ const createTitle = () => { const p = createElement('p', { className: 'msg-info', innerHTML: 'Tous les champs sont obligatoires.' }) return [h2, p] } -// createElement('div', { className: 'form-group' }) const createFormGroup = ({ autocomplete = false, @@ -96,17 +95,17 @@ const createReasonField = (reasonData) => { return formReason } -const createReasonFieldset = (reasonsData) => { +const createReasonFieldset = (reasonsData, sanitaryContextData) => { const fieldsetAttrs = { - id: 'reason-fieldset', - className: 'fieldset', + id: 'curfew-reason-fieldset', + className: 'fieldset reason-fieldset', } const fieldset = createElement('fieldset', fieldsetAttrs) const appendToFieldset = appendTo(fieldset) const textSubscribeReasonAttrs = { - innerHTML: 'certifie que mon déplacement est lié au motif suivant (cocher la case) autorisé par le décret n°2020-1310 du 29 octobre 2020 prescrivant les mesures générales nécessaires pour faire face à l\'épidémie de Covid19 dans le cadre de l\'état d\'urgence sanitaire [1] :', + innerHTML: 'Je certifie que mon déplacement est lié au motif suivant (cocher la case) autorisé par le décret n°2020-1310 du 29 octobre 2020 prescrivant les mesures générales nécessaires pour faire face à l\'épidémie de Covid19 dans le cadre de l\'état d\'urgence sanitaire [1] :', } const textSubscribeReason = createElement('p', textSubscribeReasonAttrs) @@ -128,26 +127,16 @@ const createReasonFieldset = (reasonsData) => { const createReasonFieldsetQuarantine = (reasonsData) => { const fieldsetAttrs = { - id: 'reason-fieldset', - className: 'fieldset', + id: 'quarantine-reason-fieldset', + className: 'fieldset reason-fieldset', } const fieldset = createElement('fieldset', fieldsetAttrs) const appendToFieldset = appendTo(fieldset) - const textQuarantineAttrs = { - className: 'legend titre-3', - innerHTML: 'Motifs supplémentaires applicables uniquement de 6h à 18h dans les territoires soumis a un confinement le week-end', - } - - const textQuarantine = createElement('p', textQuarantineAttrs) - - const textAlertAttrs = { className: 'msg-alert hidden', innerHTML: 'Veuillez choisir un motif' } - const textAlert = createElement('p', textAlertAttrs) - const reasonsFields = reasonsData.items.map(createReasonField) - appendToFieldset([textQuarantine, textAlert, ...reasonsFields]) + appendToFieldset([...reasonsFields]) // Créer un form-checkbox par motif return fieldset } @@ -185,7 +174,38 @@ export function createForm () { .flat(1) .find(field => field.key === 'reason-quarantine') - const reasonFieldset = createReasonFieldset(reasonsDataCurfew) + const reasonFieldsetCurfew = createReasonFieldset(reasonsDataCurfew) const reasonFieldsetQuarantine = createReasonFieldsetQuarantine(reasonsDataQuarantine) - appendToForm([...createTitle(), ...formFirstPart, reasonFieldset, reasonFieldsetQuarantine]) + const curfewButton = createElement('button', { type: 'button', className: 'curfew-button context-button btn' }) + const curfewLink = document.createTextNode('Couvre-feu (18h-6h)') + curfewButton.appendChild(curfewLink) + const quarantineButton = createElement('button', { type: 'button', className: 'quarantine-button context-button btn' }) + const quarantineLink = document.createTextNode('Week-end * (6h-18h)') + quarantineButton.appendChild(quarantineLink) + const buttonWrapper = createElement('div', { className: 'button-wrapper' }) + buttonWrapper.appendChild(curfewButton) + buttonWrapper.appendChild(quarantineButton) + const contextTitle = createElement('p', { className: 'context-title' }) + const contextTitleText = document.createTextNode('Choisissez un contexte') + contextTitle.appendChild(contextTitleText) + const contextSubtitle = createElement('p', { className: 'context-subtitle' }) + const contextSubtitleText = document.createTextNode('* Le contexte "Week-end (6h-18h)" ne s\'applique qu\'aux territoires concernés par des dispositions spécifiques') + contextSubtitle.appendChild(contextSubtitleText) + const contextWrapper = createElement('div', { className: 'context-wrapper' }) + contextWrapper.appendChild(contextTitle) + contextWrapper.appendChild(contextSubtitle) + contextWrapper.appendChild(buttonWrapper) + const reasonFielsetWrapper = createElement('div', { className: 'fieldset-wrapper hidden' }) + + const quarantineSubtitle = createElement('div', { className: 'quarantine-subtitle hidden' }) + const quarantineSubtitleText = document.createTextNode('J\'effectue un déplacement le week-end entre 06h00 et 18h00 sur un territoire soumis au confinement') + quarantineSubtitle.appendChild(quarantineSubtitleText) + const curfewSubtitle = createElement('div', { className: 'curfew-subtitle hidden' }) + const curfewSubtitleText = document.createTextNode('J\'effectue un déplacement entre 18h00 et 06h00 sur un territoire soumis au couvre-feu.') + curfewSubtitle.appendChild(curfewSubtitleText) + reasonFieldsetCurfew.prepend(quarantineSubtitle) + reasonFieldsetCurfew.prepend(curfewSubtitle) + reasonFielsetWrapper.appendChild(reasonFieldsetCurfew) + reasonFielsetWrapper.appendChild(reasonFieldsetQuarantine) + appendToForm([...createTitle(), ...formFirstPart, contextWrapper, reasonFielsetWrapper]) } diff --git a/src/js/pdf-util.js b/src/js/pdf-util.js index cc2c0f0..14c5942 100644 --- a/src/js/pdf-util.js +++ b/src/js/pdf-util.js @@ -6,14 +6,14 @@ const ys = { sante: 546, famille: 512, handicap: 478, - judiciaire: 459, - missions: 438, - transit: 404, - animaux: 370, - courses: 304, - sport: 261, - rassemblement: 190, - demarche: 145, + judiciaire: 460, + missions: 410, + transit: 378, + animaux: 343, + courses: 280, + sport: 235, + rassemblement: 167, + demarche: 121, } export async function generatePdf (profile, reasons, pdfBase) { @@ -94,9 +94,9 @@ export async function generatePdf (profile, reasons, pdfBase) { locationSize = 7 } - drawText(profile.city, 103, 112, locationSize) - drawText(`${profile.datesortie}`, 91, 95, 11) - drawText(`${profile.heuresortie}`, 310, 95, 11) + drawText(profile.city, 103, 99, locationSize) + drawText(`${profile.datesortie}`, 91, 83, 11) + drawText(`${profile.heuresortie}`, 310, 83, 11) // const shortCreationDate = `${creationDate.split('/')[0]}/${ // creationDate.split('/')[1] diff --git a/src/robots.txt b/src/robots.txt index 423bf62..025b54c 100644 --- a/src/robots.txt +++ b/src/robots.txt @@ -1 +1 @@ -Sitemap: https://media.interieur.gouv.fr/deplacement-covid-19/sitemap.xml +Sitemap: https://media.interieur.gouv.fr/attestation-deplacement-derogatoire-covid-19/sitemap.xml diff --git a/src/sitemap.xml b/src/sitemap.xml index ba68f98..7fd0a57 100644 --- a/src/sitemap.xml +++ b/src/sitemap.xml @@ -8,20 +8,20 @@ - https://media.interieur.gouv.fr/deplacement-covid-19/ + https://media.interieur.gouv.fr/attestation-deplacement-derogatoire-covid-19/ 2020-04-06T04:22:03+00:00 1.00 - https://media.interieur.gouv.fr/deplacement-covid-19/confidentialite.html + https://media.interieur.gouv.fr/attestation-deplacement-derogatoire-covid-19/confidentialite.html 2020-04-06T04:22:03+00:00 0.80 - https://media.interieur.gouv.fr/deplacement-covid-19/index.html + https://media.interieur.gouv.fr/attestation-deplacement-derogatoire-covid-19/index.html 2020-04-06T04:22:03+00:00 0.64 - \ No newline at end of file +