From 6cfcb656435228b120b79bf43bae8c2fa1414a2a Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Fri, 16 Oct 2020 18:55:41 +0200 Subject: [PATCH] #77 [nouns] hide noun examples (accordion) --- locale/pl/nouns/NounsExtra.vue | 231 ++++++++++++----------- locale/pl/translations.suml | 2 +- routes/nouns.vue | 335 +++++++++++++++++---------------- 3 files changed, 298 insertions(+), 270 deletions(-) diff --git a/locale/pl/nouns/NounsExtra.vue b/locale/pl/nouns/NounsExtra.vue index c008e739d..14fb43290 100644 --- a/locale/pl/nouns/NounsExtra.vue +++ b/locale/pl/nouns/NounsExtra.vue @@ -24,56 +24,59 @@ nouns.personNouns.info -

nouns.examples:

- -
- - - - - - - - - - - - - - - -
- - nouns.masculine - - - nouns.feminine - - - nouns.personNouns.label -
-
    -
  • {{ w }}
  • -
-
    -
  • {{ w }}
  • -
-
-
    -
  • {{ w }}
  • -
-
    -
  • {{ w }}
  • -
-
-
    -
  • {{ w }}
  • -
-
    -
  • {{ w }}
  • -
-
-
+
+ +

nouns.examples

+
+
+ + + + + + + + + + + + + + + +
+ + nouns.masculine + + + nouns.feminine + + + nouns.personNouns.label +
+
    +
  • {{ w }}
  • +
+
    +
  • {{ w }}
  • +
+
+
    +
  • {{ w }}
  • +
+
    +
  • {{ w }}
  • +
+
+
    +
  • {{ w }}
  • +
+
    +
  • {{ w }}
  • +
+
+
+
@@ -83,63 +86,66 @@ nouns.dukajNouns.info -

nouns.examples:

- -
- - - - - - - - - - - - - - - -
- - nouns.masculine - - - nouns.feminine - - - nouns.dukajNouns.label -
-
    -
  • {{ w }}
  • -
-
    -
  • {{ w }}
  • -
-
-
    -
  • {{ w }}
  • -
-
    -
  • {{ w }}
  • -
-
-
    -
  • - -
  • -
-
    -
  • - -
-
-
+
+ +

nouns.examples

+
+
+ + + + + + + + + + + + + + + +
+ + nouns.masculine + + + nouns.feminine + + + nouns.dukajNouns.label +
+
    +
  • {{ w }}
  • +
+
    +
  • {{ w }}
  • +
+
+
    +
  • {{ w }}
  • +
+
    +
  • {{ w }}
  • +
+
+
    +
  • + +
  • +
+
    +
  • + +
+
+
+
@@ -190,15 +196,20 @@ masc: 'austronauta', fem: 'austronautka', neutr: 'austronautu', mascPl: 'austronauci', femPl: 'austronautki', neutrPl: 'austronauty', }), + new Noun({ + id: 'Europejczyk', + masc: 'Europejczyk', fem: 'Europejka', neutr: 'Europeju', + mascPl: 'Europejczycy', femPl: 'Europejki', neutrPl: 'Europejy', + }), new Noun({ id: 'przyjaciel', masc: 'przyjaciel', fem: 'przyjaciółka', neutr: 'przyjaciełu', mascPl: 'przyjaciele', femPl: 'przyjaciółki', neutrPl: 'przyjacieły', }), new Noun({ - id: 'Europejczyk', - masc: 'Europejczyk', fem: 'Europejka', neutr: 'Europeju', - mascPl: 'Europejczycy', femPl: 'Europejki', neutrPl: 'Europejy', + id: 'twórca', + masc: 'twórca', fem: 'twórczyni', neutr: 'twórcu', + mascPl: 'twórcy', femPl: 'twórczynie', neutrPl: 'twórcy', }), ], dukajDeclension: new NounDeclension({ diff --git a/locale/pl/translations.suml b/locale/pl/translations.suml index 69cdf0317..679f39241 100644 --- a/locale/pl/translations.suml +++ b/locale/pl/translations.suml @@ -165,8 +165,8 @@ nouns: z wyszczególnieniem ich formy męskiej, żeńskiej i nijakiej. Podane wzory odmiany są normatywne, na podstawie słów z tymi samymi końcówkami. - examples: 'Przykłady' + dictionary: 'Słownik neutratywów' approved: 'wpisów zatwierdzonych' pending: 'oczekuje na moderację' diff --git a/routes/nouns.vue b/routes/nouns.vue index ce5ee7b1a..b312c18ff 100644 --- a/routes/nouns.vue +++ b/routes/nouns.vue @@ -13,167 +13,179 @@ - -
-
- {{ nounsCountApproved() }} nouns.approved, - {{ nounsCountPending() }} nouns.pending. -
-
+
+ +

+ + nouns.dictionary +

+
+
+ +
+
+ {{ nounsCountApproved() }} nouns.approved, + {{ nounsCountPending() }} nouns.pending. +
+
-
-
-
- - - -
- -
- -
-
- -
-
-
+
+
+
+ + + +
+ +
+ +
+
+ +
+
+
-
- - - - - - - - - - - + + +
- - nouns.masculine - - - nouns.feminine - - - nouns.neuter -
+
+ + + +
+ +
+
+
+
@@ -193,9 +205,6 @@ }, mounted() { if (process.client) { - this.$axios.$get(`/nouns/all`, { headers: this.$auth() }).then(data => { - this.nounsRaw = data; - }); if (window.location.hash) { const anchor = decodeURIComponent(window.location.hash.substr(1)); this.$nextTick(_ => { @@ -204,10 +213,12 @@ $anchor.scrollIntoView(); } else { this.filter = anchor; - this.$refs.filter.focus(); - this.$refs.filter.scrollIntoView(); + this.loadNouns(); + this.$refs.dictionary.open = true; + this.$refs.dictionary.focus(); + this.$refs.dictionary.scrollIntoView(); setTimeout(_ => { - this.$refs.filter.scrollIntoView(); + this.$refs.dictionary.scrollIntoView(); }, 1000); } }) @@ -215,6 +226,12 @@ } }, methods: { + async loadNouns() { + if (this.nounsRaw !== undefined) { + return; + } + this.nounsRaw = await this.$axios.$get(`/nouns/all`, { headers: this.$auth() }); + }, edit(noun) { this.$refs.form.edit(noun); },