[terms] hide terms in versions where they should be unpublished

This commit is contained in:
Avris 2021-08-08 19:36:12 +02:00
parent 52c8bac795
commit 173d877e47
3 changed files with 5 additions and 3 deletions

View File

@ -29,12 +29,12 @@
},
computed: {
link() {
if (!this.config.nouns.terms.enabled) {
if (!this.config.nouns.terms.enabled || !(this.config.nouns.terms.published || this.$isGranted('terms'))) {
return null;
}
for (let term of this.terms || []) {
if (term.key.toLowerCase().includes(this.alt.toLowerCase())) {
if (term.key && term.key.toLowerCase().includes(this.alt.toLowerCase())) {
return term.key;
}
if (term.term.toLowerCase().includes(this.name.toLowerCase())) {

View File

@ -91,6 +91,7 @@ nouns:
route: 'inkluzywny'
terms:
enabled: true
published: true
categories:
- 'orientacja seksualna'
- 'orientacja romantyczna'

View File

@ -1,5 +1,5 @@
<template>
<div>
<div v-if="config.nouns.terms.published || $isGranted('terms')">
<NounsNav/>
<h2>
@ -14,6 +14,7 @@
<TermsDictionary load ref="termsdictionary"/>
</div>
<NotFound v-else/>
</template>
<script>