diff --git a/bin/acoeur.conf b/bin/acoeur.conf index 520b74a..dc75029 100644 --- a/bin/acoeur.conf +++ b/bin/acoeur.conf @@ -5,6 +5,16 @@ ServerSignature Off Protocols h2 h2c http/1.1 DocumentRoot /var/simpleWeb/apps/acoeur/public + + Require all granted + # Send back all headers, most importantly the eventual "authorization" one + Header always echo + # Do not send a 404 + Redirect 204 / + + # For development + Header always set authorization "test" + diff --git a/config.yaml b/config.yaml index 23cdab8..e92a653 100644 --- a/config.yaml +++ b/config.yaml @@ -1,6 +1,7 @@ title: moteur acoeur languageCode: fr theme: [acoeur, ananke] +baseURL: http://acoeur DefaultContentLanguage: fr enableRobotsTXT: true diff --git a/themes/acoeur/assets/ananke/css/custom.css b/themes/acoeur/assets/ananke/css/custom.css index bc003fb..6e6779d 100644 --- a/themes/acoeur/assets/ananke/css/custom.css +++ b/themes/acoeur/assets/ananke/css/custom.css @@ -1,5 +1,5 @@ * { - transition: box-shadow 1s; + transition: all 1s; } .breadcrumb { @@ -36,6 +36,10 @@ dd { font-weight: bold; } +body.choosing { + background-color: black; +} + body [contenteditable]:hover, body [contenteditable]:focus, body #content:hover, @@ -46,9 +50,8 @@ body #content:focus { background-color: rgba(255, 255, 255, 0.5); } -body.invitations .ac_choices { - display: none; -} +.author-only { display: none; } +body.author .author-only { display: initial; } body.author .ac_choices .destination { display: none; position: relative; diff --git a/themes/acoeur/assets/js/author.js b/themes/acoeur/assets/js/author.js index 882bef5..e5f04b6 100644 --- a/themes/acoeur/assets/js/author.js +++ b/themes/acoeur/assets/js/author.js @@ -9,14 +9,16 @@ document.querySelectorAll('aside#actions #create') }) document.querySelectorAll('aside#actions #delete') - .forEach(elt => elt.onclick = () => - fetch(document.body.dataset.editUrl.replace('/_index', '.delete'), { method: 'PUT' }) - .then(() => sleep(1)) - .then(() => window.location.assign('/' + topSection)) - .catch(error => console.error(`Error deleting #{topSection}`, error))) + .forEach(elt => elt.onclick = () => { + if (confirm(elt.dataset.confirm)) + fetch(document.body.dataset.editUrl.replace('/_index', '.delete'), { method: 'PUT' }) + .then(() => sleep(1)) + .then(() => window.location.assign('/' + topSection)) + .catch(error => console.error(`Error deleting #{topSection}`, error)) + }) -document.querySelectorAll('body.assets aside#actions input#file') +document.querySelectorAll('aside#actions input#file') .forEach(elt => elt.onchange = () => [...elt.files].forEach(file => fetch(document.body.dataset.editUrl.replace('_index', file.name), { method: 'PUT', body: file }) diff --git a/themes/acoeur/assets/js/choice.js b/themes/acoeur/assets/js/choice.js index 9d44ca4..a8c1344 100644 --- a/themes/acoeur/assets/js/choice.js +++ b/themes/acoeur/assets/js/choice.js @@ -1,13 +1,12 @@ -const resultUrl = '/users/' + window.location.pathname.split('/')[2] - document.querySelectorAll('body.users .ac_choice input[type=radio]') .forEach(elt => elt.onchange = () => fetch(document.body.dataset.editUrl + '.choice', { method: 'PUT', body: new URLSearchParams(new FormData(elt.form)) }) + .then(() => document.body.classList.add('choosing')) .then(() => sleep(1)) .then(() => fetch(document.body.dataset.editUrl + '.result')) .then(response => response.text()) - .then(result => window.location.assign(resultUrl + result)) + .then(result => window.location.assign('/users/' + window.location.pathname.split('/')[2] + result)) .catch(error => console.error('Error sending answer', error))) diff --git a/themes/acoeur/i18n/fr.yaml b/themes/acoeur/i18n/fr.yaml index 84f20e9..c48a2b5 100644 --- a/themes/acoeur/i18n/fr.yaml +++ b/themes/acoeur/i18n/fr.yaml @@ -8,6 +8,7 @@ pages: users: create: Créer un nouvel utilisateur delete: Supprimer utilisateur + send: Envoyer invitation assets: create: Transmettre une image delete: 🗑 diff --git a/themes/acoeur/layouts/_default/list.html b/themes/acoeur/layouts/_default/list.html index 4c2767e..d6e28eb 100644 --- a/themes/acoeur/layouts/_default/list.html +++ b/themes/acoeur/layouts/_default/list.html @@ -2,9 +2,21 @@