extends /layout

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

block body
  section#fixed-top-section
    include /common/main-navigation
    +main-navigation(false)
  include /common/side-menu-mixin-admin
  - const d = { activeLvl1: 'settings', activeLvl2: 'portals' }
  +sideNavigation(d)
  include /utilities/dictionaries-main-panel-header
  - const c = { sideMenu: true, h2: t('Osnovne nastavitve'), h1: t('Portal'), description: t('Administratorski del portala je namenjen skupini oseb, ki vsebinsko in tehnično ureja portal, odpira slovarske vire, daje pooblastila posameznim uporabnikom in skrbi za vsebinsko in tehnično urejenost portala. Izberite module, ki jih boste ponudili na terminološkem portalu in na kratko opišite, kaj ponuja vaš portal.'), buttons: [{ type: 'disabled', form: 'admin-portal-settings', content: t('Shrani') }] }
  +mainHeader(c)

  .content-hold-prerequisites
    #offset-main.main-container.mt-2
      form#admin-portal-settings(method="post")
        .port-name
          .subject-name
            label.smaller-black-uppercase(for="portal-name-sl")= t('IME PORTALA')
          .row
            .col-sm-5
              input#portal-name-sl.name-input.form-control.autocomplete.d-inline(
                type="text"
                name="portalNameSl"
                value=portal.nameSl
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Polno ime terminološkega portala.')

        .mt-3
          .subject-name
            label.smaller-black-uppercase(for="portal-name-en")= t('ANGLEŠKO IME PORTALA')
          .row
            .col-sm-5
              input#portal-name-en.name-input.form-control.autocomplete.d-inline(
                type="text"
                name="portalNameEn"
                value=portal.nameEn
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Angleško ime terminološkega portala.')

        .mt-3
          .subject-name
            label.smaller-black-uppercase(for="dictionary-label")= t('OZNAKA PORTALA *')
          .row
            .col-sm-5
              input#dictionary-label.name-input.form-control.autocomplete.d-inline.w-25(
                type="text"
                maxlength="2"
                name="portalCode"
                value=portal.code
                required
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Dvočrkovna oznaka terminološkega portala.')

        #text-editor.mt-sm-3
        .subject-name
          span.smaller-black-uppercase= t('OPIS PORTALA')
        div
          textarea.summernote(
            name="portalDescriptionSl"
            value=portal.descriptionSl
          )
            p= portal.descriptionSl

        //- TODO: render values once eng columns are added in db
        .subject-name.mt-3
          span.smaller-black-uppercase= t('ANGLEŠKI OPIS PORTALA')
        div
          textarea.summernote(
            name="portalDescriptionEn"
            value=portal.descriptionEn
          )
            p= portal.descriptionEn

        .moduls.mt-3
          .subject-name
            label.smaller-black-uppercase(for="dictionary-label")= t('MODULI')
          .d-grid
            .ms-1.d-sm-flex.mt-2.row
              .form-check.form-switch.d-flex.align-items-center.col-sm-5
                if portal.isExtractionEnabled
                  if portal.isExtractionEnabled === 'T'
                    input#extraction.form-check-input(
                      type="checkbox"
                      checked
                      name="isExtractionEnabled"
                    )
                  else
                    input#extraction.form-check-input(
                      type="checkbox"
                      name="isExtractionEnabled"
                    )
                label.form-check-label.normal-gray-label(for="extraction")= t('Luščenje')
              .col-sm.d-flex.align-items-center
                span.d-md-inline.d-block.smaller-gray-info= t('Modul za luščenje terminoloških kandidatov iz besedil.')

            .ms-1.d-sm-flex.mt-4.row
              .form-check.form-switch.d-flex.align-items-center.col-sm-5
                if portal.isDictionariesEnabled
                  if portal.isDictionariesEnabled === 'T'
                    input#edit.form-check-input(
                      type="checkbox"
                      checked
                      name="isDictionariesEnabled"
                    )
                  else
                    input#edit.form-check-input(
                      type="checkbox"
                      name="isDictionariesEnabled"
                    )
                label.form-check-label.normal-gray-label(for="edit")= t('Urejanje')
              .col-sm.d-flex.align-items-center
                span.d-md-inline.d-block.smaller-gray-info= t('Modul za urejanje terminoloških slovarjev.')

            .ms-1.d-sm-flex.mt-4.row
              .form-check.form-switch.d-flex.align-items-center.col-sm-5
                if portal.isConsultancyEnabled
                  if portal.isConsultancyEnabled === 'T'
                    input#consulting.form-check-input(
                      type="checkbox"
                      checked
                      name="isConsultancyEnabled"
                    )
                  else
                    input#consulting.form-check-input(
                      type="checkbox"
                      name="isConsultancyEnabled"
                    )
                label.form-check-label.normal-gray-label(for="consulting")= t('Svetovanje')
              .col-sm.d-flex.align-items-center
                span.d-md-inline.d-block.smaller-gray-info= t('Modul za svetovanje pri terminoloških zagatah.')
      include /common/footer
  include /utilities/modal-alert-mixin
  +alertModal('unsaved-data', t('Shrani'), t('Ne'), 'modal-save-btn', 'modal-dont-save-btn', t('Imate neshranjene spremebe. Ali jih želite shraniti?'))
