From f7e4c3928aba9cb7f5222cb4af67846312bbb435 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 14 Feb 2015 16:11:13 -0500 Subject: Refactoring/simplification of the pull-request about links --- app/Template/link/create.php | 18 +++++++++++++++++ app/Template/link/edit.php | 48 +++++++++----------------------------------- app/Template/link/index.php | 21 ++++++++++--------- app/Template/link/remove.php | 26 +++++++++++------------- 4 files changed, 52 insertions(+), 61 deletions(-) create mode 100644 app/Template/link/create.php (limited to 'app/Template/link') diff --git a/app/Template/link/create.php b/app/Template/link/create.php new file mode 100644 index 00000000..12589574 --- /dev/null +++ b/app/Template/link/create.php @@ -0,0 +1,18 @@ + + +
+ + formCsrf() ?> + + formLabel(t('Label'), 'label') ?> + formText('label', $values, $errors, array('required')) ?> + + formLabel(t('Opposite label'), 'opposite_label') ?> + formText('opposite_label', $values, $errors) ?> + +
+ +
+
\ No newline at end of file diff --git a/app/Template/link/edit.php b/app/Template/link/edit.php index 71d4f3ca..d9ce280c 100644 --- a/app/Template/link/edit.php +++ b/app/Template/link/edit.php @@ -1,49 +1,21 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/Template/link/index.php b/app/Template/link/index.php index 0c19b614..90d1c357 100644 --- a/app/Template/link/index.php +++ b/app/Template/link/index.php @@ -1,30 +1,33 @@ - -
- + - +
e($link['label'])) ?> | e($link['label_inverse'])) ?> + + + + | + +
    - a(t('Edit'), 'link', 'edit', array('link_id' => $link['link_id'], 'project_id' => $link['project_id'])) ?> + a(t('Edit'), 'link', 'edit', array('link_id' => $link['id'])) ?> - a(t('Remove'), 'link', 'confirm', array('link_id' => $link['link_id'], 'project_id' => $link['project_id'])) ?> + a(t('Remove'), 'link', 'confirm', array('link_id' => $link['id'])) ?>
- + -
-render('link/edit', array('values' => $values, 'errors' => $errors, 'project' => $project)) ?> +render('link/create', array('values' => $values, 'errors' => $errors)) ?> \ No newline at end of file diff --git a/app/Template/link/remove.php b/app/Template/link/remove.php index d0b14b08..a802feb0 100644 --- a/app/Template/link/remove.php +++ b/app/Template/link/remove.php @@ -1,17 +1,15 @@ -
- + -
-

- -

+
+

+ +

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