<div class="collector-systems-wrapper">

  <input type="hidden" value="{{ nxshowrec }}" id="groupLevelTopCount" />
  <input type="hidden" value="{{ nxshskip }}" id="groupLevelSkipCount" />
  <input type="hidden" value="{{ obj_count }}" id="groupLevelTotalCount" />
  <input type="hidden" value="{{ exhibitionID }}" id="groupTypeId" />
  <input type="hidden" value="{{ groupLevelOrderBy }}" id="groupLevelOrderBy" />
  <input type="hidden" value="{{ groupLevelPageNo }}" id="groupLevelPageNo" />

  <div class="py-5">
    <div class="row g-5">
      <div class="col-lg-12 wow">
        {% if exhibition_details|length > 0 %}
          <h1 class="font-normal mb-3">
            {{ exhibition_details['ExhibitionSubject'] }}
          </h1>
          <p class="mb-1">
            {{ exhibition_details['ExhibitionLocation'] ?? "" }}
          </p>
          <p class="mb-4">
            {{ exhibition_details['ExhibitionDate'] }}
          </p>
          <p class="mb-4">
            {{ exhibition_details['ExhibitionMemo']|raw }}
          </p>
        {% endif %}
      </div>
    </div>

    {% if enable_maps %}
      {# Custom Tabs Block #}
      {% include module_path ~ '/templates/partials/custom-tabs-block.html.twig' %}
    {% endif %}

    <div id="gallery-block" class="py-5">
      <div class="row mb-3">
        <div class="col d-inline-flex">
          <h2 class="font-normal pl-0 m-0">
            Objects
          </h2>
          {% if obj_count > nxshowrec %}
            <h6 class="cs-grouplevel-total-count">
              (
              {{ obj_count }}
              results)
            </h6>
          {% endif %}
        </div>
        <div class="col-auto text-end my-auto d-inline-flex">
          <div class="sort-by-field" id="dlGroupLevelObjectsSortingHtml">
            <span class="sort-by-title me-3">
              Sort By:
            </span>
            <select name="dlGroupLevelObjectsOrderBy" id="dlGroupLevelObjectsOrderBy" class="form-select" onchange="return sortingForGroupLevelObjects('{{ ajaxfor }}',{{ listPageSize }});">
              <option value="Title%20asc">
                Title Asc
              </option>
              <option value="Title%20desc">
                Title Desc
              </option>
              <option value="InventoryNumber%20desc">
                Inventory Number Desc
              </option>
              <option value="InventoryNumber%20asc">
                Inventory Number Asc
              </option>
              <option value="Collection/CollectionName%20desc">
                Collection Name Desc
              </option>
              <option value="Collection/CollectionName%20asc">
                Collection Name Asc
              </option>
              <option value="ObjectDate%20desc">
                Object Date Desc
              </option>
              <option value="ObjectDate%20asc">
                Object Date Asc
              </option>

            <!-- Add other options here -->
            </select>
            {% include '@collector_systems/templates/search-form.html.twig' %}
          </div>
        </div>
      </div>

      <div class="row card-group g-5 postList exhibition-objects-container mt-5" id="groupLevelObjectsData">
        {% for value in object_details %}
          {% set delaytm = (loadsec == 1) ? '0.01s' : ((loadsec == 2) ? '0.03s' : '0.05s') %}

          {{ getObjectslistHtml(value, dataorderby, requested_pageNo, qSearch, delaytm, 'https://cdn.collectorsystems.com/images/noimage300.png') }}

          {% set loadsec = (loadsec + 1 == 4) ? 1 : (loadsec + 1) %}
        {% endfor %}
      </div>

      {% if obj_count %}
        <div class="view-more" style="display:none;">
          <a id="loadBtn" style="cursor:pointer" onclick="return fetch('{{ ajaxfor }}');">
            View more
          </a>
        </div>
      {% endif %}

      <div class="cs-custom-pagination d-flex" id="groupLevelPagingData">
        {{ customPaginationForGroupLevelObjects(exhibitionID, ajaxfor, groupLevelPageNo, obj_count, groupLevelOrderBy, qSearch) }}
      </div>
    </div>

    {% if enable_maps %}
      {# Azure Map Block #}
      {% include module_path ~ '/templates/partials/azure-map-block.html.twig' %}
    {% endif %}
  </div>

</div>
