#167 [pl][nouns] split dictionaries into subpages - show menu on subpages - fixes

This commit is contained in:
Avris 2021-01-17 22:05:06 +01:00
parent 7c53be1776
commit 05da3fbe83
7 changed files with 26 additions and 43 deletions

View File

@ -1,18 +1,18 @@
<template> <template>
<section> <section>
<div class="d-none d-md-inline-flex btn-group btn-block mb-2"> <div class="d-none d-md-inline-flex btn-group btn-block mb-2">
<a v-for="{name, icon, route} in links" :href="`/${config.nouns.route}/${route}`" <router-link v-for="{name, icon, route} in links" :to="buildRoute(route)"
:class="['btn', $route.fullPath === `/${encodeURIComponent(config.nouns.route)}/${encodeURIComponent(route)}` ? 'btn-primary' : 'btn-outline-primary']"> :class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
<Icon :v="icon"/> <Icon :v="icon"/>
<T>nouns.{{name}}.header</T> <T>nouns.{{name}}.header</T>
</a> </router-link>
</div> </div>
<div class="d-block d-md-none btn-group-vertical btn-block mb-2"> <div class="d-block d-md-none btn-group-vertical btn-block mb-2">
<a v-for="{name, icon, route} in links" :href="`/${config.nouns.route}/${route}`" <router-link v-for="{name, icon, route} in links" :to="buildRoute(route)"
:class="['btn', $route.fullPath === `/${encodeURIComponent(config.nouns.route)}/${encodeURIComponent(route)}` ? 'btn-primary' : 'btn-outline-primary']"> :class="['btn', isActiveRoute(route) ? 'btn-primary' : 'btn-outline-primary']">
<Icon :v="icon"/> <Icon :v="icon"/>
<T>nouns.{{name}}.header</T> <T>nouns.{{name}}.header</T>
</a> </router-link>
</div> </div>
</section> </section>
</template> </template>
@ -38,5 +38,13 @@
links, links,
}; };
}, },
methods: {
buildRoute(route) {
return `/${this.config.nouns.route}/${route}`;
},
isActiveRoute(route) {
return decodeURIComponent(this.$route.fullPath) === this.buildRoute(route);
},
}
} }
</script> </script>

View File

@ -1,16 +1,11 @@
<template> <template>
<div> <div>
<h2>
<Icon v="book"/>
<T>nouns.headerLonger</T>
</h2>
<NounsNav/> <NounsNav/>
<h3> <h2>
<Icon v="ghost"/> <Icon v="ghost"/>
<T>nouns.dukajNouns.header</T> <T>nouns.dukajNouns.header</T>
</h3> </h2>
<div class="d-flex flex-column flex-md-row"> <div class="d-flex flex-column flex-md-row">
<div> <div>

View File

@ -1,16 +1,11 @@
<template> <template>
<div> <div>
<h2>
<Icon v="book"/>
<T>nouns.headerLonger</T>
</h2>
<NounsNav/> <NounsNav/>
<h3> <h2>
<Icon v="deer"/> <Icon v="deer"/>
<T>nouns.neuterNouns.header</T> <T>nouns.neuterNouns.header</T>
</h3> </h2>
<div class="d-flex flex-column flex-md-row"> <div class="d-flex flex-column flex-md-row">
<div> <div>

View File

@ -1,17 +1,12 @@
<template> <template>
<div> <div>
<h2>
<Icon v="book"/>
<T>nouns.headerLonger</T>
</h2>
<NounsNav/> <NounsNav/>
<h3> <h2>
<Icon v="user-friends"/> <Icon v="user-friends"/>
<T>nouns.personNouns.header</T> <T>nouns.personNouns.header</T>
<small><NormativeBadge/></small> <small><NormativeBadge/></small>
</h3> </h2>
<section> <section>
<T>nouns.personNouns.info</T> <T>nouns.personNouns.info</T>

View File

@ -1,16 +1,11 @@
<template> <template>
<div> <div>
<h2>
<Icon v="book"/>
<T>nouns.headerLonger</T>
</h2>
<NounsNav/> <NounsNav/>
<h3> <h2>
<Icon v="book-heart"/> <Icon v="book-heart"/>
<T>nouns.inclusive.headerLong</T> <T>nouns.inclusive.headerLong</T>
</h3> </h2>
<section> <section>
<T>nouns.inclusive.info</T> <T>nouns.inclusive.info</T>

View File

@ -1,12 +1,12 @@
<template> <template>
<div> <div>
<NounsNav/>
<h2> <h2>
<Icon v="book"/> <Icon v="book"/>
<T>nouns.headerLonger</T> <T>nouns.headerLonger</T>
</h2> </h2>
<NounsNav/>
<section> <section>
<T>nouns.intro</T> <T>nouns.intro</T>

View File

@ -1,16 +1,11 @@
<template> <template>
<div> <div>
<h2>
<Icon v="book"/>
<T>nouns.headerLonger</T>
</h2>
<NounsNav/> <NounsNav/>
<h3> <h2>
<Icon v="flag"/> <Icon v="flag"/>
<T>nouns.terms.headerLong</T> <T>nouns.terms.headerLong</T>
</h3> </h2>
<section> <section>
<T>nouns.terms.info</T> <T>nouns.terms.info</T>