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-fake
  +sideNavigationFake
  include /utilities/dictionaries-main-panel-header
  - const c = { sideMenu: false, h2: userData.firstName + ' ' + userData.lastName, h1: t('Uporabniki'), description: t('V tem razdelku lahko določite uporabniške vloge posameznega uporabnika in urejate njegove podatke.'), buttons: [{ type: 'cancel', content: t('Prekliči'), url:"/admin/uporabniki/seznam", classAtr: "btn btn-secondary header-btn-secondary small-header-btn"}, { type: 'disabled', content: t('Shrani'), form: 'form-edit-user' }] }
  +mainHeader(c)
  .content-hold-prerequisites.mt-4
    #offset-main
      div
        .subject-name
          label.smaller-gray-uppercase ID
      .row
        .col-sm-5
          span.page-title-header= userData.id

      form#form-edit-user.needs-validation(method="post" novalidate)
        .mt-2
          .subject-name
            label.smaller-black-uppercase(for="user-name")= t('Uporabniško ime')
          .row
            .col-sm-5
              input#user-name.name-input.form-control(
                type="text"
                value=userData.userName
                name="username"
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Ime, s katerim se uporabnik predstavlja na terminološkem portalu.')

        .mt-2
          .subject-name
            label.smaller-black-uppercase(for="user-fname")= t('Ime')
          .row
            .col-sm-5
              input#user-fname.name-input.form-control(
                type="text"
                value=userData.firstName
                name="firstName"
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Ime registriranega uporabnika.')

        .mt-2
          .subject-name
            label.smaller-black-uppercase(for="user-lastname")= t('Priimek')
          .row
            .col-sm-5
              input#user-lastname.name-input.form-control(
                type="text"
                value=userData.lastName
                name="lastName"
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Priimek registriranega uporabnika.')

        .mt-2
          .subject-name
            label.smaller-black-uppercase(for="user-mail")= t('E-naslov')
          .row
            .col-sm-5
              input#user-mail.name-input.form-control(
                type="text"
                value=userData.email
                name="email"
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Veljavni elektronski naslov uporabnika, na katerega uporabnik prejema sporočila, povezana s portalom.')

        //- .mt-2
        //-   .subject-name
        //-     label.smaller-black-uppercase(for="user-password") Geslo
        //-   .row
        //-     .col-sm-5
        //-       input#user-password.name-input.form-control(
        //-         type="password"
        //-         value=userData.password
        //-         name="password"
        //-       )
        //-     .col-sm.d-flex.align-items-center
        //-       span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3 Vnesite zapleteno geslo, ki vsebuje najmanj 8 znakov.

        //- .mt-2
        //-   .subject-name
        //-     label.smaller-black-uppercase(for="user-conf-password") Ponovi geslo
        //-   .row
        //-     .col-sm-5
        //-       input#user-conf-password.name-input.form-control(
        //-         type="password"
        //-         name="passwordRepeat"
        //-       )
        //-     .col-sm.d-flex.align-items-center
        //-       span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3 Ponovite geslo.

        .mt-2.mb-4
          .subject-name
            label.smaller-black-uppercase(for="user-is-confirmed")= t('Potrjen')
          .row
            .col-sm-5
              input#user-is-confirmed.form-check-input(
                type="checkbox"
                name="status"
                checked=userData.status === 'active'
              )
            .col-sm.d-flex.align-items-center
              span.d-md-inline.d-block.smaller-gray-info.ms-xxl-3.ms-md-3= t('Registracija uporabnika je potrjena.')

        .d-flex.justify-content-between.container-xl.ps-0.ms-0.mt-4.mb-4
          button#edit-user-remove.btn.btn-secondary(type="button") 
            img.me-2(src="/images/red-trash-icon.svg" alt="Delete")
            = t('Briši uporabnika')
        span.users-subtitle-txt= t('Uporabniške vloge')
        if userRoles
          .container-xl.ps-0.ms-0.mt-3
            table.styled-table-left-header
              thead
                if userRoles.roles.isPortalAdmin
                  tr
                    th.table-left-header= t('Skrbnik portala')
                      td= ''
                if userRoles.roles.isDictionariesAdmin
                  tr
                    th.table-left-header= t('Skrbnik slovarjev')
                      td= ''
                if userRoles.roles.isConsultancyAdmin
                  tr
                    th.table-left-header= t('Skrbnik svetovalnice')
                      td= ''
                if userRoles.roles.isConsultant
                  tr
                    th.table-left-header= t('Svetovalec')
                      td= ''
                if userRoles.roles.isEditor
                  tr
                    th.table-left-header= t('Urednik slovarja')
                      td= ''

  include /common/footer
