#113 [nouns] dictionary cards / images - gui

This commit is contained in:
Andrea Vos 2020-11-25 22:47:40 +01:00
parent 21baf96dd9
commit 4f73bfa1e4
2 changed files with 43 additions and 9 deletions

View File

@ -49,19 +49,29 @@
<template v-slot:row="s"><template v-if="s">
<td>
<ul class="list-singular">
<li v-for="w in s.el.masc">{{ w }}</li>
<li v-for="w in s.el.masc">
{{ w }}
<a :href="`/api/nouns/${w}.png`" target="_blank" rel="noopener"><Icon v="image"/></a>
</li>
</ul>
<ul v-if="config.nouns.plurals" class="list-plural">
<li v-for="w in s.el.mascPl">{{ w }}</li>
<li v-for="w in s.el.mascPl">
{{ w }}
<a :href="`/api/nouns/${w}.png`" target="_blank" rel="noopener"><Icon v="image"/></a>
</li>
</ul>
<small v-if="s.el.base && nouns[s.el.base]">
<p><strong><T>nouns.edited</T>:</strong></p>
<ul class="list-singular">
<li v-for="w in nouns[s.el.base].masc">{{ w }}</li>
<li v-for="w in nouns[s.el.base].masc">
{{ w }}
</li>
</ul>
<ul v-if="config.nouns.plurals" class="list-plural">
<li v-for="w in nouns[s.el.base].mascPl">{{ w }}</li>
<li v-for="w in nouns[s.el.base].mascPl">
{{ w }}
</li>
</ul>
</small>
@ -72,19 +82,29 @@
</td>
<td>
<ul class="list-singular">
<li v-for="w in s.el.fem">{{ w }}</li>
<li v-for="w in s.el.fem">
{{ w }}
<a :href="`/api/nouns/${w}.png`" target="_blank" rel="noopener"><Icon v="image"/></a>
</li>
</ul>
<ul v-if="config.nouns.plurals" class="list-plural">
<li v-for="w in s.el.femPl">{{ w }}</li>
<li v-for="w in s.el.femPl">
{{ w }}
<a :href="`/api/nouns/${w}.png`" target="_blank" rel="noopener"><Icon v="image"/></a>
</li>
</ul>
<small v-if="s.el.base && nouns[s.el.base]">
<p><strong><T>nouns.edited</T>:</strong></p>
<ul class="list-singular">
<li v-for="w in nouns[s.el.base].fem">{{ w }}</li>
<li v-for="w in nouns[s.el.base].fem">
{{ w }}
</li>
</ul>
<ul v-if="config.nouns.plurals" class="list-plural">
<li v-for="w in nouns[s.el.base].femPl">{{ w }}</li>
<li v-for="w in nouns[s.el.base].femPl">
{{ w }}
</li>
</ul>
</small>
</td>
@ -93,12 +113,14 @@
<li v-for="w in s.el.neutr">
<Declension v-if="config.nouns.declension" :word="w"/>
<template v-else>{{w}}</template>
<a :href="`/api/nouns/${w}.png`" target="_blank" rel="noopener"><Icon v="image"/></a>
</li>
</ul>
<ul v-if="config.nouns.plurals" class="list-plural">
<li v-for="w in s.el.neutrPl">
<Declension v-if="config.nouns.declension" :word="w" plural :singularOptions="s.el.neutr"/>
<template v-else>{{w}}</template>
<a :href="`/api/nouns/${w}.png`" target="_blank" rel="noopener"><Icon v="image"/></a>
</li>
</ul>
@ -281,6 +303,12 @@
list-style: none;
li {
white-space: nowrap;
a:not([href='#']) {
display: none;
}
&:hover a:not([href='#']) {
display: inline;
}
}
>li:before {
content: "⋅";
@ -294,6 +322,12 @@
list-style: none;
li {
white-space: nowrap;
a:not([href='#']) {
display: none;
}
&:hover a:not([href='#']) {
display: inline;
}
}
>li:before {
content: "⁖";

View File

@ -125,7 +125,7 @@ router.get('/nouns/:word.png', async (req, res) => {
const noun = (await req.db.all(SQL`
SELECT * FROM nouns
WHERE locale = ${req.config.locale}
AND approved = 1
AND approved >= ${req.admin ? 0 : 1}
AND (masc like ${term} OR fem like ${term} OR neutr like ${term} OR mascPl like ${term} OR femPl like ${term} OR neutrPl like ${term})
ORDER BY masc
`)).filter(noun =>