From abdf6f97800e7e838b5841820815385b183bab67 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 16 May 2016 20:19:07 -0400 Subject: Improve group controllers and views --- app/Template/group/associate.php | 41 +++++++++++++++++---------------------- app/Template/group/create.php | 19 ------------------ app/Template/group/dissociate.php | 25 ++++++++++-------------- app/Template/group/edit.php | 22 --------------------- app/Template/group/index.php | 12 ++++++------ app/Template/group/remove.php | 25 ++++++++++-------------- app/Template/group/users.php | 7 ++++--- 7 files changed, 48 insertions(+), 103 deletions(-) delete mode 100644 app/Template/group/create.php delete mode 100644 app/Template/group/edit.php (limited to 'app/Template/group') 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 @@ -
- - -

- -
- form->csrf() ?> - form->hidden('group_id', $values) ?> + + +

+ + + form->csrf() ?> + form->hidden('group_id', $values) ?> - form->label(t('User'), 'user_id') ?> - form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> + form->label(t('User'), 'user_id') ?> + form->select('user_id', $users, $values, $errors, array('required'), 'chosen-select') ?> -
- - - url->link(t('cancel'), 'group', 'index') ?> -
-
- -
+
+ + + url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?> +
+ + 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 @@ -
- -
- form->csrf() ?> - - form->label(t('Name'), 'name') ?> - form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> - -
- - - url->link(t('cancel'), 'group', 'index') ?> -
-
-
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 @@ -
- -
-

+ +
+

-
- url->link(t('Yes'), 'group', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> - - url->link(t('cancel'), 'group', 'users', array('group_id' => $group['id'])) ?> -
+
+ url->link(t('Yes'), 'GroupListController', 'removeUser', array('group_id' => $group['id'], 'user_id' => $user['id']), true, 'btn btn-red') ?> + + url->link(t('cancel'), 'GroupListController', 'users', array('group_id' => $group['id']), false, 'close-popover') ?>
-
+ 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 @@ -
- -
- form->csrf() ?> - - form->hidden('id', $values) ?> - form->hidden('external_id', $values) ?> - - form->label(t('Name'), 'name') ?> - form->text('name', $values, $errors, array('autofocus', 'required', 'maxlength="100"')) ?> - -
- - - url->link(t('cancel'), 'group', 'index') ?> -
-
-
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 @@ isEmpty()): ?> @@ -24,16 +24,16 @@ text->e($group['external_id']) ?> - text->e($group['name']) ?> + url->link($this->text->e($group['name']), 'GroupListController', 'users', array('group_id' => $group['id'])) ?> 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 @@ -
- -
-

+ +
+

-
- url->link(t('Yes'), 'group', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> - - url->link(t('cancel'), 'group', 'index') ?> -
+
+ url->link(t('Yes'), 'GroupListController', 'remove', array('group_id' => $group['id']), true, 'btn btn-red') ?> + + url->link(t('cancel'), 'GroupListController', 'index', array(), false, 'close-popover') ?>
-
+ 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 @@
isEmpty()): ?> @@ -31,7 +31,8 @@ text->e($user['email']) ?> - url->link(t('Remove this user'), 'group', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id'])) ?> + + url->link(t('Remove this user'), 'GroupListController', 'dissociate', array('group_id' => $group['id'], 'user_id' => $user['id']), false, 'popover') ?> -- cgit v1.2.3