<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>

<?php if( engine_count($this->paginator) > 0 ): ?>
<div class="container no-padding groups_listing">
  <div class="grid_listing">
    <?php foreach( $this->paginator as $group ): ?>
      <div class="grid_listing_item">
        <article>
          <div class="grid_listing_item_thumb">
            <?php echo $this->htmlLink($group->getHref(), $this->itemBackgroundPhoto($group, 'thumb.normal')) ?>
          </div>
          <div class="grid_listing_item_info">
            <div class="grid_listing_item_title">
              <?php echo $this->htmlLink($group->getHref(), $group->getTitle()) ?>
            </div>
            <div class="grid_listing_item_owner">
              <span><?php echo $this->translate('led by');?> <?php echo $this->htmlLink($group->getOwner()->getHref(), $group->getOwner()->getTitle()) ?></span>
              <span><?php echo $this->translate(array('%s member', '%s members', $group->membership()->getMemberCount()),$this->locale()->toNumber($group->membership()->getMemberCount())) ?></span>
            </div>
          </div>
        </article>
      </div>
    <?php endforeach; ?>
  </div>
</div>

<?php elseif( preg_match("/category_id=/", $_SERVER['REQUEST_URI'] )): ?>
  <div class="no_result_tip">
    <i><img src="application/modules/Core/externals/images/no-results.png" height="100" width="100" alt="<?php echo $this->translate("No Result")?>"></i>
    <p><?php echo $this->translate('No one has created a group with that criteria.');?></p>
  <?php if( $this->canCreate ): ?>
    <p><?php echo $this->translate('Why don\'t you %1$screate one%2$s?',
      '<a href="'.$this->url(array('action' => 'create'), 'group_general').'">', '</a>') ?></p>
  <?php endif; ?>
</div>
<?php else: ?>
  <div class="no_result_tip">
    <i><img src="application/modules/Core/externals/images/no-results.png" height="100" width="100" alt="<?php echo $this->translate("No Result")?>"></i>
    <p><?php echo $this->translate('There are no groups yet.') ?></p>
    <?php if( $this->canCreate): ?>
      <p><?php echo $this->translate('Why don\'t you %1$screate one%2$s?',
        '<a href="'.$this->url(array('action' => 'create'), 'group_general').'">', '</a>') ?></p>
    <?php endif; ?>
  </div>
<?php endif; ?>

<?php echo $this->paginationControl($this->paginator, null, null, array(
  'query' => $this->formValues
)); ?>


