Skip to content
Snippets Groups Projects
Commit 66da36dc authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

show visibility toggle on content modules administration page only for courses, fixes #4420

Closes #4420

Merge request studip/studip!3244
parent 87c7968d
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,9 @@ class Course_ContentmodulesController extends AuthenticatedController
$this->render_vue_app(
Studip\VueApp::create('ContentModules')
->withProps([
'range-type' => get_class($this->sem),
])
->withStore('ContentModulesStore', 'contentmodules', [
'setCategories' => $this->categories,
'setHighlighted' => $this->highlighted_modules,
......
......@@ -36,6 +36,7 @@
<component :is="displayComponent"
:modules="modules"
:filtercategory="filterCategory"
:range-type="rangeType"
></component>
<MountingPortal mount-to="#tool-view-switch .sidebar-widget-content .widget-list" name="sidebar-switch">
......
......@@ -61,7 +61,7 @@
href="#"
class="toggle_visibility"
role="checkbox"
v-if="!module.mandatory"
v-if="showVisibilityToggle(module)"
:aria-checked="module.visibility !== 'tutor' ? 'true' : 'false'"
@click.prevent="toggleModuleVisibility(module)"
>
......
......@@ -59,7 +59,7 @@
<td class="actions">
<a
href="#"
v-if="module.active && !module.mandatory"
v-if="showVisibilityToggle(module)"
role="checkbox"
:aria-checked="module.visibility !== 'tutor' ? 'true' : 'false'"
@click.prevent="toggleModuleVisibility(module)"
......@@ -121,7 +121,6 @@ import ContentModulesMixin from '../mixins/ContentModulesMixin.js';
export default {
name: 'contentmodules-edit-table',
mixins: [ContentModulesMixin],
};
</script>
......
......@@ -5,6 +5,9 @@ export default {
components: {
draggable,
},
props: {
rangeType: String,
},
data: () => ({
order: [],
}),
......@@ -132,5 +135,10 @@ export default {
return classes.join(' ');
},
showVisibilityToggle(module) {
return this.rangeType !== 'Institute'
&& module.active
&& !module.mandatory;
}
},
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment