Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/Menu.vue
Show All 17 Lines | <nav :id="mode + '-menu'" class="navbar navbar-expand-lg navbar-light"> | ||||
:class="'nav-link link-' + item.index" | :class="'nav-link link-' + item.index" | ||||
active-class="active" | active-class="active" | ||||
:to="item.to" | :to="item.to" | ||||
:exact="item.exact" | :exact="item.exact" | ||||
> | > | ||||
{{ item.title }} | {{ item.title }} | ||||
</router-link> | </router-link> | ||||
</li> | </li> | ||||
<li class="nav-item" v-if="!loggedIn"> | <li class="nav-item" v-if="!loggedIn && !$root.isAdmin"> | ||||
<router-link v-if="!$root.isAdmin && $root.hasRoute('signup')" class="nav-link link-signup" active-class="active" :to="{name: 'signup'}">Signup</router-link> | <router-link class="nav-link link-signup" active-class="active" :to="{name: 'signup'}">Signup</router-link> | ||||
<a v-else class="nav-link link-signup" :href="appUrl + '/signup'">Signup</a> | |||||
</li> | </li> | ||||
<li class="nav-item" v-if="loggedIn"> | <li class="nav-item" v-if="loggedIn"> | ||||
<router-link v-if="$root.hasRoute('dashboard')" class="nav-link link-dashboard" active-class="active" :to="{name: 'dashboard'}">Cockpit</router-link> | <router-link class="nav-link link-dashboard" active-class="active" :to="{name: 'dashboard'}">Cockpit</router-link> | ||||
<a v-else class="nav-link link-dashboard" :href="appUrl + '/dashboard'">Cockpit</a> | |||||
</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'}">Logout</router-link> | <router-link class="nav-link menulogin link-logout" active-class="active" :to="{name: 'logout'}">Logout</router-link> | ||||
</li> | </li> | ||||
<li class="nav-item" v-if="!loggedIn"> | <li class="nav-item" v-if="!loggedIn"> | ||||
<a class="nav-link menulogin link-login" :href="appUrl + '/login'">Login</a> | <router-link class="nav-link menulogin link-login" :to="{name: 'login'}">Login</router-link> | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
<div v-if="mode == 'footer'" class="footer"> | <div v-if="mode == 'footer'" class="footer"> | ||||
<div id="footer-copyright">@ Apheleia IT AG, 2020</div> | <div id="footer-copyright">@ Apheleia IT AG, 2020</div> | ||||
<div v-if="footer" id="footer-company">{{ footer }}</div> | <div v-if="footer" id="footer-company">{{ footer }}</div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</nav> | </nav> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
export default { | export default { | ||||
props: { | props: { | ||||
mode: { type: String, default: 'header' }, | mode: { type: String, default: 'header' }, | ||||
footer: { type: String, default: '' } | footer: { type: String, default: '' } | ||||
}, | }, | ||||
data() { | data() { | ||||
return { | return { | ||||
appName: window.config['app.name'], | appName: window.config['app.name'], | ||||
appUrl: window.config['app.url'], | appUrl: window.config['app.url'], | ||||
themeDir: '/themes/' + window.config['app.theme'], | themeDir: '/themes/' + window.config['app.theme'] | ||||
webmailURL: window.config['app.webmail_url'] | |||||
} | } | ||||
}, | }, | ||||
computed: { | computed: { | ||||
loggedIn() { return this.$store.state.isLoggedIn }, | loggedIn() { return this.$store.state.isLoggedIn }, | ||||
route() { return this.$route.name } | route() { return this.$route.name } | ||||
}, | }, | ||||
mounted() { | mounted() { | ||||
// On mobile close the menu when the menu item is clicked | // On mobile close the menu when the menu item is clicked | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |