Implement flexible page footer links

This commit is contained in:
Wolfgang Huß 2021-06-02 20:16:52 +02:00
parent d7b888f7b2
commit 1bd4af6fd3
20 changed files with 118 additions and 21 deletions

View File

@ -1,23 +1,51 @@
<template>
<div id="footer" class="ds-footer">
<a :href="links.ORGANIZATION" target="_blank" v-html="$t('site.made')"></a>
<!-- made with -->
<a :href="links.ORGANIZATION" target="_blank">
{{ $t('site.made') }}
</a>
<span>-</span>
<nuxt-link to="/imprint">
<!-- imprint -->
<nuxt-link v-if="noLinkDefined(links.IMPRINT)" to="/imprint">
{{ $t('site.imprint') }}
</nuxt-link>
<a v-else :href="links.IMPRINT" target="_blank">
{{ $t('site.imprint') }}
</a>
<span>-</span>
<nuxt-link to="/terms-and-conditions">{{ $t('site.termsAndConditions') }}</nuxt-link>
<!-- terms and conditions -->
<nuxt-link v-if="noLinkDefined(links.TERMS_AND_CONDITIONS)" to="/terms-and-conditions">
{{ $t('site.termsAndConditions') }}
</nuxt-link>
<a v-else :href="links.TERMS_AND_CONDITIONS" target="_blank">
{{ $t('site.termsAndConditions') }}
</a>
<span>-</span>
<nuxt-link to="/code-of-conduct">{{ $t('site.code-of-conduct') }}</nuxt-link>
<!-- code of conduct -->
<nuxt-link v-if="noLinkDefined(links.CODE_OF_CONDUCT)" to="/code-of-conduct">
{{ $t('site.code-of-conduct') }}
</nuxt-link>
<a v-else :href="links.CODE_OF_CONDUCT" target="_blank">
{{ $t('site.code-of-conduct') }}
</a>
<span>-</span>
<nuxt-link to="/data-privacy">
<!-- data privacy -->
<nuxt-link v-if="noLinkDefined(links.DATA_PRIVACY)" to="/data-privacy">
{{ $t('site.data-privacy') }}
</nuxt-link>
<a v-else :href="links.DATA_PRIVACY" target="_blank">
{{ $t('site.data-privacy') }}
</a>
<span>-</span>
<a :href="links.FAQ" target="_blank">
<!-- faq -->
<nuxt-link v-if="noLinkDefined(links.FAQ)" to="/faq">
{{ $t('site.faq') }}
</nuxt-link>
<a v-else :href="links.FAQ" target="_blank">
{{ $t('site.faq') }}
</a>
<span>-</span>
<!-- version -->
<a
href="https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/CHANGELOG.md"
target="_blank"
@ -29,10 +57,16 @@
<script>
import links from '~/constants/links.js'
export default {
data() {
return { links, version: `v${this.$env.VERSION}` }
},
methods: {
noLinkDefined(link) {
return !link || link.length === 0
},
},
}
</script>

View File

@ -771,7 +771,7 @@
"faq": "FAQ",
"germany": "Deutschland",
"imprint": "Impressum",
"made": "Mit &#10084; gemacht",
"made": "Mit ❤️ gemacht",
"register": "Registernummer",
"responsible": "Verantwortlich für Inhalte dieser Seite (§ 55 Abs. 2 RStV)",
"taxident": "Umsatzsteuer-Identifikationsnummer gemäß § 27 a Umsatzsteuergesetz (Deutschland)",

View File

@ -771,7 +771,7 @@
"faq": "FAQ",
"germany": "Germany",
"imprint": "Imprint",
"made": "Made with &#10084;",
"made": "Made with ❤️",
"register": "Registry number",
"responsible": "responsible for contents of this page (§ 55 Abs. 2 RStV)",
"taxident": "USt-ID. according to §27a of the German Sales Tax Law:",

View File

@ -694,7 +694,7 @@
"faq": "Preguntas más frecuentes",
"germany": "Alemania",
"imprint": "Pie de imprenta",
"made": "Hecho con &#10084;",
"made": "Hecho con ❤️",
"register": "Número de registro",
"responsible": "Responsable según § 55 Abs. 2 RStV (Alemania)",
"taxident": "Número de identificación del impuesto sobre el valor añadido según el § 27 a de la Ley del Impuesto sobre el Valor Añadido (Alemania)",

View File

@ -662,7 +662,7 @@
"faq": "FAQ",
"germany": "Allemagne",
"imprint": "Mentions légales",
"made": "Fabriqué avec &#10084;",
"made": "Fabriqué avec ❤️",
"register": "Numéro de registre",
"responsible": "Responsable selon § 55 Abs. 2 RStV (Allemagne)",
"taxident": "Numéro d'identification à la taxe sur la valeur ajoutée selon § 27 a de la loi sur la taxe sur la valeur ajoutée (Allemagne)",

View File

@ -0,0 +1 @@
<p>Hier stehen die FAQs</p>

View File

@ -1,11 +1,13 @@
import termsAndConditions from './terms-and-conditions.html'
import codeOfConduct from './code-of-conduct.html'
import dataPrivacy from './data-privacy.html'
import faq from './faq.html'
import imprint from './imprint.html'
export default {
termsAndConditions,
codeOfConduct,
dataPrivacy,
faq,
imprint,
}

View File

@ -0,0 +1 @@
<p>Here are the FAQs</p>

View File

@ -1,11 +1,13 @@
import termsAndConditions from './terms-and-conditions.html'
import codeOfConduct from './code-of-conduct.html'
import dataPrivacy from './data-privacy.html'
import faq from './faq.html'
import imprint from './imprint.html'
export default {
termsAndConditions,
codeOfConduct,
dataPrivacy,
faq,
imprint,
}

View File

@ -612,7 +612,7 @@
"faq": null,
"germany": "Germania",
"imprint": "Impressum",
"made": "Con &#10084; fatto",
"made": "Con ❤️ fatto",
"register": "numero di registro",
"responsible": "Responsabile ai sensi del § 55 Abs. 2 RStV (Germania)",
"taxident": "Numero di identificazione dell'imposta sul valore aggiunto ai sensi del § 27 a Legge sull'imposta sul valore aggiunto (Germania)",

View File

@ -165,7 +165,7 @@
"director": "Directeur",
"germany": "Duitsland",
"imprint": "Afdruk",
"made": "Met &#10084; gemaakt",
"made": "Met ❤️ gemaakt",
"register": "inschrijfnummer",
"responsible": "Verantwoordelijk volgens § 55 Abs. 2 RStV (Duitsland).",
"taxident": "Identificatienummer voor de belasting over de toegevoegde waarde overeenkomstig § 27 a Wet op de belasting over de toegevoegde waarde (Duitsland).",

View File

@ -350,7 +350,7 @@
"director": "Dyrektor zarządzający",
"germany": "Niemcy",
"imprint": "Nadruk",
"made": "Z &#10084; zrobiony",
"made": "Z ❤️ zrobiony",
"register": "numer rejestracyjny",
"responsible": "Odpowiedzialny zgodnie z § 55 Abs. 2 RStV (Niemcy)",
"taxident": "Numer identyfikacyjny podatku od wartości dodanej zgodnie z § 27 a Ustawa o podatku od wartości dodanej (Niemcy)",

View File

@ -647,7 +647,7 @@
"faq": "FAQ",
"germany": "Alemanha",
"imprint": "Impressão",
"made": "Feito com &#10084;",
"made": "Feito com ❤️",
"register": "número de registo",
"responsible": "Responsável segundo § 55 Abs. 2 RStV (Alemanha) ",
"taxident": "Número de identificação do imposto sobre o valor acrescentado de acordo com o § 27 da Lei do Imposto sobre o Valor Acrescentado (Alemanha)",

View File

@ -694,7 +694,7 @@
"faq": "ЧаВо (FAQ)",
"germany": "Германия",
"imprint": "Импрессум",
"made": "Сделано с &#10084;",
"made": "Сделано с ❤️",
"register": "Регистрационный номер",
"responsible": "ответственный за содержание этой страницы (§ 55 Abs. 2 RStV)",
"taxident": "UST-ID. в соответствии с §27a Закона о налоге с продаж Германии:",

View File

@ -1,6 +1,6 @@
<template>
<div>
<ds-space>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.code-of-conduct') }}</ds-heading>
</ds-space>
<ds-container>

View File

@ -1,9 +1,8 @@
<template>
<div>
<ds-space>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.data-privacy') }}</ds-heading>
</ds-space>
<ds-container>
<div v-html="$t('html.dataPrivacy')" />
</ds-container>

38
webapp/pages/faq.spec.js Normal file
View File

@ -0,0 +1,38 @@
import { mount } from '@vue/test-utils'
import Faq from './faq.vue'
import VueMeta from 'vue-meta'
const localVue = global.localVue
localVue.use(VueMeta, { keyName: 'head' })
describe('faq.vue', () => {
let wrapper
let mocks
beforeEach(() => {
mocks = {
$t: (t) => t,
}
})
describe('mount', () => {
const Wrapper = () => {
return mount(Faq, {
mocks,
localVue,
})
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.is('div')).toBe(true)
})
it('has correct <head> content', () => {
expect(wrapper.vm.$metaInfo.title).toBe('site.faq')
})
})
})

21
webapp/pages/faq.vue Normal file
View File

@ -0,0 +1,21 @@
<template>
<div>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.faq') }}</ds-heading>
</ds-space>
<ds-container>
<div v-html="$t('html.faq')" />
</ds-container>
</div>
</template>
<script>
export default {
layout: 'basic',
head() {
return {
title: this.$t('site.faq'),
}
},
}
</script>

View File

@ -1,9 +1,8 @@
<template>
<div>
<ds-space>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.imprint') }}</ds-heading>
</ds-space>
<ds-container>
<div v-html="$t('html.imprint')" />
</ds-container>

View File

@ -1,6 +1,6 @@
<template>
<div>
<ds-space>
<ds-space margin="small">
<ds-heading tag="h2">{{ $t('site.termsAndConditions') }}</ds-heading>
</ds-space>
<ds-container>