diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-16 20:19:07 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-16 20:19:07 -0400 |
commit | abdf6f97800e7e838b5841820815385b183bab67 (patch) | |
tree | 75576da4a975561d0b93c7bcc7be94a385a4cd75 /app/Template/group | |
parent | de8ce875f4295e0b3bef20fcca051401f96816ef (diff) |
Improve group controllers and views
Diffstat (limited to 'app/Template/group')
-rw-r--r-- | app/Template/group/associate.php | 41 | ||||
-rw-r--r-- | app/Template/group/create.php | 19 | ||||
-rw-r--r-- | app/Template/group/dissociate.php | 25 | ||||
-rw-r--r-- | app/Template/group/edit.php | 22 | ||||
-rw-r--r-- | app/Template/group/index.php | 12 | ||||
-rw-r--r-- | app/Template/group/remove.php | 25 | ||||
-rw-r--r-- | app/Template/group/users.php | 7 |
7 files changed, 48 insertions, 103 deletions
diff --git a/app/Template/group/associate.php b/app/Template/group/associate.php index 9de46f35..87787568 100644 --- a/app/Template/group/associate.php +++ b/app/Template/group/associate.php @@ -1,25 +1,20 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - <?php if (empty($users)): ?> - <p class="alert"><?= t('There is no user available.') ?></p> - <?php else: ?> - <form method="post" action="<?= $this->url->href('group', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - <?= $this->form->hidden('group_id', $values) ?> +<div class="page-header"> + <h2><?= t('Add group member to "%s"', $group['name']) ?></h2> +</div> +<?php if (empty($users)): ?> + <p class="alert"><?= t('There is no user available.') ?></p> +<?php else: ?> + <form class="popover-form" method="post" action="<?= $this->url->href('GroupListController', 'addUser', array('group_id' => $group['id'])) ?>" autocomplete="off"> + <?= $this->form->csrf() ?> + <?= $this->form->hidden('group_id', $values) ?> - <?= $this->form->label(t('User'), 'user_id') ?> - <?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> + <?= $this->form->label(t('User'), 'user_id') ?> + <?= $this->form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> - </form> - <?php endif ?> -</section> + <div class="form-actions"> + <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> + </div> + </form> +<?php endif ?> diff --git a/app/Template/group/create.php b/app/Template/group/create.php deleted file mode 100644 index 4ce6b1f3..00000000 --- a/app/Template/group/create.php +++ /dev/null @@ -1,19 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('group', 'save') ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> - </form> -</section> diff --git a/app/Template/group/dissociate.php b/app/Template/group/dissociate.php index e1c60764..50ef6d61 100644 --- a/app/Template/group/dissociate.php +++ b/app/Template/group/dissociate.php @@ -1,17 +1,12 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - <div class="confirm"> - <p class="alert alert-info"><?= t('Do you really want to remove the user "%s" from the group "%s"?', $user['name'] ?: $user['username'], $group['name']) ?></p> +<div class="page-header"> + <h2><?= t('Remove user from group "%s"', $group['name']) ?></h2> +</div> +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove the user "%s" from the group "%s"?', $user['name'] ?: $user['username'], $group['name']) ?></p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'group', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'users', array('group_id' => $group['id'])) ?> - </div> + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'GroupListController', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'users', array('group_id' => $group['id']), false, 'close-popover') ?> </div> -</section> +</div> diff --git a/app/Template/group/edit.php b/app/Template/group/edit.php deleted file mode 100644 index e9d9dd5a..00000000 --- a/app/Template/group/edit.php +++ /dev/null @@ -1,22 +0,0 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - </ul> - </div> - <form method="post" action="<?= $this->url->href('group', 'update') ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <?= $this->form->hidden('id', $values) ?> - <?= $this->form->hidden('external_id', $values) ?> - - <?= $this->form->label(t('Name'), 'name') ?> - <?= $this->form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> - - <div class="form-actions"> - <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> - </form> -</section> diff --git a/app/Template/group/index.php b/app/Template/group/index.php index 8302e5a8..74e074c3 100644 --- a/app/Template/group/index.php +++ b/app/Template/group/index.php @@ -2,7 +2,7 @@ <div class="page-header"> <ul> <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('All users'), 'user', 'index') ?></li> - <li><i class="fa fa-user-plus fa-fw"></i><?= $this->url->link(t('New group'), 'group', 'create') ?></li> + <li><i class="fa fa-user-plus fa-fw"></i><?= $this->url->link(t('New group'), 'GroupCreationController', 'show', array(), false, 'popover') ?></li> </ul> </div> <?php if ($paginator->isEmpty()): ?> @@ -24,16 +24,16 @@ <?= $this->text->e($group['external_id']) ?> </td> <td> - <?= $this->text->e($group['name']) ?> + <?= $this->url->link($this->text->e($group['name']), 'GroupListController', 'users', array('group_id' => $group['id'])) ?> </td> <td> <div class="dropdown"> <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a> <ul> - <li><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->link(t('Members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->link(t('Edit'), 'group', 'edit', array('group_id' => $group['id'])) ?></li> - <li><?= $this->url->link(t('Remove'), 'group', 'confirm', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Add group member'), 'GroupListController', 'associate', array('group_id' => $group['id']), false, 'popover') ?></li> + <li><?= $this->url->link(t('Members'), 'GroupListController', 'users', array('group_id' => $group['id'])) ?></li> + <li><?= $this->url->link(t('Edit'), 'GroupModificationController', 'show', array('group_id' => $group['id']), false, 'popover') ?></li> + <li><?= $this->url->link(t('Remove'), 'GroupListController', 'confirm', array('group_id' => $group['id']), false, 'popover') ?></li> </ul> </div> </td> diff --git a/app/Template/group/remove.php b/app/Template/group/remove.php index 1cb007b1..408b3d83 100644 --- a/app/Template/group/remove.php +++ b/app/Template/group/remove.php @@ -1,17 +1,12 @@ -<section id="main"> - <div class="page-header"> - <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('View group members'), 'group', 'users', array('group_id' => $group['id'])) ?></li> - </ul> - </div> - <div class="confirm"> - <p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p> +<div class="page-header"> + <h2><?= t('Remove group') ?></h2> +</div> +<div class="confirm"> + <p class="alert alert-info"><?= t('Do you really want to remove this group: "%s"?', $group['name']) ?></p> - <div class="form-actions"> - <?= $this->url->link(t('Yes'), 'group', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> - <?= t('or') ?> - <?= $this->url->link(t('cancel'), 'group', 'index') ?> - </div> + <div class="form-actions"> + <?= $this->url->link(t('Yes'), 'GroupListController', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> </div> -</section> +</div> diff --git a/app/Template/group/users.php b/app/Template/group/users.php index bbd41525..0f802146 100644 --- a/app/Template/group/users.php +++ b/app/Template/group/users.php @@ -1,8 +1,8 @@ <section id="main"> <div class="page-header"> <ul> - <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'group', 'index') ?></li> - <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('Add group member'), 'group', 'associate', array('group_id' => $group['id'])) ?></li> + <li><i class="fa fa-users fa-fw"></i><?= $this->url->link(t('View all groups'), 'GroupListController', 'index') ?></li> + <li><i class="fa fa-plus fa-fw"></i><?= $this->url->link(t('Add group member'), 'GroupListController', 'associate', array('group_id' => $group['id']), false, 'popover') ?></li> </ul> </div> <?php if ($paginator->isEmpty()): ?> @@ -31,7 +31,8 @@ <a href="mailto:<?= $this->text->e($user['email']) ?>"><?= $this->text->e($user['email']) ?></a> </td> <td> - <?= $this->url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> + <i class="fa fa-times fa-fw" aria-hidden="true"></i> + <?= $this->url->link(t('Remove this user'), 'GroupListController', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id']), false, 'popover') ?> </td> </tr> <?php endforeach ?> |