Skip to content
Snippets Groups Projects

Resolve "Add simple course book list"

Merged Hangzhi Yu requested to merge 256-add-simple-course-book-list into master
Compare and Show latest version
23 files
+ 1472
23
Compare changes
  • Side-by-side
  • Inline
Files
23
<template>
<v-card class="my-1 full-width">
<v-card-title v-if="!compact">
<lesson-information v-bind="documentationPartProps" />
</v-card-title>
<!-- flex-md-row zeile ab medium -->
<!-- align-stretch - stretch full-width -->
<v-card-text
class="full-width d-flex flex-column align-stretch pa-2"
:class="{ 'flex-md-row': compact }"
>
<lesson-information v-if="compact" :class="{ 'flex-110': !$vuetify.breakpoint.mobile }" v-bind="documentationPartProps" />
<lesson-summary
:class="{ 'flex-110': compact && !$vuetify.breakpoint.mobile }"
ref="summary"
v-bind="{ ...$attrs, ...documentationPartProps }"
:is-create="false"
:gql-patch-mutation="documentationsMutation"
@open="$emit('open')"
@loading="loading = $event"
@save="$emit('close')"
/>
<lesson-notes :class="{ 'flex-110': compact && !$vuetify.breakpoint.mobile }" v-bind="documentationPartProps" />
</v-card-text>
<v-divider />
<v-card-actions v-if="!compact">
<v-spacer />
<cancel-button v-if="documentation.canEdit" @click="$emit('close')" :disabled="loading" />
<save-button v-if="documentation.canEdit" @click="save" :loading="loading" />
<cancel-button v-if="!documentation.canEdit" i18n-key="actions.close" @click="$emit('close')"/>
</v-card-actions>
</v-card>
</template>
<script>
import LessonInformation from "./LessonInformation.vue";
import LessonSummary from "./LessonSummary.vue";
import LessonNotes from "./LessonNotes.vue";
import SaveButton from "aleksis.core/components/generic/buttons/SaveButton.vue";
import CancelButton from "aleksis.core/components/generic/buttons/CancelButton.vue";
import { createOrUpdateDocumentations } from "../coursebook.graphql";
import documentationPartMixin from "./documentationPartMixin";
export default {
name: "Documentation",
components: {
LessonInformation,
LessonSummary,
LessonNotes,
SaveButton,
CancelButton,
},
emits: ["open", "close"],
mixins: [documentationPartMixin],
data() {
return {
loading: false,
documentationsMutation: createOrUpdateDocumentations,
};
},
methods: {
save() {
this.$refs.summary.save();
this.$emit("close");
},
},
};
</script>
<style scoped>
.flex-110 {
flex: 1 1 0;
width: 0;
}
</style>
Loading