Frontend indikator za strojni prevod

pull/57/head
Jurij Podgoršek 2024-06-14 13:45:13 +02:00
parent 6cb7199d22
commit 2f0b7ca1aa
6 changed files with 26 additions and 5 deletions

View File

@ -69,7 +69,7 @@ onUpdated(() => {
<div v-if="pojem" class="pojem">
<h2>
{{ naslov }}
<span v-if="pojem.strojni_prevod">strojni prevod</span>
<StrojniPrevod v-if="pojem.strojni_prevod" />
</h2>
<div class="tekst" v-html="pojem.tekst" />
</div>

View File

@ -0,0 +1,15 @@
<template>
<span alt="Ikona za strojni prevod" :title="$t('strojni prevod')" />
</template>
<style scoped>
span {
background-image: url('/images/Strojni prevod.png');
height: 24px;
width: 24px;
display: inline-block;
position: relative;
top: 2px;
left: 2px;
}
</style>

View File

@ -30,7 +30,10 @@ onMounted(() => {
:naslov="pojem"
:to="localePath({ name: 'pojem_poglej', params: { naslov: pojem }})"
class="okvir">
<h2>{{ pojem }}</h2>
<h2>
{{ pojem }}
<StrojniPrevod v-if="store.pojmi[pojem].strojni_prevod" />
</h2>
</NuxtLink>
</template>
@ -47,4 +50,7 @@ onMounted(() => {
padding-right: 2rem;
text-align: center;
}
.strojni-prevod {
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -11,7 +11,8 @@ export const usePojmiStore = defineStore('pojmi', {
id: s.id,
naslov: s.title,
tekst: s.body ? s.body.processed : '',
media: s.field_media
media: s.fieldMedia,
strojni_prevod: s.fieldStrojniPrevod
}), 'naslov')
},
@ -28,7 +29,6 @@ export const usePojmiStore = defineStore('pojmi', {
})
const resp = await req.json()
console.log('nov pojem?', resp)
}
}
})

View File

@ -10,7 +10,7 @@ export const useStraniStore = defineStore('strani', {
this.strani = await deserialize(data, s => ({
id: s.id,
naslov: s.title,
tekst: s.body.processed
tekst: s.body ? s.body.processed : ''
}), 'naslov')
}
}