2022-07-07 18:23:44 +02:00
|
|
|
|
extends layout
|
|
|
|
|
|
|
|
|
|
block content
|
2022-07-10 22:20:12 +02:00
|
|
|
|
div.column-header__wrapper
|
|
|
|
|
h1.button.column-header Publier un message
|
2022-07-07 18:23:44 +02:00
|
|
|
|
|
2022-07-10 22:38:47 +02:00
|
|
|
|
if message
|
|
|
|
|
p.alert.alert-error=message
|
2022-07-11 17:04:46 +02:00
|
|
|
|
//form(action="/add-to-queue",method="post")
|
|
|
|
|
form(action="/direct-post",method="post")
|
2022-07-10 22:20:12 +02:00
|
|
|
|
span.account
|
2022-09-07 09:57:38 +02:00
|
|
|
|
span="Choix du compte parmi les "
|
2022-07-11 17:04:46 +02:00
|
|
|
|
|
2022-07-10 22:20:12 +02:00
|
|
|
|
br
|
2022-09-07 09:57:38 +02:00
|
|
|
|
div.images
|
2024-09-03 11:56:02 +02:00
|
|
|
|
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
|
2022-09-07 09:57:38 +02:00
|
|
|
|
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
|
2022-07-10 22:20:12 +02:00
|
|
|
|
div.compose-form__autosuggest-wrapper
|
|
|
|
|
.autosuggest-textarea
|
|
|
|
|
label
|
2022-07-11 17:04:46 +02:00
|
|
|
|
span Content warning (optionnel)
|
2022-09-07 10:04:24 +02:00
|
|
|
|
input.cw-input.autosuggest-textarea__textarea(name="cw", type="text", width="500", height="2em")
|
2022-07-10 22:20:12 +02:00
|
|
|
|
span Qu’avez-vous en tête ?
|
2022-09-07 10:04:24 +02:00
|
|
|
|
textarea.main-input.autosuggest-textarea__textarea(name="message", width="500", lines="20",autofocus="autofocus")
|
2022-07-10 22:20:12 +02:00
|
|
|
|
br
|
2023-07-03 23:12:20 +02:00
|
|
|
|
|
2022-07-11 17:04:46 +02:00
|
|
|
|
fieldset.wip
|
2023-07-03 23:12:20 +02:00
|
|
|
|
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)
|
2022-07-11 17:04:46 +02:00
|
|
|
|
input.input.checkbox(type="checkbox", value=false, name="scheduled_at_bool")
|
2023-07-03 23:12:20 +02:00
|
|
|
|
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)
|
2022-07-10 22:20:12 +02:00
|
|
|
|
br
|
|
|
|
|
div.composer--publisher
|
2022-07-11 17:04:46 +02:00
|
|
|
|
//input.button.primary(type="submit", value="ajouter à la file d'attente")
|
|
|
|
|
input.button.primary(type="submit", value="poster tout de suite")
|
2022-07-11 17:45:28 +02:00
|
|
|
|
|
|
|
|
|
script.
|
|
|
|
|
function selectAccount(somePseudo) {
|
|
|
|
|
console.log('account selected', document.querySelector('#author_select').value)
|
2022-09-07 09:57:38 +02:00
|
|
|
|
let selector=document.querySelector('#author_select');
|
|
|
|
|
selector.value = somePseudo
|
|
|
|
|
selector.classList.add("changed")
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
selector.classList.remove("changed")
|
|
|
|
|
},500)
|
2022-07-11 17:45:28 +02:00
|
|
|
|
console.log('account changed', somePseudo)
|
|
|
|
|
}
|
2023-07-03 23:12:20 +02:00
|
|
|
|
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)
|
|
|
|
|
}
|
2022-07-11 17:45:28 +02:00
|
|
|
|
|
2024-09-03 11:56:02 +02:00
|
|
|
|
console.log('script loaded')
|