#139 [terms] dictionary of queer terms

This commit is contained in:
Andrea Vos 2020-12-18 18:22:35 +01:00
parent 6fb24c4b58
commit 15a4aac07b
6 changed files with 85 additions and 47 deletions

View File

@ -1,5 +1,9 @@
<template> <template>
<span :title="alt"> <a v-if="link" :href="`/${config.nouns.route}#${config.nouns.terms.hashNamespace}/${link}`" :title="alt">
<img :src="img" alt=""/>
{{ name }}
</a>
<span v-else :title="alt">
<img :src="img" alt=""/> <img :src="img" alt=""/>
{{ name }} {{ name }}
</span> </span>
@ -11,6 +15,25 @@
name: { required: true }, name: { required: true },
alt: { required: true }, alt: { required: true },
img: { required: true }, img: { required: true },
terms: { 'default': [] },
},
computed: {
link() {
if (!this.config.nouns.terms.enabled) {
return null;
}
for (let term of this.terms) {
if (term.term.toLowerCase().includes(this.name.toLowerCase())) {
return this.name;
}
if (term.original.toLowerCase().includes(this.alt.toLowerCase())) {
return this.alt;
}
}
return null;
},
}, },
} }
</script> </script>

View File

@ -60,6 +60,10 @@ nouns:
declension: false declension: false
submit: true submit: true
templates: true templates: true
inclusive:
enabled: false
terms:
enabled: false
names: names:
enabled: false enabled: false

View File

@ -71,9 +71,11 @@ nouns:
templates: true templates: true
hashNamespace: 'neutratywy' hashNamespace: 'neutratywy'
inclusive: inclusive:
enabled: false
categories: ['interpłciowość', 'lgbtq+', 'niepełnosprawność', 'rasa', 'trans'] categories: ['interpłciowość', 'lgbtq+', 'niepełnosprawność', 'rasa', 'trans']
hashNamespace: 'inkluzywny' hashNamespace: 'inkluzywny'
terms: terms:
enabled: false
hashNamespace: 'terminologia' hashNamespace: 'terminologia'
names: names:

View File

@ -229,51 +229,51 @@
</div> </div>
</details> </details>
<!-- <template v-if="config.nouns.inclusive.enabled">
<Separator icon="atom-alt"/> <Separator icon="atom-alt"/>
<h3 :id="$t('nouns.inclusive.id')"> <h3 :id="$t('nouns.inclusive.id')">
<Icon v="book-heart"/> <Icon v="book-heart"/>
<T>nouns.inclusive.headerLong</T> <T>nouns.inclusive.headerLong</T>
</h3> </h3>
<T>nouns.inclusive.info</T> <T>nouns.inclusive.info</T>
<details class="border mb-3" ref="inclusivedictionarywrapper"> <details class="border mb-3" ref="inclusivedictionarywrapper">
<summary class="bg-light p-3" @click="$refs.inclusivedictionary.loadEntries()"> <summary class="bg-light p-3" @click="$refs.inclusivedictionary.loadEntries()">
<h4 class="h5 d-inline"> <h4 class="h5 d-inline">
<Icon v="book-heart"/> <Icon v="book-heart"/>
<T>nouns.inclusive.headerLong</T> <T>nouns.inclusive.headerLong</T>
</h4> </h4>
</summary> </summary>
<div class="border-top"> <div class="border-top">
<InclusiveDictionary ref="inclusivedictionary"/> <InclusiveDictionary ref="inclusivedictionary"/>
</div> </div>
</details> </details>
--> </template>
<!-- <template v-if="config.nouns.terms.enabled">
<Separator icon="atom-alt"/> <Separator icon="atom-alt"/>
<h3 :id="$t('nouns.terms.id')"> <h3 :id="$t('nouns.terms.id')">
<Icon v="flag"/> <Icon v="flag"/>
<T>nouns.terms.headerLong</T> <T>nouns.terms.headerLong</T>
</h3> </h3>
<T>nouns.terms.info</T> <T>nouns.terms.info</T>
<details class="border mb-3" ref="termsdictionarywrapper"> <details class="border mb-3" ref="termsdictionarywrapper">
<summary class="bg-light p-3" @click="$refs.termsdictionary.loadEntries()"> <summary class="bg-light p-3" @click="$refs.termsdictionary.loadEntries()">
<h4 class="h5 d-inline"> <h4 class="h5 d-inline">
<Icon v="flag"/> <Icon v="flag"/>
<T>nouns.terms.headerLong</T> <T>nouns.terms.headerLong</T>
</h4> </h4>
</summary> </summary>
<div class="border-top"> <div class="border-top">
<TermsDictionary ref="termsdictionary"/> <TermsDictionary ref="termsdictionary"/>
</div> </div>
</details> </details>
--> </template>
</div> </div>
</template> </template>

View File

@ -18,14 +18,22 @@
<script> <script>
export default { export default {
data() { data() {
const links = {
neuterNouns: 'deer',
dukajNouns: 'ghost',
personNouns: 'user-friends',
}
if (this.config.nouns.inclusive.enabled) {
links['inclusive'] = 'book-heart';
}
if (this.config.nouns.terms.enabled) {
links['terms'] = 'flag';
}
return { return {
links: { links,
neuterNouns: 'deer',
dukajNouns: 'ghost',
personNouns: 'user-friends',
// inclusive: 'book-heart',
// terms: 'flag',
}
}; };
}, },
} }

View File

@ -43,7 +43,7 @@
<section v-if="profile.flags.length"> <section v-if="profile.flags.length">
<ul class="list-inline"> <ul class="list-inline">
<li v-for="flag in profile.flags" v-if="allFlags[flag]" class="list-inline-item pr-2"> <li v-for="flag in profile.flags" v-if="allFlags[flag]" class="list-inline-item pr-2">
<Flag :name="flag.startsWith('-') ? allFlags[flag] : $translateForPronoun(allFlags[flag], mainPronoun)" :alt="allFlags[flag]" :img="`/flags/${flag}.png`"/> <Flag :name="flag.startsWith('-') ? allFlags[flag] : $translateForPronoun(allFlags[flag], mainPronoun)" :alt="allFlags[flag]" :img="`/flags/${flag}.png`" :terms="terms"/>
</li> </li>
</ul> </ul>
</section> </section>
@ -136,6 +136,7 @@
async asyncData({ app, route }) { async asyncData({ app, route }) {
return { return {
profiles: await app.$axios.$get(`/profile/get/${encodeURIComponent(route.params.pathMatch)}`), profiles: await app.$axios.$get(`/profile/get/${encodeURIComponent(route.params.pathMatch)}`),
terms: await app.$axios.$get(`/terms`),
}; };
}, },
computed: { computed: {