mixin topHeaderContent(headerContent)
  #chevrons-left.d-flex
    .header-container-divider-left
      h2#site-header-title= headerContent.h2
      h1#site-heading= headerContent.h1
      span#text-description.page-description.pe-0!= headerContent.description
        if (headerContent.helpLink)
          a.ms-2.page-description(href=headerContent.helpLink.linkHref)= headerContent.helpLink.linkText

mixin mainHeader(headerContent, footerIncluded = true)
  - const checkForSpecificRights = headerContent.specificRights
  #offset-padding.header-section-root.no-side-menu.consultancy-padding-main.flex-grow-0.p-squeeze-lg.mx-xxl-auto.gray-bg.pb-3
    .d-flex.justify-content-between.flex-wrap.flex-row.row
      if checkForSpecificRights
        .header-container-left-side.d-flex.col-sm-10
          +topHeaderContent(headerContent)
        .header-container-divider-right.col-sm-2
          a.admin-cons-btn(
            href=user.hasRole('consultancy admin') ? '/svetovanje/vprasanje/admin/novo' : '/svetovanje/vprasanje/admin/v-delu'
          ) 
            img(src="/images/admin-button-gray-bg.svg")
      else
        .header-container-left-side.d-flex.col-sm-12
          +topHeaderContent(headerContent)

    .header-consultancy-content.w-100
      include ../components/search-and-filter/search-with-primary-domain-filter
      +searchWithPrimaryDomainFilter("consultancy-form", "searchbar-main", "couns-search-btn", "mt-3", queryKey)
        .header-consultancy-divider-right.d-flex.align-items-center.justify-content-end.col-sm-5.pe-0.ps-3
          .fit-content
            if (headerContent.buttons && headerContent.buttons.length)
              each el in headerContent.buttons
                if el.type === 'button'
                  button.w-100.height-46p(
                    class=el.classAtr || 'btn btn-primary'
                    form=el.form
                  )= el.content
                else if el.type === 'link'
                  a.w-100.height-46p(class=classAtr || 'btn btn-primary' href=el.url)= el.content
                else if el.type === 'cancel'
                  a.w-100.height-46p(
                    class=classAtr || 'btn btn-secondary'
                    href=el.url
                  )= el.content
    if footerIncluded
      .header-consultancy-content-footer.mt-3.mb-1.mt-5
        .row
          .col-sm-6.align-items-center.d-flex
            if (entries.length>0)
              if (resultAmountDisplay)
                p.mb-0.text-p875rem.strength500.text-header-title-gray #{ t('Odgovori na vprašanja:') } #{ queryCount }
              else
                p.mb-0.text-p875rem.strength500.text-header-title-gray #{ t('Zadnji odgovori na vprašanja') }
            else
              p.mb-0.text-p875rem.strength500.text-header-title-gray #{ t('Ni vprašanj.') }
          .col-sm-6.align-items-center.justify-content-end.d-flex
            .col-sm-5.align-items-center.justify-content-end.d-flex
              //- if headerContent.exportButtonPresent
                button#export-consultancy-info.btn.btn-secondary
                  img(src="/images/download.svg")
                  span.ps-2 #{ t('Izvozi') }
            if (!headerContent.show5MostRecent)
              .col-sm-7.align-items-center.justify-content-end.d-flex
                include /utilities/pager
                +pager(1)
      hr#header-row.mt-1.ms-0.mb-0
