#50 pronouns cards - default words

This commit is contained in:
Andrea Vos 2020-10-24 22:58:34 +02:00
parent be627d1726
commit 1ec86c6173
4 changed files with 26 additions and 3 deletions

View File

@ -76,5 +76,12 @@ contact:
user:
enabled: true
route: 'account'
profileEditorRoute: 'my-card'
profile:
defaultWords:
- ['mx.', 'mr.', 'miss', 'sir', 'ma''am']
- ['person', 'man', 'woman', 'lady', 'dude', 'boy', 'girl', 'bro', 'sis']
- ['pretty', 'handsome', 'cute']
- ['partner', 'boyfriend', 'girlfriend', 'joyfriend']
redirects: []

View File

@ -222,6 +222,12 @@ user:
enabled: true
route: 'konto'
profileEditorRoute: 'wizytówka'
profile:
defaultWords:
- ['pan', 'pani', 'pań', 'panu']
- ['osoba', 'mężczyzna', 'kobieta', 'enby', 'facet', 'baba', 'ziom', 'laska']
- ['ładnx', 'przystojnx', 'słodkx']
- ['partner', 'chłopak', 'dziewczyna']
redirects:
- { from: '^/neutratywy', to: '/rzeczowniki' }

View File

@ -85,9 +85,16 @@
</template>
<script>
import { head, dictToList, listToDict } from "../src/helpers";
import { head, dictToList, listToDict, buildList } from "../src/helpers";
import { templates } from "~/src/data";
import { buildTemplate } from "../src/buildTemplate";
import config from '../data/config.suml';
const defaultWords = config.user.profile.defaultWords.map(c => buildList(function* () {
for (let word of c) {
yield {key: word, value: 0};
}
}))
export default {
data() {
@ -134,7 +141,7 @@
birthday: profile.birthday,
links: profile.links,
flags: dictToList(profile.flags),
words: [{}, {}, {}, {}], // TODO defaults
words: defaultWords,
};
}
@ -145,7 +152,7 @@
birthday: null,
links: {},
flags: {},
words: [{}, {}, {}, {}],
words: defaultWords,
};
},
methods: {

View File

@ -124,6 +124,9 @@ export const dictToList = dict => {
}
export const listToDict = list => {
if (Object.keys(list).length === 0) {
return {}
}
const dict = {};
for (let el of list) {
dict[el.key] = el.value;