diff options
Diffstat (limited to 'app/Template/group/index.php')
-rw-r--r-- | app/Template/group/index.php | 100 |
1 files changed, 60 insertions, 40 deletions
diff --git a/app/Template/group/index.php b/app/Template/group/index.php index 8370dc53..f85eab8b 100644 --- a/app/Template/group/index.php +++ b/app/Template/group/index.php @@ -1,42 +1,62 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><?= $this->url->icon('user', t('All users'), 'UserListController', 'show') ?></li> - <li><?= $this->modal->medium('user-plus', t('New group'), 'GroupCreationController', 'show') ?></li> - </ul> +<div class="page-header"> + <ul> + <li><?= $this->url->icon('user', t('All users'), 'UserListController', 'show') ?></li> + <li><?= $this->modal->medium('user-plus', t('New group'), 'GroupCreationController', 'show') ?></li> + </ul> +</div> +<?php if ($paginator->isEmpty()): ?> + <p class="alert"><?= t('There is no group.') ?></p> +<?php else: ?> + <div class="table-list"> + <div class="table-list-header"> + <div class="table-list-header-count"> + <?php if ($paginator->getTotal() > 1): ?> + <?= t('%d groups', $paginator->getTotal()) ?> + <?php else: ?> + <?= t('%d group', $paginator->getTotal()) ?> + <?php endif ?> + </div> + <div class="table-list-header-menu"> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong><?= t('Sort') ?> <i class="fa fa-caret-down"></i></strong></a> + <ul> + <li> + <?= $paginator->order(t('Group ID'), \Kanboard\Model\GroupModel::TABLE.'.id') ?> + </li> + <li> + <?= $paginator->order(t('Name'), \Kanboard\Model\GroupModel::TABLE.'.name') ?> + </li> + <li> + <?= $paginator->order(t('External ID'), \Kanboard\Model\GroupModel::TABLE.'.external_id') ?> + </li> + </ul> + </div> + </div> + </div> + + <?php foreach ($paginator->getCollection() as $group): ?> + <div class="table-list-row table-border-left"> + <span class="table-list-title"> + <?= $this->render('group/dropdown', array('group' => $group)) ?> + <?= $this->url->link($this->text->e($group['name']), 'GroupListController', 'users', array('group_id' => $group['id'])) ?> + </span> + + <div class="table-list-details"> + <ul> + <?php if ($group['nb_users'] > 1): ?> + <li><?= t('%d users', $group['nb_users']) ?></li> + <?php else: ?> + <li><?= t('%d user', $group['nb_users']) ?></li> + <?php endif ?> + + <?php if (! empty($group['external_id'])): ?> + <li><?= $this->text->e($group['external_id']) ?></li> + <?php endif ?> + </ul> + </div> + </div> + <?php endforeach ?> </div> - <?php if ($paginator->isEmpty()): ?> - <p class="alert"><?= t('There is no group.') ?></p> - <?php else: ?> - <table class="table-fixed table-scrolling table-hover"> - <tr> - <th class="column-5"><?= $paginator->order(t('Id'), 'id') ?></th> - <th><?= $paginator->order(t('Name'), 'name') ?></th> - <th class="column-30"><?= $paginator->order(t('External Id'), 'external_id') ?></th> - </tr> - <?php foreach ($paginator->getCollection() as $group): ?> - <tr> - <td> - <div class="dropdown"> - <a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong>#<?= $group['id'] ?> <i class="fa fa-caret-down"></i></strong></a> - <ul> - <li><?= $this->modal->medium('plus', t('Add group member'), 'GroupListController', 'associate', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->icon('users', t('Members'), 'GroupListController', 'users', array('group_id' => $group['id'])) ?></li> - <li><?= $this->modal->medium('edit', t('Edit'), 'GroupModificationController', 'show', array('group_id' => $group['id'])) ?></li> - <li><?= $this->modal->confirm('trash-o', t('Remove'), 'GroupListController', 'confirm', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - </td> - <td> - <?= $this->url->link($this->text->e($group['name']), 'GroupListController', 'users', array('group_id' => $group['id'])) ?> - </td> - <td> - <?= $this->text->e($group['external_id']) ?> - </td> - </tr> - <?php endforeach ?> - </table> - <?= $paginator ?> - <?php endif ?> -</section> + <?= $paginator ?> +<?php endif ?> |