refactor: reduce code on settings/embeds

This commit is contained in:
roschaefer 2019-10-10 19:29:35 +02:00
parent c3b2b4fcac
commit 465a46c8d4
3 changed files with 51 additions and 63 deletions

View File

@ -228,16 +228,19 @@
},
"embeds": {
"name": "Drittanbieter",
"info-description": "Wenn du zustimmst werden in den Beiträgen aus der folgenden Liste an Providern Fremdcode von anderen Anbietern (Drittanbietern) in Form von eingebundenen Videos, Bilder oder Text automatisch eingebunden werden.",
"description": "Du hast zugestimmt das in den Beiträgen aus der folgenden Liste an Providern Fremdcode von anderen Anbietern (Drittanbietern) in Form von eingebundenen Videos, Bilder oder Text automatisch eingebunden werden.",
"statustext": "Momentan ist das automatische einbinden:",
"statuschange": "Einstellung ändern",
"false": "Abgestellt",
"true": "Zugelassen",
"button-tofalse": "Abstellen",
"button-totrue": "dauerhaft zulassen",
"third-party-false": "Es wird <b style='color:red'>kein</b> Service von Drittanbietern automatisch eingebunden.",
"third-party-true": "Das einbinden der Services von Drittanbietern ist <b style='color:red'>dauerhaft zugelassen</b> und gespeichert für komende Sitzungen."
"info-description": "Hier ist die Liste an Drittanbietern, deren Inhalte als Fremdcode z.B. in Form von eingebetteten Videos angezeigt werden kann:",
"status": {
"description": "Als Grundeinstellung für dich wird eingebetter Fremdcode von Drittanbietern",
"disabled": {
"false": "zunächst nicht angezeigt",
"true": "sofort angezeigt"
},
"change": {
"question": "Soll eingebetter Fremdcode von Dritten für dich immer angezeigt werden?",
"allow": "Na klar",
"deny": "Lieber nicht"
}
}
},
"organizations": {
"name": "Meine Organisationen"

View File

@ -229,16 +229,19 @@
},
"embeds": {
"name": "Third party providers",
"info-description": "If you agree, the posts from the following list of providers will automatically include third-party code from other providers (third parties) in the form of embedded videos, images, or text.",
"description": "You have agreed that in the contributions from the following list of providers, foreign code from other providers (third parties) in the form of embedded videos, images or text automatically are embedded.",
"statustext": "At the moment this is automatic embedding:",
"statuschange": "Change setting",
"false": "Turned off",
"true": "Admitted",
"button-tofalse": "turn-off",
"button-totrue": "allow permanently",
"third-party-false": "It automatically integrates <b style='color:red'>no </b> third-party providers' service.",
"third-party-true": "The inclusion of third-party services is <b style='color:red'>permanently allowed</b> and stored for future sessions."
"info-description": "Here is the list of third-party providers whose content can be displayed as third-party code, e.g. in the form of embedded videos.",
"status": {
"description": "As a default for you, embedded code of third-party providers is",
"disabled": {
"false": "initially not displayed",
"true": "displayed immediately"
},
"change": {
"question": "Should embedded source code from third parties always be displayed to you?",
"allow": "Sure",
"deny": "No thanks"
}
}
},
"organizations": {
"name": "My Organizations"

View File

@ -1,48 +1,31 @@
<template>
<ds-card :header="$t('settings.embeds.name')">
<p>{{ $t('settings.embeds.statustext') }}</p>
<ds-container width="large">
<h3 v-html="allowEmbeds_h3" />
<div v-html="allowEmbeds_desc" />
</ds-container>
<div>
<ds-space />
<ds-space />
<p>{{ $t('settings.embeds.statuschange') }}</p>
<ds-container width="large">
<ds-flex>
<ds-flex-item>
<ds-button @click="toFalse" :disabled="!disabled">
{{ $t('settings.embeds.button-tofalse') }}
</ds-button>
</ds-flex-item>
<ds-flex-item>
<ds-button @click="toTrue" secondary :disabled="disabled">
{{ $t('settings.embeds.button-totrue') }}
</ds-button>
</ds-flex-item>
</ds-flex>
</ds-container>
</div>
<ds-space />
<ds-space />
<ds-section>
<ds-text>
{{ $t('settings.embeds.status.description') }}
<ds-text bold>
{{ $t(`settings.embeds.status.disabled.${disabled}`) }}
</ds-text>
.
</ds-text>
<ds-text>
{{ $t('settings.embeds.status.change.question') }}
</ds-text>
<ds-button @click="toFalse" :primary="!disabled" :disabled="!disabled">
{{ $t('settings.embeds.status.change.deny') }}
</ds-button>
<ds-button @click="toTrue" :primary="disabled" :disabled="disabled">
{{ $t('settings.embeds.status.change.allow') }}
</ds-button>
<div>
<p v-if="disabled">
<b>{{ $t('settings.embeds.description') }}</b>
</p>
<p v-else>{{ $t('settings.embeds.info-description') }}</p>
<ds-container>
<ds-placeholder>
<ul>
<li v-for="provider in providers" :key="provider.provider_name">
{{ provider.provider_name }},
<small>{{ provider.provider_url }}</small>
</li>
</ul>
</ds-placeholder>
</ds-container>
</div>
<p>{{ $t('settings.embeds.info-description') }}</p>
<ul>
<li v-for="provider in providers" :key="provider.provider_name">
{{ provider.provider_name }},
<small>{{ provider.provider_url }}</small>
</li>
</ul>
</ds-section>
</ds-card>
</template>
@ -106,7 +89,6 @@ export default {
})
},
})
this.$toast.success(this.$t('site.thanks') + ' ' + this.allowEmbeds_h3)
this.disabled = !this.disabled
} catch (err) {
this.$toast.error(err.message)