aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/components/courseware/structural-element/CoursewareEmptyElementBox.vue
blob: c8dcd311d1f7d25f5a3224904da344698ef3c2c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
    <div class="cw-welcome-screen">
        <courseware-companion-box :msgCompanion="this.$gettext('Es wurden bisher noch keine Inhalte eingepflegt.')">
            <template v-slot:companionActions>
                <button v-if="canEdit && noContainers" class="button" @click="addNewContainer">
                    {{ $gettext('Einen Abschnitt hinzufügen') }}
                </button>
            </template>
        </courseware-companion-box>
    </div>
</template>

<script>
import CoursewareCompanionBox from '../layouts/CoursewareCompanionBox.vue';
import containerMixin from '@/vue/mixins/courseware/container';

export default {
    name: 'courseware-empty-element-box',
    components: {
        CoursewareCompanionBox,
    },
    mixins: [containerMixin],
    props: {
        canEdit: Boolean,
        noContainers: Boolean,
    },
    methods: {
        addNewContainer() {
            this.addContainer({
                type: 'list',
                colspan: 'full',
                sections: {
                    firstSection: ''
                },
                newPosition: null
            });
        },
    },
};
</script>