From 3833c12ccce59bcc49c4cfa892401973558f604d Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 2 Jan 2017 17:01:27 -0500 Subject: Refactoring/rewrite of modal boxes handling --- app/Template/project_role/create.php | 8 ++------ app/Template/project_role/edit.php | 8 ++------ app/Template/project_role/remove.php | 9 +++++---- app/Template/project_role/show.php | 27 +++++++++------------------ 4 files changed, 18 insertions(+), 34 deletions(-) (limited to 'app/Template/project_role') diff --git a/app/Template/project_role/create.php b/app/Template/project_role/create.php index d0092243..f554eb17 100644 --- a/app/Template/project_role/create.php +++ b/app/Template/project_role/create.php @@ -1,16 +1,12 @@ -
+ form->csrf() ?> form->hidden('project_id', $values) ?> form->label(t('Role'), 'role') ?> form->text('role', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> -
- - - url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?> -
+ modal->submitButtons() ?>
diff --git a/app/Template/project_role/edit.php b/app/Template/project_role/edit.php index 3aa9e5cf..740ac0fe 100644 --- a/app/Template/project_role/edit.php +++ b/app/Template/project_role/edit.php @@ -1,7 +1,7 @@ -
+ form->csrf() ?> form->hidden('project_id', $values) ?> form->hidden('role_id', $values) ?> @@ -9,9 +9,5 @@ form->label(t('Role'), 'role') ?> form->text('role', $values, $errors, array('autofocus', 'required', 'maxlength="50"')) ?> -
- - - url->link(t('cancel'), 'ProjectRoleController', 'show', array(), false, 'close-popover') ?> -
+ modal->submitButtons() ?>
diff --git a/app/Template/project_role/remove.php b/app/Template/project_role/remove.php index 25875e3a..44d24eda 100644 --- a/app/Template/project_role/remove.php +++ b/app/Template/project_role/remove.php @@ -7,8 +7,9 @@

-
- url->link(t('Yes'), 'ProjectRoleController', 'remove', array('project_id' => $project['id'], 'role_id' => $role['role_id']), true, 'btn btn-red') ?> - url->link(t('cancel'), 'ProjectRoleController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?> -
+ modal->confirmButtons( + 'ProjectRoleController', + 'remove', + array('project_id' => $project['id'], 'role_id' => $role['role_id']) + ) ?> diff --git a/app/Template/project_role/show.php b/app/Template/project_role/show.php index 59200fc9..5377f7bb 100644 --- a/app/Template/project_role/show.php +++ b/app/Template/project_role/show.php @@ -2,8 +2,7 @@

@@ -19,24 +18,19 @@ @@ -59,8 +53,7 @@ text->e($restriction['title']) ?> - - url->link(t('Remove'), 'ProjectRoleRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), false, 'popover') ?> + modal->confirm('trash-o', t('Remove'), 'ProjectRoleRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?> @@ -77,8 +70,7 @@ text->e($restriction['title']) ?> - - url->link(t('Remove'), 'ColumnRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), false, 'popover') ?> + modal->confirm('trash-o', t('Remove'), 'ColumnRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?> @@ -91,8 +83,7 @@ - - url->link(t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id']), false, 'popover') ?> + modal->confirm('trash-o', t('Remove'), 'ColumnMoveRestrictionController', 'confirm', array('project_id' => $project['id'], 'restriction_id' => $restriction['restriction_id'])) ?> -- cgit v1.2.3