Skip to content
Snippets Groups Projects
Commit 5c7cc0e5 authored by Viktoria Wiebe's avatar Viktoria Wiebe Committed by Jan-Hendrik Willms
Browse files

add companion info for table of contents block with zero sub pages, fixes #2083

Closes #2083

Merge request studip/studip!1705
parent e5903a78
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
@closeEdit="initCurrentData" @closeEdit="initCurrentData"
> >
<template #content> <template #content>
<div v-if="childElementsWithTasks.length > 0">
<div v-if="currentStyle !== 'tiles' && currentTitle !== ''" class="cw-block-title">{{ currentTitle }}</div> <div v-if="currentStyle !== 'tiles' && currentTitle !== ''" class="cw-block-title">{{ currentTitle }}</div>
<ul <ul
v-if="currentStyle === 'list-details' || currentStyle === 'list'" v-if="currentStyle === 'list-details' || currentStyle === 'list'"
...@@ -65,6 +66,13 @@ ...@@ -65,6 +66,13 @@
</router-link> </router-link>
</li> </li>
</ul> </ul>
</div>
<courseware-companion-box
v-if="viewMode === 'edit' && childElementsWithTasks.length === 0"
:msgCompanion="$gettext('Es sind noch keine Unterseiten vorhanden. ' +
'Sobald Sie weitere Unterseiten anlegen, erscheinen diese automatisch hier im Inhaltsverzeichnis.')"
mood="pointing"
/>
</template> </template>
<template v-if="canEdit" #edit> <template v-if="canEdit" #edit>
<form class="default" @submit.prevent=""> <form class="default" @submit.prevent="">
...@@ -89,6 +97,7 @@ ...@@ -89,6 +97,7 @@
<script> <script>
import CoursewareDefaultBlock from './CoursewareDefaultBlock.vue'; import CoursewareDefaultBlock from './CoursewareDefaultBlock.vue';
import CoursewareCompanionBox from './CoursewareCompanionBox.vue';
import { blockMixin } from './block-mixin.js'; import { blockMixin } from './block-mixin.js';
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
...@@ -97,6 +106,7 @@ export default { ...@@ -97,6 +106,7 @@ export default {
mixins: [blockMixin], mixins: [blockMixin],
components: { components: {
CoursewareDefaultBlock, CoursewareDefaultBlock,
CoursewareCompanionBox,
}, },
props: { props: {
block: Object, block: Object,
...@@ -117,6 +127,7 @@ export default { ...@@ -117,6 +127,7 @@ export default {
taskById: 'courseware-tasks/byId', taskById: 'courseware-tasks/byId',
userById: 'users/byId', userById: 'users/byId',
groupById: 'status-groups/byId', groupById: 'status-groups/byId',
viewMode: 'viewMode',
}), }),
structuralElement() { structuralElement() {
return this.structuralElementById({ id: this.$route.params.id }); return this.structuralElementById({ id: this.$route.params.id });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment