accompanyingCourse: ckeditor for comment bloc + sass color variables in app.vue

This commit is contained in:
Mathieu Jaumotte 2021-08-16 20:25:09 +02:00
parent 0abb4983f7
commit 20cdec20d2
3 changed files with 45 additions and 27 deletions

View File

@ -265,6 +265,17 @@ table.table-bordered {
} }
} }
div.metadata {
font-size: smaller;
color: $gray-600;
span.user, span.date {
text-decoration: underline dotted;
&:hover {
color: $gray-700;
}
}
}
/// when there is no data /// when there is no data
.custom_field_no_data, .custom_field_no_data,
.chill-no-data-statement { .chill-no-data-statement {

View File

@ -54,6 +54,9 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import 'ChillMainAssets/module/bootstrap/shared';
$chill-accourse-context: #718596;
div#accompanying-course { div#accompanying-course {
div.vue-component { div.vue-component {
h2 { h2 {
@ -63,7 +66,7 @@ export default {
position: absolute; position: absolute;
content: "\f142"; //ellipsis-v content: "\f142"; //ellipsis-v
font-family: "ForkAwesome"; font-family: "ForkAwesome";
color: #718596ab; color: tint-color($chill-accourse-context, 10%);
left: -22px; left: -22px;
top: 4px; top: 4px;
} }
@ -74,10 +77,10 @@ export default {
} }
padding: 0em 0em; padding: 0em 0em;
margin: 1em 0; margin: 1em 0;
border: 1px dotted #718596ab; border: 1px dotted tint-color($chill-accourse-context, 10%);
border-radius: 5px; border-radius: 5px;
border-left: 1px dotted #718596ab; border-left: 1px dotted tint-color($chill-accourse-context, 10%);
border-right: 1px dotted #718596ab; border-right: 1px dotted tint-color($chill-accourse-context, 10%);
dd { dd {
margin-left: 1em; margin-left: 1em;
} }
@ -87,6 +90,5 @@ export default {
table { table {
} }
} }
}
}
</style> </style>

View File

@ -10,23 +10,22 @@
<div> <div>
<form @submit.prevent="submitform"> <form @submit.prevent="submitform">
<label for="content">{{ $t('comment.label') }}</label> <label class="col-form-label" for="content">{{ $t('comment.label') }}</label>
<div v-if="initialComment"> <ckeditor
{{ $t('comment.created_by', [
initialComment.creator.text,
$d(initialComment.createdAt.datetime, 'long')
]) }}
</div>
<textarea
name="content" name="content"
v-bind:placeholder="$t('comment.content')" v-bind:placeholder="$t('comment.content')"
rows="8" :editor="editor"
cols="80" v-model="content"
ckeditor="ckeditor" tag-name="textarea">
v-model="content"> </ckeditor>
</textarea>
<div v-if="initialComment" class="metadata">
{{ $t('comment.created_by', [
initialComment.creator.text,
$d(initialComment.createdAt.datetime, 'long')
]) }}
</div>
<ul class="record_actions"> <ul class="record_actions">
<li> <li>
@ -47,10 +46,17 @@
</template> </template>
<script> <script>
import CKEditor from '@ckeditor/ckeditor5-vue';
import ClassicEditor from "ChillMainAssets/module/ckeditor5";
export default { export default {
name: "Comment", name: "Comment",
components: {
ckeditor: CKEditor.component,
},
data() { data() {
return { return {
editor: ClassicEditor,
formdata: { formdata: {
type: "accompanying_period_comment", type: "accompanying_period_comment",
content: '' content: ''
@ -66,7 +72,7 @@ export default {
this.formdata.content = value; this.formdata.content = value;
}, },
get() { get() {
return (this.initialComment)? this.initialComment.content : null; return (this.initialComment)? this.initialComment.content : {};
} }
}, },
errors() { errors() {
@ -80,7 +86,7 @@ export default {
}, },
removeComment() { removeComment() {
console.log('remove'); console.log('remove');
this.$store.dispatch('postFirstComment', null); this.$store.dispatch('postFirstComment', {});
} }
} }
} }
@ -88,12 +94,11 @@ export default {
* TODO * TODO
* - [x] delete button in ul record_actions, but not in form * - [x] delete button in ul record_actions, but not in form
* - [ ] display updatedAt => initialComment fetch PATCH content changes MUST NOT change object id !! * - [ ] display updatedAt => initialComment fetch PATCH content changes MUST NOT change object id !!
* - [ ] ckeditor integration
*/ */
</script> </script>
<style lang="scss" scoped> <style lang="scss">
div.vue-component > div { div.ck-editor.ck-reset {
//margin: 1em; margin: 0.6em 0;
} }
</style> </style>