Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/Menu.vue
Show All 15 Lines | <nav :id="mode + '-menu'" :class="'navbar navbar-light navbar-expand-' + (mode == 'header' ? 'lg' : 'sm')"> | ||||
:class="'nav-link link-' + item.label" | :class="'nav-link link-' + item.label" | ||||
active-class="active" | active-class="active" | ||||
:to="item.to" | :to="item.to" | ||||
:exact="item.exact" | :exact="item.exact" | ||||
> | > | ||||
{{ menuItemTitle(item) }} | {{ menuItemTitle(item) }} | ||||
</router-link> | </router-link> | ||||
</li> | </li> | ||||
<li class="nav-item" v-if="!loggedIn && $root.isUser && !hasMenuItem('signup')"> | <li class="nav-item" v-if="signupEnabled && !loggedIn && $root.isUser && !hasMenuItem('signup')"> | ||||
<router-link class="nav-link link-signup" active-class="active" :to="{name: 'signup'}">{{ $t('menu.signup') }}</router-link> | <router-link class="nav-link link-signup" active-class="active" :to="{name: 'signup'}">{{ $t('menu.signup') }}</router-link> | ||||
</li> | </li> | ||||
<li class="nav-item" v-if="loggedIn && !hasMenuItem('dashboard')"> | <li class="nav-item" v-if="loggedIn && !hasMenuItem('dashboard')"> | ||||
<router-link class="nav-link link-dashboard" active-class="active" :to="{name: 'dashboard'}">{{ $t('menu.cockpit') }}</router-link> | <router-link class="nav-link link-dashboard" active-class="active" :to="{name: 'dashboard'}">{{ $t('menu.cockpit') }}</router-link> | ||||
</li> | </li> | ||||
<li class="nav-item" v-if="loggedIn"> | <li class="nav-item" v-if="loggedIn"> | ||||
<router-link class="nav-link menulogin link-logout" active-class="active" :to="{name: 'logout'}">{{ $t('menu.logout') }}</router-link> | <router-link class="nav-link menulogin link-logout" active-class="active" :to="{name: 'logout'}">{{ $t('menu.logout') }}</router-link> | ||||
</li> | </li> | ||||
Show All 27 Lines | export default { | ||||
mode: { type: String, default: 'header' }, | mode: { type: String, default: 'header' }, | ||||
footer: { type: String, default: '' } | footer: { type: String, default: '' } | ||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
buildYear: buildDate.getFullYear(), | buildYear: buildDate.getFullYear(), | ||||
copyright: window.config['app.company.copyright'] || '', | copyright: window.config['app.company.copyright'] || '', | ||||
languages: window.config['languages'] || [], | languages: window.config['languages'] || [], | ||||
signupEnabled: window.config['app.with_signup'] || false, | |||||
menuList: [] | menuList: [] | ||||
} | } | ||||
}, | }, | ||||
computed: { | computed: { | ||||
loggedIn() { return !!this.$root.authInfo }, | loggedIn() { return !!this.$root.authInfo }, | ||||
menu() { | menu() { | ||||
// Filter menu by its position on the page, and user authentication state | // Filter menu by its position on the page, and user authentication state | ||||
return this.menuList.filter(item => { | return this.menuList.filter(item => { | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |