extends /layout

block pageSpecificScipts
  script(nonce=cspNonce src="/javascripts/dictionaries.js")

block body
  section#fixed-top-section
    include /common/main-navigation
    +main-navigation(false)

  include /common/side-menu-mixin-dictionaries
  - const d = { activeLvl1: 'attributes', activeLvl2: 'description' }
  +sideNavigation(d)
  include /utilities/dictionaries-main-panel-header
  - const c = { sideMenu: true, h2: dictionary.nameSl, h1: 'Osnovni podatki', description: 'Izpolnite polja in na kratko opišite vsebino terminološkega slovarja.', helpLink: { linkHref: '/pomoc', linkText: 'Več ...' }, buttons: [{ type: 'disabled', content: 'Shrani', form: 'form-dictionary-description' }] }
  +mainHeader(c)
  .content-hold-prerequisites
    #offset-main.main-container.mt-3
      form#form-dictionary-description.needs-validation(
        method="post"
        novalidate
      )
        .title
          .subject-name
            label.input-name-txt(for="dictionary-title") NASLOV SLOVARJA *
          .row
            .col-sm-6
              input#dictionary-title.name-input.form-control.d-inline(
                type="text"
                name="nameSl"
                required
                maxlength="120"
                value=dictionary.nameSl
              )
              .invalid-feedback Niste vpisali naslova slovarja.

            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Celotni naslov slovarja, ki bo zabeležen v bibliografskih podatkih.

        .english-title.mt-4
          .subject-name
            label.input-name-txt(for="dictionary-title-en") ANGLEŠKI NASLOV SLOVARJA *
          .row
            .col-sm-6.align-items-center
              input#dictionary-title-en.name-input.form-control.d-inline(
                type="text"
                name="nameEn"
                maxlength="120"
                value=dictionary.nameEn ? dictionary.nameEn : ''
                required
              )
              .invalid-feedback Niste vpisali angleškega naslova slovarja.

            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Celotni naslov slovarja v angleščini.

        .short-title.mt-4
          .subject-name
            label.input-name-txt(for="short-dictionary-title") SKRAJŠANI NASLOV SLOVARJA
          .row
            .col-sm-6
              input#short-dictionary-title.name-input.d-inline.form-control(
                type="text"
                name="nameSlShort"
                maxlength="15"
                value=dictionary.nameSlShort ? dictionary.nameSlShort : ''
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Zaradi organizacije podatkov na portalu za skrajšani naslov slovarja predlagamo poenobesede	nje, ki se bo izpisovalo ob slovarju, npr. Davčni terminološki slovar &rarr; Davki.

        if dictionary.author
          each ele, index in dictionary.author
            .author.mt-4.added-field
              .subject-name
                label.input-name-txt(for="author") AVTOR SLOVARJA
              .row
                .col-sm-6
                  .input-group
                    input(
                      class=index != 0 ? 'name-input d-inline form-control icon-trash' : 'name-input d-inline form-control'
                      type="text"
                      name="author"
                      maxlength="64"
                      value=ele ? ele : ''
                    )
                    if (index!=0)
                      button.input-group-text.delete-author-btn(type="button")
                        img(src="/images/red-trash-icon.svg" alt="")
                .col-sm.d-flex.align-items-center
                  span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Vpišite avtorja slovarja, če ste glavni avtor, na prvo mesto zapišite svoje ime.
        else
          #first-author.author.mt-4
            .subject-name
              label.input-name-txt(for="author") AVTOR SLOVARJA
            .row
              .col-sm-6
                input#author.name-input.d-inline.form-control(
                  type="text"
                  name="author"
                  maxlength="64"
                )
              .col-sm.d-flex.align-items-center
                span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Vpišite avtorja slovarja, če ste glavni avtor, na prvo mesto zapišite svoje ime.

        #add-new-author.author.mt-4
          .subject-name
            label.input-name-txt(for="input-new-author") NOV AVTOR SLOVARJA
          .row
            .col-sm-6
              button#input-new-author.form-control(type="button")
                span.new-author-text-btn Nov avtor

            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Dodajte ime in priimek naslednjega avtorja slovarja..

        .cerif-area.mt-4
          .subject-name
            label.input-name-txt(for="select-cerif") PODROČJE *
          .row
            .col-sm-6
              select.name-input.d-inline.form-select(
                name="domainPrimary"
                required
              )
                each domain in allPrimaryDomains
                  option(
                    value=domain.id
                    selected=domain.id === dictionary.domainPrimary
                  )= domain.nameSl

              #invalid-section.invalid-feedback-selection.hidden-section.mt-3 Nimate izbranega področja CERIF.
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Izberite področje svojega terminološkega slovarja na seznamu področij.

        .small-name-area.mt-4
          .subject-name
            label.input-name-txt(for="domain-secondary") PODPODROČJE
          .row
            .col-sm-6
              select#domain-secondary.name-input.d-inline.form-control.without-addition(
                name="domainSecondary"
                multiple
              )
                each domain in allSecondaryDomains
                  if associatedSecondaryDomains.some(associatedDomain => associatedDomain.id === domain.id)
                    option(value=domain.id selected)= domain.nameSl
                  else
                    option(value=domain.id)= domain.nameSl

            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Vpišite podpodročje glavnega področja, ki ste ga izbrali. Če podpodročja ni med naborom, izberite polje Novo podpodročje.

        #add-new-area.author.mt-4
          .subject-name
            label.input-name-txt NOVO PODPODROČJE
          .row
            .col-sm-6
              button#input-new-area.form-control(type="button")
                span.new-author-text-btn Novo podpodročje
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 Vpišite novo podpodročje. Na seznamu podpodročij bo vidno takoj po potrditvi administratorja portala.

        #text-editor.mt-4
          .subject-name
            span.input-name-txt OPIS SLOVARJA
          .container-xxl.ps-0.ms-0
            textarea.summernote(
              name="description"
              value=dictionary.description
            )
              if dictionary.description
                p= dictionary.description
        #issn-field.mt-4
          .subject-name
            label.input-name-txt(for="issn") ISSN OZNAKA
          .row
            .col-sm-6
              input#issn.name-input.d-inline.form-control(
                type="text"
                name="issn"
                maxlength="20"
                value=dictionary.issn ? dictionary.issn : ''
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.name-info-txt.ms-xxl-3.ms-md-3.mt-3.mt-sm-0 ISSN oznaka.
              a.ms-1.name-info-txt(href="/pomoc" target="_blank") Več ...
    include /utilities/modal-alert
  include /utilities/modal-alert-mixin
  +alertModal('unsaved-data', 'Shrani', 'Ne', 'modal-save-btn', 'modal-dont-save-btn', 'Imate neshranjene spremebe. Ali jih želite shraniti?')
  include /common/footer
