[profile][editor] restore default words

This commit is contained in:
Avris 2021-11-15 20:55:59 +01:00
parent 72fd93fcff
commit 095da6b8c3
14 changed files with 32 additions and 9 deletions

View File

@ -8,7 +8,7 @@
{{$t('confirm.header')}}
</p>
</div>
<div class="modal-body">
<div class="modal-body" v-if="message">
<p class="py-5 text-center" v-html="message"></p>
</div>
<div v-if="choice" class="modal-footer">

View File

@ -55,7 +55,10 @@
validation: {},
},
data() { return { v: this.value } },
watch: { v() { this.$emit('input', this.v); } },
watch: {
v() { this.$emit('input', this.v); },
value(v) { this.v = v; }
},
methods: {
invalid(val) {
return this.validation && val.key && this.validation(val.key)

View File

@ -28,7 +28,7 @@
this.$refs.dialogue.show(false, message, color, resolve, reject);
});
};
Vue.prototype.$confirm = (message, color='primary') => {
Vue.prototype.$confirm = (message = '', color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.dialogue.show(true, message, color, resolve, reject);
});

View File

@ -440,6 +440,7 @@ profile:
editor:
header: 'Visitenkarte-Editor'
save: 'Visitenkarte speichern'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'Ja'
jokingly: 'Scherzhaft'

View File

@ -548,6 +548,7 @@ profile:
editor:
header: 'Card editor'
save: 'Save your card'
defaults: 'Restore defaults'
opinion:
yes: 'Yes'
jokingly: 'Jokingly'

View File

@ -453,6 +453,7 @@ profile:
editor:
header: 'Editor de tarjetas'
save: 'Guarda tu tarjeta'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'Sí'
jokingly: 'En broma'

View File

@ -443,6 +443,7 @@ profile:
editor:
header: 'Éditeur de carte'
save: 'Sauvegarder votre carte'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'Oui'
jokingly: 'Pour plaisanter'

View File

@ -431,6 +431,7 @@ profile:
editor:
header: 'Kaart editor'
save: 'Sla jouw kaart op'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'Ja'
jokingly: 'Voor de grap'

View File

@ -443,6 +443,7 @@ profile:
editor:
header: 'Kort redigerer'
save: 'Lagre kort'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'Ja'
jokingly: 'På tull'

View File

@ -1243,6 +1243,7 @@ profile:
editor:
header: 'Edytor wizytówki'
save: 'Zapisz wizytówkę'
defaults: 'Przywróć domyślne'
opinion:
yes: 'Tak'
jokingly: 'Żartobliwie'

View File

@ -449,6 +449,7 @@ profile:
editor:
header: 'Editor de cartões'
save: 'Salve o cartão'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'Sim'
jokingly: 'É brincadeira'

View File

@ -454,6 +454,7 @@ profile:
editor:
header: 'רעדאַקציע פון די װיזיט־⁠קאַרטל'
save: 'Save your card'
defaults: 'Restore defaults' # TODO
opinion:
yes: 'יאָ'
jokingly: 'אין אַ שפּאַס'

View File

@ -413,6 +413,7 @@ profile:
editor:
header: '卡編輯'
save: '保存卡'
defaults: 'Restore defaults' # TODO
opinion:
yes: '至愛'
jokingly: '諧謔'

View File

@ -180,10 +180,15 @@
</section>
<section class="form-group">
<h3 class="h4">
<Icon v="scroll-old"/>
<T>profile.words</T>
</h3>
<div class="h4 d-flex justify-content-between">
<h3 class="h4">
<Icon v="scroll-old"/>
<T>profile.words</T>
</h3>
<button class="btn btn-outline-warning btn-sm" @click.prevent="resetWords">
<T>profile.editor.defaults</T>
</button>
</div>
<template v-for="i in [0, 1, 2, 3]">
<h4 class="h5">
<T>profile.column</T> {{i + 1}}
@ -269,7 +274,7 @@
links: Object.keys(profile.links).length ? profile.links : [],
flags: profile.flags.filter(f => !f.startsWith('-')),
customFlags: profile.customFlags,
words: defaultWords,
words: [...defaultWords],
teamName: profile.teamName,
footerName: profile.footerName,
footerAreas: [],
@ -287,7 +292,7 @@
links: [],
flags: [],
customFlags: {},
words: defaultWords,
words: [...defaultWords],
teamName: '',
footerName: '',
footerAreas: [],
@ -348,6 +353,11 @@
? null
: 'profile.pronounsNotFound'
},
async resetWords() {
await this.$confirm();
this.words = [...defaultWords];
}
},
computed: {
mainPronoun() {