|
|
|
|
@ -4,7 +4,17 @@
@@ -4,7 +4,17 @@
|
|
|
|
|
import MarkdownEditor from './MarkdownEditor.svelte'; |
|
|
|
|
import TimeStampInput from './TimeStampInput.svelte'; |
|
|
|
|
|
|
|
|
|
let { record = null, onSet = time => {} } = $props(); |
|
|
|
|
let { record = null, onAbort = () => {}, onDrop = time_id => {}, onSet = time => {} } = $props(); |
|
|
|
|
|
|
|
|
|
function cancel(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
onAbort(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function drop(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
if (confirm(t('confirm_delete',{element:record.subject}))) onDrop(record.id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function onsubmit(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
@ -14,7 +24,7 @@
@@ -14,7 +24,7 @@
|
|
|
|
|
|
|
|
|
|
{#if record} |
|
|
|
|
<form {onsubmit}> |
|
|
|
|
<fieldset> |
|
|
|
|
<fieldset class="time record"> |
|
|
|
|
<legend>{t('edit_object',{object:t('record')})}</legend> |
|
|
|
|
<label> |
|
|
|
|
{t('subject')} |
|
|
|
|
@ -33,6 +43,8 @@
@@ -33,6 +43,8 @@
|
|
|
|
|
<MarkdownEditor simple={true} bind:value={record.description} /> |
|
|
|
|
</label> |
|
|
|
|
<button type="submit">{t('save')}</button> |
|
|
|
|
<button class="cancel" onclick={cancel} >{t('cancel')}</button> |
|
|
|
|
<button class="delete" onclick={drop} >{t('delete')}</button> |
|
|
|
|
</fieldset> |
|
|
|
|
</form> |
|
|
|
|
{record.description.source} |
|
|
|
|
|