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/comment/create.php | 12 ++++++------ app/Template/comment/edit.php | 12 ++++++------ app/Template/comment/remove.php | 6 +++--- app/Template/comment/show.php | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'app/Template/comment') diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php index d72fa627..4110711e 100644 --- a/app/Template/comment/create.php +++ b/app/Template/comment/create.php @@ -2,10 +2,10 @@

-
- - - + + formCsrf() ?> + formHidden('task_id', $values) ?> + formHidden('user_id', $values) ?>
    @@ -17,7 +17,7 @@
- + formTextarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
@@ -30,7 +30,7 @@ - $task['id'])) ?> + a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
diff --git a/app/Template/comment/edit.php b/app/Template/comment/edit.php index 386dd9b1..51c3ced8 100644 --- a/app/Template/comment/edit.php +++ b/app/Template/comment/edit.php @@ -2,11 +2,11 @@

-
+ - - - + formCsrf() ?> + formHidden('id', $values) ?> + formHidden('task_id', $values) ?>
    @@ -18,7 +18,7 @@
- + formTextarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?>
@@ -30,6 +30,6 @@
- $task['id'])) ?> + a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index 50382369..374d2c37 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -7,11 +7,11 @@

- $comment, 'task' => $task, 'preview' => true)) ?> + render('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?>
- $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> + a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> - $task['id'])) ?> + a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?>
\ No newline at end of file diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index 5e1e9337..2631975a 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -1,7 +1,7 @@

- @ + e($comment['name'] ?: $comment['username']) ?> @

@@ -9,12 +9,12 @@
  • - + acl->isAdminUser() || $this->acl->isCurrentUser($comment['user_id']))): ?>
  • - $task['id'], 'comment_id' => $comment['id'])) ?> + a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
  • - $task['id'], 'comment_id' => $comment['id'])) ?> + a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>
@@ -22,7 +22,7 @@
- markdown( $comment['comment'], array( 'controller' => 'task', @@ -33,7 +33,7 @@ ) ) ?> - + markdown($comment['comment']) ?>
-- cgit v1.2.3