Commit cf85aa3c authored by janis.streib's avatar janis.streib 🦉
Browse files

FIX: better vidible menu evaluation

parent 9a79cd84
......@@ -16,23 +16,26 @@
<div class="links">
<div v-for="(group, key) in links" :key="key" class="my-2">
<div v-for="link in group" :key="key + link.label + link.address">
<div v-if="!$store.state.show_sidebar_left" class="link-button-wrapper">
<button class="link-button" :id="'sidenavbar-link-button-' + key + link.label"
:class="{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}"
@click.stop="navigate(link.address)">
<span class="sidebar-icon"><font-awesome-icon :icon="link.icon"/></span>
</button>
<b-popover :target="'sidenavbar-link-button-' + key + link.label" class="popover-wide" triggers="hover" placement="right" container="sideNavbar"
:content="link.label" boundary="window" custom-class="popover-wide"/>
</div>
<div v-if="$store.state.show_sidebar_left" class="link-button-wrapper">
<button class="link-button"
:class="{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}"
@click.stop="navigate(link.address)">
<span class="sidebar-icon"><font-awesome-icon :icon="link.icon"/></span>
{{ link.label }}
</button>
</div>
<template v-if="!('visible' in link) || link.visible()">
<div v-if="!$store.state.show_sidebar_left" class="link-button-wrapper">
<button class="link-button" :id="'sidenavbar-link-button-' + key + link.label"
:class="{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}"
@click.stop="navigate(link.address)">
<span class="sidebar-icon"><font-awesome-icon :icon="link.icon"/></span>
</button>
<b-popover :target="'sidenavbar-link-button-' + key + link.label" class="popover-wide" triggers="hover"
placement="right" container="sideNavbar"
:content="link.label" boundary="window" custom-class="popover-wide"/>
</div>
<div v-if="$store.state.show_sidebar_left" class="link-button-wrapper">
<button class="link-button"
:class="{'active': link.has_sub_pages? $route.path.startsWith(link.address):$route.path === link.address}"
@click.stop="navigate(link.address)">
<span class="sidebar-icon"><font-awesome-icon :icon="link.icon"/></span>
{{ link.label }}
</button>
</div>
</template>
</div>
<hr>
</div>
......@@ -84,7 +87,9 @@ export default {
label: 'Organisationseinheitstypen',
address: '/org/type',
icon: ['far', 'building'],
visible: 'org.rw_oet' in this.$store.state.xup_perm
visible() {
return this.$store.state.xup_perm != null && 'org.rw_oet' in this.$store.state.xup_perm
}
},
{ has_sub_pages: true, label: 'Gruppen', address: '/cntl/groups', icon: 'users' }
],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment