2020-11-16 13:22:04 -08:00
|
|
|
<template>
|
2021-05-13 04:54:13 -07:00
|
|
|
<section class="mt-4 mt-lg-0">
|
2021-01-22 14:54:24 -08:00
|
|
|
<div class="d-none d-md-inline-flex btn-group btn-block mb-2 w-100">
|
2021-01-19 11:41:10 -08:00
|
|
|
<router-link v-for="{name, icon, route} in links" :key="name"
|
|
|
|
:to="buildRoute(route)"
|
2021-01-17 13:05:06 -08:00
|
|
|
:class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
|
2020-11-17 10:21:49 -08:00
|
|
|
<Icon :v="icon"/>
|
2021-08-28 14:44:30 -07:00
|
|
|
<T>{{name}}</T>
|
2021-01-17 13:05:06 -08:00
|
|
|
</router-link>
|
2020-11-17 10:21:49 -08:00
|
|
|
</div>
|
2021-01-22 14:54:24 -08:00
|
|
|
<div class="d-block d-md-none btn-group-vertical btn-block mb-2 w-100">
|
2021-01-19 11:41:10 -08:00
|
|
|
<router-link v-for="{name, icon, route} in links" :key="name"
|
|
|
|
:to="buildRoute(route)"
|
2021-01-17 13:05:06 -08:00
|
|
|
:class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
|
2020-11-17 10:21:49 -08:00
|
|
|
<Icon :v="icon"/>
|
2021-08-28 14:44:30 -07:00
|
|
|
<T>{{name}}</T>
|
2021-01-17 13:05:06 -08:00
|
|
|
</router-link>
|
2020-11-17 10:21:49 -08:00
|
|
|
</div>
|
2020-11-16 13:22:04 -08:00
|
|
|
</section>
|
|
|
|
</template>
|
2020-11-17 10:21:49 -08:00
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
2021-01-17 11:43:21 -08:00
|
|
|
const links = [
|
2021-08-28 14:44:30 -07:00
|
|
|
{name: 'nouns.neuterNouns.header', icon: 'deer', route: 'neutratywy'},
|
|
|
|
{name: 'nouns.dukajNouns.header', icon: 'ghost', route: 'dukatywy'},
|
|
|
|
{name: 'nouns.personNouns.header', icon: 'user-friends', route: 'osobatywy'},
|
|
|
|
{name: 'nouns.xNouns.header', icon: 'comment-times', route: 'iksatywy'},
|
2021-01-17 11:43:21 -08:00
|
|
|
];
|
2020-12-18 09:22:35 -08:00
|
|
|
|
2021-08-28 14:44:30 -07:00
|
|
|
if (this.config.inclusive.enabled) {
|
|
|
|
links.push({name: 'inclusive.header', icon: 'book-heart', route: this.config.inclusive.route});
|
2020-12-18 09:22:35 -08:00
|
|
|
}
|
|
|
|
|
2021-08-28 14:44:30 -07:00
|
|
|
if (this.config.terminology.enabled) {
|
|
|
|
links.push({name: 'terminology.header', icon: 'flag', route: this.config.terminology.route});
|
2020-12-18 09:22:35 -08:00
|
|
|
}
|
|
|
|
|
2020-11-17 10:21:49 -08:00
|
|
|
return {
|
2020-12-18 09:22:35 -08:00
|
|
|
links,
|
2020-11-17 10:21:49 -08:00
|
|
|
};
|
|
|
|
},
|
2021-01-17 13:05:06 -08:00
|
|
|
methods: {
|
|
|
|
buildRoute(route) {
|
2021-08-28 14:51:45 -07:00
|
|
|
return `/${route}`;
|
2021-01-17 13:05:06 -08:00
|
|
|
},
|
|
|
|
isActiveRoute(route) {
|
2021-07-02 13:32:23 -07:00
|
|
|
let current = decodeURIComponent(this.$route.fullPath).replace(/\/$/, '');
|
|
|
|
if (current.includes('#')) {
|
|
|
|
current = current.substring(0, current.indexOf('#'));
|
|
|
|
}
|
|
|
|
return current === this.buildRoute(route).replace(/\/$/, '');
|
2021-01-17 13:05:06 -08:00
|
|
|
},
|
2021-05-03 07:15:48 -07:00
|
|
|
},
|
2020-11-17 10:21:49 -08:00
|
|
|
}
|
|
|
|
</script>
|