CJVT updates August and September 2026
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
mixin structureCheckbox(id, name, label, checked, extraLabelClass)
|
||||
.form-switch.d-flex
|
||||
input.form-check-input(id=id type="checkbox" name=name checked=checked)
|
||||
label.form-check-label(for=id class=extraLabelClass)= t(label)
|
||||
|
||||
mixin structureForeignSubgroup(id, labelId, name, label, disabledInput, checked)
|
||||
.form-switch.d-flex
|
||||
input.form-check-input(
|
||||
id=id
|
||||
class=disabledInput ? 'disabled-input' : undefined
|
||||
type="checkbox"
|
||||
name=name
|
||||
checked=checked
|
||||
)
|
||||
label.form-check-label.language-subgroups(id=labelId for=id)= t(label)
|
||||
|
||||
block input-structure
|
||||
.switches
|
||||
.subject-name.mt-2
|
||||
@@ -11,322 +27,41 @@ block input-structure
|
||||
input.form-check-input(type="checkbox" disabled checked)
|
||||
label.form-check-label(for="Termin")= t('Termin')
|
||||
|
||||
//- .form-switch.d-flex
|
||||
//- input.form-check-input(type="checkbox" disabled checked)
|
||||
//- label.form-check-label(for="headword-ele") Oblike, naglasi, izgovor
|
||||
-
|
||||
const hasForeignLanguages = dictionary ? dictionary.hasForeignLanguages : true
|
||||
const hasDict = !!dictionary
|
||||
const primaryCheckboxes = [
|
||||
{ id: 'domain-labels', name: 'hasDomainLabels', label: 'Področna oznaka', defaultChecked: false, labelClass: 'text-nowrap' },
|
||||
{ id: 'label-checkbox', name: 'hasLabel', label: 'Pojasnilo', defaultChecked: false },
|
||||
{ id: 'definition-check-box', name: 'hasDefinition', label: 'Definicija', defaultChecked: true },
|
||||
{ id: 'synonyms', name: 'hasSynonyms', label: 'Sinonim', defaultChecked: false },
|
||||
{ id: 'links', name: 'hasLinks', label: 'Povezani termin', defaultChecked: false },
|
||||
{ id: 'other', name: 'hasOther', label: 'Drugo', defaultChecked: false },
|
||||
{ id: 'language-group', name: 'hasForeignLanguages', label: 'Tuji jezik', defaultChecked: true, labelClass: 'text-nowrap' }
|
||||
]
|
||||
const foreignSubgroups = [
|
||||
{ id: 'termin-language-subgroup', labelId: 'termin-subgroup-label', name: undefined, dictKey: undefined, label: 'Termin', alwaysDisabled: true },
|
||||
{ id: 'definition-language-subgroup', labelId: 'definition-subgroup-label', name: 'hasForeignDefinitions', dictKey: 'hasForeignDefinitions', label: 'Definicija', alwaysDisabled: false },
|
||||
{ id: 'synonym-language-subgroup', labelId: 'synonym-subgroup-label', name: 'hasForeignSynonyms', dictKey: 'hasForeignSynonyms', label: 'Sinonim', alwaysDisabled: false }
|
||||
]
|
||||
const mediaCheckboxes = [
|
||||
{ id: 'images', name: 'hasImages', label: 'Slika', defaultChecked: false },
|
||||
{ id: 'audio', name: 'hasAudio', label: 'Zvok', defaultChecked: false },
|
||||
{ id: 'video', name: 'hasVideos', dictKey: 'hasVideo', label: 'Video', defaultChecked: false }
|
||||
]
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasDomainLabels
|
||||
.form-switch.d-flex
|
||||
input#domain-labels.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasDomainLabels"
|
||||
checked
|
||||
)
|
||||
label.form-check-label.text-nowrap(for="domain-labels")= t('Področna oznaka')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#domain-labels.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasDomainLabels"
|
||||
)
|
||||
label.form-check-label.text-nowrap(for="domain-labels")= t('Področna oznaka')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#domain-labels.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasDomainLabels"
|
||||
)
|
||||
label.form-check-label.text-nowrap(for="domain-labels")= t('Področna oznaka')
|
||||
each field in primaryCheckboxes
|
||||
- const checked = dictionary ? dictionary[field.dictKey || field.name] : field.defaultChecked
|
||||
+structureCheckbox(field.id, field.name, field.label, checked, field.labelClass)
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasLabel
|
||||
.form-switch.d-flex
|
||||
input#label-checkbox.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasLabel"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="label-checkbox")= t('Pojasnilo')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#label-checkbox.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasLabel"
|
||||
)
|
||||
label.form-check-label(for="label-checkbox")= t('Pojasnilo')
|
||||
each field in foreignSubgroups
|
||||
- const disabledInput = field.alwaysDisabled || (hasDict ? !hasForeignLanguages : false)
|
||||
- const subgroupChecked = field.dictKey ? hasDict && hasForeignLanguages && dictionary[field.dictKey] : hasForeignLanguages
|
||||
+structureForeignSubgroup(field.id, field.labelId, field.name, field.label, disabledInput, subgroupChecked)
|
||||
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#label-checkbox.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasLabel"
|
||||
)
|
||||
label.form-check-label(for="label-checkbox")= t('Pojasnilo')
|
||||
|
||||
.form-switch.d-flex
|
||||
input#definition-check-box.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasDefinition"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="definition-check-box")= t('Definicija')
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasSynonyms
|
||||
.form-switch.d-flex
|
||||
input#synonyms.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasSynonyms"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="synonyms")= t('Sinonim')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#synonyms.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasSynonyms"
|
||||
)
|
||||
label.form-check-label(for="synonyms")= t('Sinonim')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#synonyms.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasSynonyms"
|
||||
)
|
||||
label.form-check-label(for="synonyms")= t('Sinonim')
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasLinks
|
||||
.form-switch.d-flex
|
||||
input#links.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasLinks"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="links")= t('Povezani termin')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#links.form-check-input(type="checkbox" name="hasLinks")
|
||||
label.form-check-label(for="links")= t('Povezani termin')
|
||||
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#links.form-check-input(type="checkbox" name="hasLinks")
|
||||
label.form-check-label(for="links")= t('Povezani termin')
|
||||
|
||||
//- .form-switch.d-flex
|
||||
//- input#other.form-check-input(type="checkbox" name="hasOther")
|
||||
//- label.form-check-label(for="other") Drugo
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasOther
|
||||
.form-switch.d-flex
|
||||
input#other.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasOther"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="other")= t('Drugo')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#other.form-check-input(type="checkbox" name="hasOther")
|
||||
label.form-check-label(for="other")= t('Drugo')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#other.form-check-input(type="checkbox" name="hasOther")
|
||||
label.form-check-label(for="other")= t('Drugo')
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasForeignLanguages
|
||||
.form-switch.d-flex
|
||||
input#language-group.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignLanguages"
|
||||
checked
|
||||
)
|
||||
label.form-check-label.text-nowrap(for="language-group")= t('Tuji jezik')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#language-group.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignLanguages"
|
||||
)
|
||||
label.form-check-label.text-nowrap(for="language-group")= t('Tuji jezik')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#language-group.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignLanguages"
|
||||
checked
|
||||
)
|
||||
label.form-check-label.text-nowrap(for="language-group")= t('Tuji jezik')
|
||||
|
||||
if dictionary
|
||||
if !dictionary.hasForeignLanguages
|
||||
.form-switch.d-flex
|
||||
input#termin-language-subgroup.form-check-input.disabled-input(
|
||||
type="checkbox"
|
||||
)
|
||||
label#termin-subgroup-label.form-check-label.language-subgroups(
|
||||
for="termin-language-subgroup"
|
||||
)= t('Termin')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#termin-language-subgroup.form-check-input.disabled-input(
|
||||
type="checkbox"
|
||||
checked
|
||||
)
|
||||
label#termin-subgroup-label.form-check-label.language-subgroups(
|
||||
for="termin-language-subgroup"
|
||||
)= t('Termin')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#termin-language-subgroup.form-check-input.disabled-input(
|
||||
type="checkbox"
|
||||
checked
|
||||
)
|
||||
label#termin-subgroup-label.form-check-label.language-subgroups(
|
||||
for="termin-language-subgroup"
|
||||
)= t('Termin')
|
||||
|
||||
if dictionary
|
||||
if !dictionary.hasForeignLanguages
|
||||
.form-switch.d-flex
|
||||
input#definition-language-subgroup.form-check-input.disabled-input(
|
||||
type="checkbox"
|
||||
name="hasForeignDefinitions"
|
||||
)
|
||||
label#definition-subgroup-label.form-check-label.language-subgroups(
|
||||
for="definition-language-subgroup"
|
||||
)= t('Definicija')
|
||||
else if dictionary.hasForeignDefinitions
|
||||
.form-switch.d-flex
|
||||
input#definition-language-subgroup.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignDefinitions"
|
||||
checked
|
||||
)
|
||||
label#definition-subgroup-label.form-check-label.language-subgroups(
|
||||
for="definition-language-subgroup"
|
||||
)= t('Definicija')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#definition-language-subgroup.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignDefinitions"
|
||||
)
|
||||
label#definition-subgroup-label.form-check-label.language-subgroups(
|
||||
for="definition-language-subgroup"
|
||||
)= t('Definicija')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#definition-language-subgroup.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignDefinitions"
|
||||
)
|
||||
label#definition-subgroup-label.form-check-label.language-subgroups(
|
||||
for="definition-language-subgroup"
|
||||
)= t('Definicija')
|
||||
|
||||
if dictionary
|
||||
if !dictionary.hasForeignLanguages
|
||||
.form-switch.d-flex
|
||||
input#synonym-language-subgroup.form-check-input.disabled-input(
|
||||
type="checkbox"
|
||||
name="hasForeignSynonyms"
|
||||
)
|
||||
label#synonym-subgroup-label.form-check-label.language-subgroups(
|
||||
for="synonym-language-subgroup"
|
||||
)= t('Sinonim')
|
||||
else if dictionary.hasForeignSynonyms
|
||||
.form-switch.d-flex
|
||||
input#synonym-language-subgroup.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignSynonyms"
|
||||
checked
|
||||
)
|
||||
label#synonym-subgroup-label.form-check-label.language-subgroups(
|
||||
for="synonym-language-subgroup"
|
||||
)= t('Sinonim')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#synonym-language-subgroup.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignSynonyms"
|
||||
)
|
||||
label#synonym-subgroup-label.form-check-label.language-subgroups(
|
||||
for="synonym-language-subgroup"
|
||||
)= t('Sinonim')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#synonym-language-subgroup.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasForeignSynonyms"
|
||||
)
|
||||
label#synonym-subgroup-label.form-check-label.language-subgroups(
|
||||
for="synonym-language-subgroup"
|
||||
)= t('Sinonim')
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasImages
|
||||
.form-switch.d-flex
|
||||
input#images.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasImages"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="images")= t('Slika')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#images.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasImages"
|
||||
)
|
||||
label.form-check-label(for="images")= t('Slika')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#images.form-check-input(type="checkbox" name="hasImages")
|
||||
label.form-check-label(for="images")= t('Slika')
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasAudio
|
||||
.form-switch.d-flex
|
||||
input#audio.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasAudio"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="audio")= t('Zvok')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#audio.form-check-input(type="checkbox" name="hasAudio")
|
||||
label.form-check-label(for="audio")= t('Zvok')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#audio.form-check-input(type="checkbox" name="hasAudio")
|
||||
label.form-check-label(for="audio")= t('Zvok')
|
||||
|
||||
if dictionary
|
||||
if dictionary.hasVideo
|
||||
.form-switch.d-flex
|
||||
input#video.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasVideos"
|
||||
checked
|
||||
)
|
||||
label.form-check-label(for="video")= t('Video')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#video.form-check-input(
|
||||
type="checkbox"
|
||||
name="hasVideos"
|
||||
)
|
||||
label.form-check-label(for="video")= t('Video')
|
||||
else
|
||||
.form-switch.d-flex
|
||||
input#video.form-check-input(type="checkbox" name="hasVideos")
|
||||
label.form-check-label(for="video")= t('Video')
|
||||
each field in mediaCheckboxes
|
||||
- const checked = dictionary ? dictionary[field.dictKey || field.name] : field.defaultChecked
|
||||
+structureCheckbox(field.id, field.name, field.label, checked, field.labelClass)
|
||||
.ms-2.ms-md-5.flex-grow-1
|
||||
include /utilities/entry-preview
|
||||
|
||||
|
||||
Reference in New Issue
Block a user