Skip to content
Snippets Groups Projects
Commit bb3ccef4 authored by Ron Lucke's avatar Ron Lucke
Browse files

TIC #3112

Closes #3112

Merge request studip/studip!2353
parent f693995e
No related branches found
No related tags found
No related merge requests found
......@@ -281,41 +281,43 @@
<option value="other"><translate>Sonstiges</translate></option>
</select>
</label>
<label>
<translate>Lizenztyp</translate>
<select v-model="currentElement.attributes.payload.license_type">
<option v-for="license in licenses" :key="license.id" :value="license.id">
{{ license.name }}
</option>
</select>
</label>
<label>
<translate>Geschätzter zeitlicher Aufwand</translate>
<input type="text" v-model="currentElement.attributes.payload.required_time" />
</label>
<label>
<translate>Niveau</translate><br />
<translate>von</translate>
<select v-model="currentElement.attributes.payload.difficulty_start">
<option
v-for="difficulty_start in 12"
:key="difficulty_start"
:value="difficulty_start"
>
{{ difficulty_start }}
</option>
</select>
<translate>bis</translate>
<select v-model="currentElement.attributes.payload.difficulty_end">
<option
v-for="difficulty_end in 12"
:key="difficulty_end"
:value="difficulty_end"
>
{{ difficulty_end }}
</option>
</select>
</label>
<template v-if="currentElement.attributes.purpose === 'oer'">
<label>
<translate>Lizenztyp</translate>
<select v-model="currentElement.attributes.payload.license_type">
<option v-for="license in licenses" :key="license.id" :value="license.id">
{{ license.name }}
</option>
</select>
</label>
<label>
<translate>Geschätzter zeitlicher Aufwand</translate>
<input type="text" v-model="currentElement.attributes.payload.required_time" />
</label>
<label>
<translate>Niveau</translate><br />
<translate>von</translate>
<select v-model="currentElement.attributes.payload.difficulty_start">
<option
v-for="difficulty_start in 12"
:key="difficulty_start"
:value="difficulty_start"
>
{{ difficulty_start }}
</option>
</select>
<translate>bis</translate>
<select v-model="currentElement.attributes.payload.difficulty_end">
<option
v-for="difficulty_end in 12"
:key="difficulty_end"
:value="difficulty_end"
>
{{ difficulty_end }}
</option>
</select>
</label>
</template>
</form>
</courseware-tab>
<courseware-tab :name="textEdit.image" :index="2">
......
......@@ -113,33 +113,35 @@
<option value="other">{{ $gettext('Sonstiges') }}</option>
</select>
</label>
<label>
{{ $gettext('Lizenztyp') }}
<select v-model="license_type">
<option v-for="license in licenses" :key="license.id" :value="license.id">
{{ license.name }}
</option>
</select>
</label>
<label>
{{ $gettext('Geschätzter zeitlicher Aufwand') }}
<input type="text" v-model="required_time" />
</label>
<label>
{{ $gettext('Niveau') }}<br />
{{ $gettext('von') }}
<select v-model="difficulty_start">
<option v-for="difficulty_start in 12" :key="difficulty_start" :value="difficulty_start">
{{ difficulty_start }}
</option>
</select>
{{ $gettext('bis') }}
<select v-model="difficulty_end">
<option v-for="difficulty_end in 12" :key="difficulty_end" :value="difficulty_end">
{{ difficulty_end }}
</option>
</select>
</label>
<template v-if="purposeIsOer">
<label>
{{ $gettext('Lizenztyp') }}
<select v-model="license_type">
<option v-for="license in licenses" :key="license.id" :value="license.id">
{{ license.name }}
</option>
</select>
</label>
<label>
{{ $gettext('Geschätzter zeitlicher Aufwand') }}
<input type="text" v-model="required_time" />
</label>
<label>
{{ $gettext('Niveau') }}<br />
{{ $gettext('von') }}
<select v-model="difficulty_start">
<option v-for="difficulty_start in 12" :key="difficulty_start" :value="difficulty_start">
{{ difficulty_start }}
</option>
</select>
{{ $gettext('bis') }}
<select v-model="difficulty_end">
<option v-for="difficulty_end in 12" :key="difficulty_end" :value="difficulty_end">
{{ difficulty_end }}
</option>
</select>
</label>
</template>
</form>
</template>
</studip-wizard-dialog>
......@@ -249,6 +251,9 @@ export default {
hasTemplates() {
return this.templates.length > 0;
},
purposeIsOer() {
return this.purpose === 'oer';
},
},
methods: {
...mapActions({
......@@ -302,10 +307,10 @@ export default {
payload: {
description: this.description,
color: this.color,
license_type: this.license_type,
required_time: this.required_time,
difficulty_start: this.difficulty_start,
difficulty_end: this.difficulty_end,
license_type: this.purposeIsOer ? this.license_type : '',
required_time: this.purposeIsOer ? this.required_time : '',
difficulty_start: this.purposeIsOer ? this.difficulty_start : '',
difficulty_end: this.purposeIsOer ? this.difficulty_end : '',
},
},
templateId: this.selectedTemplate ? this.selectedTemplate.id : null,
......
......@@ -91,41 +91,43 @@
<option value="other">{{ $gettext('Sonstiges') }}</option>
</select>
</label>
<label>
{{ $gettext('Lizenztyp') }}
<select v-model="addWizardData.license_type">
<option v-for="license in licenses" :key="license.id" :value="license.id">
{{ license.name }}
</option>
</select>
</label>
<label>
{{ $gettext('Geschätzter zeitlicher Aufwand') }}
<input type="text" v-model="addWizardData.required_time" />
</label>
<label>
{{ $gettext('Niveau') }}<br />
{{ $gettext('von') }}
<select v-model="addWizardData.difficulty_start">
<option
v-for="difficulty_start in 12"
:key="difficulty_start"
:value="difficulty_start"
>
{{ difficulty_start }}
</option>
</select>
{{ $gettext('bis') }}
<select v-model="addWizardData.difficulty_end">
<option
v-for="difficulty_end in 12"
:key="difficulty_end"
:value="difficulty_end"
>
{{ difficulty_end }}
</option>
</select>
</label>
<template v-if="purposeIsOer">
<label>
{{ $gettext('Lizenztyp') }}
<select v-model="addWizardData.license_type">
<option v-for="license in licenses" :key="license.id" :value="license.id">
{{ license.name }}
</option>
</select>
</label>
<label>
{{ $gettext('Geschätzter zeitlicher Aufwand') }}
<input type="text" v-model="addWizardData.required_time" />
</label>
<label>
{{ $gettext('Niveau') }}<br />
{{ $gettext('von') }}
<select v-model="addWizardData.difficulty_start">
<option
v-for="difficulty_start in 12"
:key="difficulty_start"
:value="difficulty_start"
>
{{ difficulty_start }}
</option>
</select>
{{ $gettext('bis') }}
<select v-model="addWizardData.difficulty_end">
<option
v-for="difficulty_end in 12"
:key="difficulty_end"
:value="difficulty_end"
>
{{ difficulty_end }}
</option>
</select>
</label>
</template>
</form>
</template>
</studip-wizard-dialog>
......@@ -183,7 +185,10 @@ export default {
},
colors() {
return this.mixinColors.filter(color => color.darkmode);
}
},
purposeIsOer() {
return this.addWizardData.purpose === 'oer';
},
},
mounted() {
this.initAddWizardData();
......@@ -243,10 +248,10 @@ export default {
payload: {
description: this.addWizardData.description,
color: this.addWizardData.color,
license_type: this.addWizardData.license_type,
required_time: this.addWizardData.required_time,
difficulty_start: this.addWizardData.difficulty_start,
difficulty_end: this.addWizardData.difficulty_end
license_type: this.purposeIsOer ? this.addWizardData.license_type : '',
required_time: this.purposeIsOer ? this.addWizardData.required_time : '',
difficulty_start: this.purposeIsOer ? this.addWizardData.difficulty_start : '',
difficulty_end: this.purposeIsOer ? this.addWizardData.difficulty_end : ''
}
},
relationships: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment