2019-11-14 02:59:17 +00:00
|
|
|
<template>
|
|
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
|
|
|
|
<div class="dropdown">
|
2019-12-01 21:00:06 +00:00
|
|
|
<button class="btn text-light dropdown-toggle btn-heading" type="button" id="dropdownMenuButton"
|
2019-11-14 02:59:17 +00:00
|
|
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
{{ activeEvent }}
|
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu bg-dark" aria-labelledby="dropdownMenuButton">
|
|
|
|
<a class="dropdown-item text-light" href="#" v-for="(event, index) in events" v-bind:key="index"
|
2019-11-14 03:14:47 +00:00
|
|
|
:class="{ active: event === activeEvent }" @click="changeEvent(event)">{{ event }}</a>
|
2019-11-14 02:59:17 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-11-14 03:24:36 +00:00
|
|
|
<div class="custom-control-inline mr-1">
|
2019-11-14 02:59:17 +00:00
|
|
|
<button type="button" class="btn mx-1 text-nowrap" v-for="(button, index) in buttons" v-bind:key="index" :class="['btn-' + button.color]">
|
2019-11-14 03:28:35 +00:00
|
|
|
<font-awesome-icon :icon="button.icon"/><span class="d-none d-md-inline"> {{ button.title }}</span>
|
2019-11-14 02:59:17 +00:00
|
|
|
</button>
|
2019-11-15 19:00:40 +00:00
|
|
|
<div class="btn-group btn-group-toggle">
|
|
|
|
<button :class="['btn', 'btn-info', { active: layout === 'cards' }]" @click="setLayout('cards')">
|
|
|
|
<font-awesome-icon icon="th"/>
|
|
|
|
</button>
|
|
|
|
<button :class="['btn', 'btn-info', { active: layout === 'table' }]" @click="setLayout('table')">
|
|
|
|
<font-awesome-icon icon="list"/>
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-11-14 02:59:17 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
|
|
|
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
|
<span class="navbar-toggler-icon"></span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<form class="form-inline mt-1 my-lg-auto my-xl-auto w-100 d-inline">
|
|
|
|
<input class="form-control w-100" type="search" placeholder="Search" aria-label="Search">
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
|
|
<ul class="navbar-nav ml-auto">
|
|
|
|
<li class="nav-item" v-for="(link, index) in links" v-bind:key="index">
|
2019-11-29 23:59:04 +00:00
|
|
|
<a class="nav-link text-nowrap" :href="link.path">{{ link.title }}</a>
|
2019-11-14 02:59:17 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</nav>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-11-15 19:00:40 +00:00
|
|
|
import { mapState, mapActions, mapMutations } from 'vuex';
|
2019-11-14 02:59:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Navbar',
|
|
|
|
data: () => ({
|
2019-11-29 23:59:04 +00:00
|
|
|
links: [
|
|
|
|
{'title':'items','path':'/'},
|
|
|
|
{'title':'boxes','path':'/boxes/'},
|
|
|
|
{'title':'mass-edit','path':'#'},
|
|
|
|
{'title':'howto engel','path':'/howto/'}
|
|
|
|
],
|
2019-11-14 02:59:17 +00:00
|
|
|
buttons: [
|
|
|
|
{ title: 'Add', icon: 'plus', color: 'success' },
|
2019-12-01 21:00:06 +00:00
|
|
|
//{ title: 'Refresh', icon: 'sync-alt', color: 'primary' },
|
2019-11-14 02:59:17 +00:00
|
|
|
]
|
|
|
|
}),
|
|
|
|
computed: {
|
2019-11-15 19:00:40 +00:00
|
|
|
...mapState(['events', 'activeEvent', 'layout']),
|
2019-11-14 03:14:47 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2019-11-15 19:00:40 +00:00
|
|
|
...mapActions(['changeEvent']),
|
|
|
|
...mapMutations(['setLayout'])
|
2019-11-14 02:59:17 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
2019-12-01 21:00:06 +00:00
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import "../scss/navbar.scss";
|
|
|
|
</style>
|