removeComment button replaced by link

that allows to keep it both inside <form> and in <ul class="record_actions">
This commit is contained in:
Mathieu Jaumotte 2021-05-19 15:58:38 +02:00
parent 30b127bc88
commit c39097f164
2 changed files with 42 additions and 35 deletions

View File

@ -7,6 +7,7 @@
TODO fix errors flashbag for app component TODO fix errors flashbag for app component
</div--> </div-->
<div>
<div v-if="initialComment"> <div v-if="initialComment">
créé par {{ initialComment.creator.text }} créé par {{ initialComment.creator.text }}
le {{ $d(initialComment.createdAt.datetime, 'long') }} le {{ $d(initialComment.createdAt.datetime, 'long') }}
@ -17,6 +18,7 @@
</div> </div>
<form @submit.prevent="submitform"> <form @submit.prevent="submitform">
<label for="content">{{ $t('comment.label') }}</label>
<textarea <textarea
name="content" name="content"
v-bind:placeholder="$t('comment.content')" v-bind:placeholder="$t('comment.content')"
@ -29,16 +31,15 @@
<li> <li>
<button type="submit" class="sc-button bt-save">{{ $t('action.save') }}</button> <button type="submit" class="sc-button bt-save">{{ $t('action.save') }}</button>
</li> </li>
<li id="xyz"> <li v-if="initialComment !== null">
<a class="sc-button bt-delete"
@click="removeComment">
{{ $t('action.delete') }}
</a>
</li> </li>
</ul> </ul>
</form> </form>
</div>
<button v-if="initialComment !== null"
class="sc-button bt-delete"
@click="removeComment">
{{ $t('action.delete') }}
</button>
</div> </div>
</template> </template>
@ -83,9 +84,14 @@ export default {
} }
/* /*
* TODO * TODO
* - patch endpoint to update Content * - [x] delete button in ul record_actions, but not in form
* - delete/reset button ? * - [ ] display updatedAt => initialComment fetch PATCH content changes MUST NOT change object id !!
* - manage flash messages => specific component ? * - [ ] ckeditor integration
* - ckeditor
*/ */
</script> </script>
<style lang="scss" scoped>
div.vue-component > div {
margin: 1em;
}
</style>

View File

@ -64,7 +64,8 @@ const appMessages = {
add_resources: "Ajouter des interlocuteurs", add_resources: "Ajouter des interlocuteurs",
}, },
comment: { comment: {
title: "Ajout d'une note", title: "Observations",
label: "Ajout d'une première note",
content: "Rédigez une première note..." content: "Rédigez une première note..."
}, },
confirm: { confirm: {