52 lines
1.2 KiB
Vue
52 lines
1.2 KiB
Vue
<script setup="setup">
|
|
|
|
const { etherFetch } = useEtherpadApi()
|
|
|
|
const store = usePojmiStore()
|
|
|
|
const props = defineProps({
|
|
revisionId: String,
|
|
pojem: Object,
|
|
urejanje: Object
|
|
})
|
|
|
|
let naslov = ref(props.pojem.naslov)
|
|
let email = ref('')
|
|
|
|
const oddajPredlog = async data => {
|
|
// @TODO vsebina pada v tekst, testirat
|
|
const resp = await etherFetch('/getText', { padID: props.revisionId })
|
|
store.ustvariPojem({
|
|
title: naslov.value,
|
|
email: email.value,
|
|
text: resp.data.text,
|
|
uuid: props.revisionId
|
|
})
|
|
alert("sprememba predlagana!")
|
|
// @TODO vrni urejanje v navaden prikaz, ko je končano!
|
|
urejanje.set(false)
|
|
}
|
|
|
|
const etherNalozen = ev => {
|
|
window.location.hash = props.revisionId
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<section class="pojem">
|
|
<form class="pojem" @submit.prevent="oddajPredlog">
|
|
<label for="naslov">Naslov</label>
|
|
<input name="naslov" type="text" v-model="naslov">
|
|
|
|
<label for="tekst">Besedilo</label>
|
|
<EtherpadTextarea :onLoad="etherNalozen" :revisionId="props.revisionId" />
|
|
|
|
<label for="email">E-poštni naslov</label>
|
|
<input name="email" type="email" v-model="email">
|
|
|
|
<input type="submit" value="Predlagaj">
|
|
</form>
|
|
</section>
|
|
</template>
|