Forked from
Stud.IP / Stud.IP
2227 commits behind the upstream repository.
-
Jan-Hendrik Willms authored
Closes #2071 Merge request studip/studip!1557
Jan-Hendrik Willms authoredCloses #2071 Merge request studip/studip!1557
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
MyCoursesSidebarSwitch.vue 1.04 KiB
<template>
<ul class="widget-list widget-links sidebar-views">
<li :class="{ active: tableView }">
<a href="#" @click.prevent="setTiledView(false)">
{{ $gettext('Tabellarische Ansicht') }}
</a>
</li>
<li :class="{ active: tilesView }">
<a href="#" @click.prevent="setTiledView(true)">
{{ $gettext('Kachelansicht') }}
</a>
</li>
</ul>
</template>
<script>
import Sidebar from "../../assets/javascripts/lib/sidebar.js";
import MyCoursesMixin from '../mixins/MyCoursesMixin.js';
export default {
name: 'my-courses-sidebar-switch',
mixins: [MyCoursesMixin],
computed: {
tableView () {
return !this.getViewConfig('tiled');
},
tilesView () {
return this.getViewConfig('tiled');
},
},
methods: {
setTiledView (state) {
this.updateViewConfig('tiled', state).then(() => {
Sidebar.close();
});
}
},
};
</script>