From 34d7450d3c13342715e90ec21bceaa13e1baa876 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 28 Dec 2014 11:28:50 -0500 Subject: Template helpers refactoring --- app/Template/action/event.php | 14 ++++++------ app/Template/action/index.php | 42 ++++++++++++++++++------------------ app/Template/action/params.php | 48 +++++++++++++++++++++--------------------- app/Template/action/remove.php | 6 +++--- 4 files changed, 55 insertions(+), 55 deletions(-) (limited to 'app/Template/action') diff --git a/app/Template/action/event.php b/app/Template/action/event.php index 565e900c..67a65c19 100644 --- a/app/Template/action/event.php +++ b/app/Template/action/event.php @@ -3,15 +3,15 @@

-
+ - + formCsrf() ?> - - + formHidden('project_id', $values) ?> + formHidden('action_name', $values) ?> - -
+ formLabel(t('Event'), 'event_name') ?> + formSelect('event_name', $events, $values) ?>
@@ -20,6 +20,6 @@
- $project['id'])) ?> + a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
\ No newline at end of file diff --git a/app/Template/action/index.php b/app/Template/action/index.php index 54f13691..e388fbc9 100644 --- a/app/Template/action/index.php +++ b/app/Template/action/index.php @@ -15,26 +15,26 @@ - - + inList($action['event_name'], $available_events) ?> + inList($action['action_name'], $available_actions) ?>
  • - = + inList($param['name'], $available_params) ?> = - - - - - - - - - - - - + contains($param['name'], 'column_id')): ?> + inList($param['value'], $columns_list) ?> + contains($param['name'], 'user_id')): ?> + inList($param['value'], $users_list) ?> + contains($param['name'], 'project_id')): ?> + inList($param['value'], $projects_list) ?> + contains($param['name'], 'color_id')): ?> + inList($param['value'], $colors_list) ?> + contains($param['name'], 'category_id')): ?> + inList($param['value'], $categories_list) ?> + contains($param['name'], 'label')): ?> + e($param['value']) ?>
  • @@ -42,7 +42,7 @@
- $project['id'], 'action_id' => $action['id'])) ?> + a(t('Remove'), 'action', 'confirm', array('project_id' => $project['id'], 'action_id' => $action['id'])) ?> @@ -51,12 +51,12 @@

-
- - + + formCsrf() ?> + formHidden('project_id', $values) ?> - -
+ formLabel(t('Action'), 'action_name') ?> + formSelect('action_name', $available_actions, $values) ?>
diff --git a/app/Template/action/params.php b/app/Template/action/params.php index f221d92e..3a5ecb86 100644 --- a/app/Template/action/params.php +++ b/app/Template/action/params.php @@ -3,34 +3,34 @@

- + - + formCsrf() ?> - - - + formHidden('project_id', $values) ?> + formHidden('event_name', $values) ?> + formHidden('action_name', $values) ?> $param_desc): ?> - - -
- - -
- - -
- - -
- - -
- - - + contains($param_name, 'column_id')): ?> + formLabel($param_desc, $param_name) ?> + formSelect('params['.$param_name.']', $columns_list, $values) ?>
+ contains($param_name, 'user_id')): ?> + formLabel($param_desc, $param_name) ?> + formSelect('params['.$param_name.']', $users_list, $values) ?>
+ contains($param_name, 'project_id')): ?> + formLabel($param_desc, $param_name) ?> + formSelect('params['.$param_name.']', $projects_list, $values) ?>
+ contains($param_name, 'color_id')): ?> + formLabel($param_desc, $param_name) ?> + formSelect('params['.$param_name.']', $colors_list, $values) ?>
+ contains($param_name, 'category_id')): ?> + formLabel($param_desc, $param_name) ?> + formSelect('params['.$param_name.']', $categories_list, $values) ?>
+ contains($param_name, 'label')): ?> + formLabel($param_desc, $param_name) ?> + formText('params['.$param_name.']', $values) ?> @@ -38,6 +38,6 @@
- $project['id'])) ?> + a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
\ No newline at end of file diff --git a/app/Template/action/remove.php b/app/Template/action/remove.php index 131c2b54..672c08a7 100644 --- a/app/Template/action/remove.php +++ b/app/Template/action/remove.php @@ -4,12 +4,12 @@

- + inList($action['event_name'], $available_events).'/'.$this->inList($action['action_name'], $available_actions)) ?>

- $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> + a(t('Yes'), 'action', 'remove', array('project_id' => $project['id'], 'action_id' => $action['id']), true, 'btn btn-red') ?> - $project['id'])) ?> + a(t('cancel'), 'action', 'index', array('project_id' => $project['id'])) ?>
\ No newline at end of file -- cgit v1.2.3