2023-06-15 20:45:38 +02:00
|
|
|
<script setup="setup">
|
2023-11-12 22:55:24 +01:00
|
|
|
|
2023-12-16 01:53:05 +01:00
|
|
|
const { etherFetch } = useEtherpadApi()
|
2023-11-12 22:55:24 +01:00
|
|
|
|
2023-06-15 20:45:38 +02:00
|
|
|
const store = usePojmiStore()
|
|
|
|
|
|
|
|
const props = defineProps({
|
2023-12-16 01:53:05 +01:00
|
|
|
revisionId: String,
|
|
|
|
pojem: Object,
|
|
|
|
urejanje: Object
|
2023-06-15 20:45:38 +02:00
|
|
|
})
|
|
|
|
|
2023-12-16 01:53:05 +01:00
|
|
|
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)
|
2023-06-15 20:45:38 +02:00
|
|
|
}
|
|
|
|
|
2023-11-12 22:55:24 +01:00
|
|
|
const etherNalozen = ev => {
|
|
|
|
window.location.hash = props.revisionId
|
|
|
|
}
|
|
|
|
|
2023-06-15 20:45:38 +02:00
|
|
|
</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>
|
2023-11-12 22:55:24 +01:00
|
|
|
<EtherpadTextarea :onLoad="etherNalozen" :revisionId="props.revisionId" />
|
2023-06-15 20:45:38 +02:00
|
|
|
|
|
|
|
<label for="email">E-poštni naslov</label>
|
|
|
|
<input name="email" type="email" v-model="email">
|
|
|
|
|
|
|
|
<input type="submit" value="Predlagaj">
|
|
|
|
</form>
|
|
|
|
</section>
|
|
|
|
</template>
|