This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/locale/pl/nouns/NounsNav.vue

58 lines
2.2 KiB
Vue
Raw Normal View History

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)"
:class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
<Icon :v="icon"/>
<T>nouns.{{name}}.header</T>
</router-link>
</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)"
:class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
<Icon :v="icon"/>
<T>nouns.{{name}}.header</T>
</router-link>
</div>
2020-11-16 13:22:04 -08:00
</section>
</template>
<script>
export default {
data() {
const links = [
{name: 'neuterNouns', icon: 'deer', route: 'neutratywy'},
{name: 'dukajNouns', icon: 'ghost', route: 'dukatywy'},
{name: 'personNouns', icon: 'user-friends', route: 'osobatywy'},
2021-08-05 04:28:05 -07:00
{name: 'xNouns', icon: 'comment-times', route: 'iksatywy'},
];
2020-12-18 09:22:35 -08:00
if (this.config.nouns.inclusive.enabled) {
links.push({name: 'inclusive', icon: 'book-heart', route: this.config.nouns.inclusive.route});
2020-12-18 09:22:35 -08:00
}
if (this.config.nouns.terms.enabled) {
links.push({name: 'terms', icon: 'flag', route: this.config.nouns.terms.route});
2020-12-18 09:22:35 -08:00
}
return {
2020-12-18 09:22:35 -08:00
links,
};
},
methods: {
buildRoute(route) {
return `/${this.config.nouns.route}/${route}`;
},
isActiveRoute(route) {
let current = decodeURIComponent(this.$route.fullPath).replace(/\/$/, '');
if (current.includes('#')) {
current = current.substring(0, current.indexOf('#'));
}
return current === this.buildRoute(route).replace(/\/$/, '');
},
2021-05-03 07:15:48 -07:00
},
}
</script>