extends layout block content div.column-header__wrapper h1.button.column-header Publier un message if message p.alert.alert-error=message //form(action="/add-to-queue",method="post") form(action="/direct-post",method="post") span.account span="Choix du compte parmi les " br div.images if accounts_to_select each val, index in accounts_to_select div.clickable(onclick=`selectAccount('${val.value}')`) img.account__avatar-overlay(src=`${val.src}`) br span=val.label br select(method="post", name="author", value=bodyReq ? bodyReq.author : "", id="author_select") each val, index in accounts_to_select option(value=val.value) span=val.label div.compose-form__autosuggest-wrapper .autosuggest-textarea label span Content warning (optionnel) input.cw-input.autosuggest-textarea__textarea(name="cw", type="text", width="500", height="2em") span Qu’avez-vous en tête ? textarea.main-input.autosuggest-textarea__textarea(name="message", width="500", lines="20",autofocus="autofocus") br fieldset.wip label span Fichier à joindre (optionnel) input.file-input.autosuggest-textarea__textarea(name="fichier", type="file") h2 schedule label Select day in the future div.day_spans each val, index in [1,2,3,4,5] div.clickable(onclick=`selectDay('${val}')`) span.time_spans_choice=val label Select time span div.time_spans each val, index in time_spans_choices div.clickable(onclick=`selectTime('${val}')`) span.time_spans_choice=val label Schedule in time (work in progress) input.input.checkbox(type="checkbox", value=false, name="scheduled_at_bool") input.input.checkbox(type="date", name="scheduled_at", value=schedule_day) input.input.checkbox(type="text", id="scheduled_at_time", name="scheduled_at_time",value=schedule_time) br div.composer--publisher //input.button.primary(type="submit", value="ajouter à la file d'attente") input.button.primary(type="submit", value="poster tout de suite") script. function selectAccount(somePseudo) { console.log('account selected', document.querySelector('#author_select').value) let selector=document.querySelector('#author_select'); selector.value = somePseudo selector.classList.add("changed") setTimeout(()=>{ selector.classList.remove("changed") },500) console.log('account changed', somePseudo) } function selectTime(someTime){ let selector=document.querySelector('#scheduled_at_time'); selector.value = someTime selector.classList.add("changed") setTimeout(()=>{ selector.classList.remove("changed") },500) console.log('account changed', somePseudo) } console.log('script loaded')