[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')}} {{$t('confirm.header')}}
</p> </p>
</div> </div>
<div class="modal-body"> <div class="modal-body" v-if="message">
<p class="py-5 text-center" v-html="message"></p> <p class="py-5 text-center" v-html="message"></p>
</div> </div>
<div v-if="choice" class="modal-footer"> <div v-if="choice" class="modal-footer">

View File

@ -55,7 +55,10 @@
validation: {}, validation: {},
}, },
data() { return { v: this.value } }, 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: { methods: {
invalid(val) { invalid(val) {
return this.validation && val.key && this.validation(val.key) return this.validation && val.key && this.validation(val.key)

View File

@ -28,7 +28,7 @@
this.$refs.dialogue.show(false, message, color, resolve, reject); 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) => { return new Promise((resolve, reject) => {
this.$refs.dialogue.show(true, message, color, resolve, reject); this.$refs.dialogue.show(true, message, color, resolve, reject);
}); });

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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