<?php

if (! $this->compact): ?>
<div class="controls">
    <?= $tabs ?>
    <div class="grid">
        <?= $this->sortBox ?>
        <?= $this->limiter ?>
        <?= $this->paginator ?>
    </div>
    <?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content">
<?php
if (count($groupData) === 0) {
    echo $this->translate('No contactgroups found matching the filter') . '</div>';
    return;
}
?>
    <table class="action table-row-selectable common-table" data-base-target="_next">
        <thead>
        <tr>
            <th></th>
            <th><?= $this->translate('Contact Group ') ?></th>
            <th><?= $this->translate('Alias') ?></th>
        </tr>
        </thead>
        <tbody>

        <?php foreach ($groupData as $groupName => $groupInfo): ?>
        <tr>
            <td class="count-col">
                <span class="badge"><?= count($groupInfo['contacts'])  ?></span>
            </td>
            <td>
                <?= $this->qlink(
                    $groupName,
                    'monitoring/list/contacts',
                    array('contactgroup_name' => $groupName),
                    array('title' => sprintf(
                        $this->translate('Show detailed information about %s'),
                        $groupName
                    ))
                ) ?>
            </td>
            <td>
                <?php if ($groupInfo['alias'] !== $groupName): ?>
                    <?= $groupInfo['alias'] ?>
                <?php endif ?>
            </td>
        </tr>
        <?php endforeach ?>
        </tbody>
    </table>
</div>
