<?php $this->extend('block_unsearchable'); ?>

<?php $this->block('content'); ?>

<?php if (!empty($this->filters)): ?>
  <div class="member-list-filter">
    <?php $this->insert('memberExtension_filter', [
      'filters' => $this->filters,
      'requestToken' => $this->requestToken,
      'formId' => $this->filterFormId,
    ]) ?>
  </div>
<?php endif; ?>

<div class="member-table">
  <?php if (empty($this->members)): ?>
    <p class="empty message"><?=$this->empty?></p>
  <?php else: ?>
    <table data-zero-label="No matching records found" data-search-label="Search:"<?= (($this->perPage > 0) && ($this->total > 10)) ? ' data-paging-true="1"' : '' ?>>
      <thead>
        <tr>
          <?php foreach ($this->labels as $label): ?>
            <th class="head"><?= $label ?></th>
          <?php endforeach; ?>
          <?php if ($this->hasDetailPage): ?>
            <th class="head"><?= $this->trans('MSC.memberDetailHeader') ?></th>
          <?php endif; ?>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($this->members as $row): ?>
          <?= $row ?>
        <?php endforeach; ?>
      </tbody>
    </table>
  <?php endif; ?>
</div>

<?= $this->pagination ?>

<?php $this->endblock(); ?>