<?php
/**
 * YAWIK
 *
 * @filesource
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
 * @license   MIT
 */
$this->headTitle('Manage groups')->append('My');
?>
<h1><?php echo $this->translate('Manage groups') ?></h1>

<nav class="navbar yk-toolbar">  
<a href="<?php echo $this->url('lang/my-groups', array('action' => 'new')) ?>" class="btn btn-default">
    <span class="yk-icon yk-icon-plus"></span> <?php echo $this->translate('Add group') ?>
</a>
</nav>
<?php $groups = $this->auth('groups');
    if (count($groups)): ?>
    
<table class="table table-striped table-bordered table-hover" id="my-groups-list">
<thead>
    <tr>
        <th><?php echo $this->translate('Group name') ?></th>
        <th><?php echo $this->translate('Actions') ?></th>
    </tr>
</thead>
<tbody>
<?php foreach ($this->auth('groups') as $group):?>
    <tr>
        <td><?php echo $group->name ?> [<?php echo count($group->users) ?>]</td>
        <td>
            <a class="btn btn-default" href="<?php echo $this->url(
                'lang/my-groups', array('action' => 'edit'),
                array('query' => array('id' => $group->id)), true) ?>">
                <span class="yk-icon yk-icon-edit"></span>
            </a>
        </td>
    </tr>
<?php endforeach ?>
</tbody>
</table>

<?php endif ?>
