Cover pages
This commit is contained in:
parent
a69e6c702f
commit
816e74b35f
BIN
content/assets/pages/11c02a40-6caf-4b8f-8fea-115299695929.png
Normal file
BIN
content/assets/pages/11c02a40-6caf-4b8f-8fea-115299695929.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
@ -6,6 +6,7 @@ ac_choices:
|
|||||||
- "[Un crin de la licorne retrouvée morte dans la forêt interdite plus loin dans l'histoire](/pages/1er-quiz/erreur)"
|
- "[Un crin de la licorne retrouvée morte dans la forêt interdite plus loin dans l'histoire](/pages/1er-quiz/erreur)"
|
||||||
- "[Une plume d'un phénix dont on ne connait pas le nom ni l'histoire](/pages/1er-quiz/erreur)"
|
- "[Une plume d'un phénix dont on ne connait pas le nom ni l'histoire](/pages/1er-quiz/erreur)"
|
||||||
- "[Une écaille de Nagini, le serpent de Voldemort](/pages/1er-quiz/erreur)"
|
- "[Une écaille de Nagini, le serpent de Voldemort](/pages/1er-quiz/erreur)"
|
||||||
|
featured_image: ../../../../assets/pages/11c02a40-6caf-4b8f-8fea-115299695929.png
|
||||||
---
|
---
|
||||||
|
|
||||||
Qu'y a-t-il à l'intérieur de la baguette d'Harry?
|
Qu'y a-t-il à l'intérieur de la baguette d'Harry?
|
||||||
|
@ -29,8 +29,8 @@ document.querySelectorAll('aside#actions #delete')
|
|||||||
document.querySelectorAll('aside#actions input#cover')
|
document.querySelectorAll('aside#actions input#cover')
|
||||||
.forEach(elt => elt.onchange = () => {
|
.forEach(elt => elt.onchange = () => {
|
||||||
const header = document.querySelector('body > header')
|
const header = document.querySelector('body > header')
|
||||||
const url = `/assets/users/${uuid()}.${elt.files[0].name.split('.').reverse()[0]}`
|
const url = `/assets/${elt.dataset.section}/${uuid()}.${elt.files[0].name.split('.').reverse()[0]}`
|
||||||
const body = `featured_image: ../..${url}`
|
const body = `featured_image: ../../../..${url}`
|
||||||
|
|
||||||
fetch(`/edit${url}`, { method: 'PUT', body: elt.files[0] })
|
fetch(`/edit${url}`, { method: 'PUT', body: elt.files[0] })
|
||||||
.then(() => fetch(`${document.body.dataset.editUrl}.prop`, { method: 'PUT', body: body }))
|
.then(() => fetch(`${document.body.dataset.editUrl}.prop`, { method: 'PUT', body: body }))
|
||||||
|
@ -4,6 +4,7 @@ delete: 🗑 Supprimer
|
|||||||
|
|
||||||
pages:
|
pages:
|
||||||
create: 📝 Créer un nouveau quiz
|
create: 📝 Créer un nouveau quiz
|
||||||
|
cover: 🖼️ Couverture
|
||||||
delete: 🗑 Supprimer quiz
|
delete: 🗑 Supprimer quiz
|
||||||
users:
|
users:
|
||||||
create: 👤 Créer un nouveau joueur
|
create: 👤 Créer un nouveau joueur
|
||||||
|
@ -9,8 +9,16 @@
|
|||||||
{{- partial "tags.html" . -}}
|
{{- partial "tags.html" . -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<aside class="w-30-l mt6-l">
|
<aside id="actions" class="w-30-l mt6-l">
|
||||||
{{- partial "menu-contextual.html" . -}}
|
{{- partial "menu-contextual.html" . -}}
|
||||||
|
|
||||||
|
{{ $user := eq .Section "users" }}
|
||||||
|
{{ if not $user }}
|
||||||
|
<button class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer">
|
||||||
|
<label for="cover">{{ T (print .Section ".cover") }}</label>
|
||||||
|
</button>
|
||||||
|
<input id="cover" name="cover" type="file" data-section="{{ .Section }}"/>
|
||||||
|
{{ end }}
|
||||||
</aside>
|
</aside>
|
||||||
</article>
|
</article>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<button class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer">
|
<button class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer">
|
||||||
<label for="cover">{{ T (print .Section ".cover") }}</label>
|
<label for="cover">{{ T (print .Section ".cover") }}</label>
|
||||||
</button>
|
</button>
|
||||||
<input id="cover" name="cover" type="file"/>
|
<input id="cover" name="cover" type="file" data-section="{{ .Section }}"/>
|
||||||
|
|
||||||
<button id="delete"
|
<button id="delete"
|
||||||
class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer"
|
class="br-pill f6 link dim pa3 mb2 dib white bg-dark-gray pointer"
|
||||||
|
Loading…
Reference in New Issue
Block a user