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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
<template>
<div class="cw-tools cw-tools-admin">
<form class="default" @submit.prevent="">
<fieldset>
<legend><translate>Allgemeine Einstellungen</translate></legend>
<label>
<span><translate>Art der Inhaltsabfolge</translate></span>
<select class="size-s" v-model="currentProgression">
<option value="0"><translate>Frei</translate></option>
<option value="1"><translate>Sequentiell</translate></option>
</select>
</label>
<label>
<span><translate>Editierberechtigung für Tutor/-innen</translate></span>
<select class="size-s" v-model="currentPermissionLevel">
<option value="dozent"><translate>Nein</translate></option>
<option value="tutor"><translate>Ja</translate></option>
</select>
</label>
</fieldset>
</form>
<button class="button" @click="store"><translate>Übernehmen</translate></button>
</div>
</template>
<script>
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'cw-tools-admin',
data() {
return {
currentPermissionLevel: '',
currentProgression: '',
};
},
computed: {
...mapGetters({
courseware: 'courseware',
}),
},
methods: {
...mapActions({
storeCoursewareSettings: 'storeCoursewareSettings',
companionSuccess: 'companionSuccess',
}),
initData() {
this.currentPermissionLevel = this.courseware.attributes['editing-permission-level'];
this.currentProgression = this.courseware.attributes['sequential-progression'] ? '1' : '0';
},
store() {
this.companionSuccess({
info: this.$gettext('Die Einstellungen wurden übernommen.'),
})
this.storeCoursewareSettings({
permission: this.currentPermissionLevel,
progression: this.currentProgression,
});
;
},
},
mounted() {
this.initData();
},
};
</script>
|