diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-25 21:28:29 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-25 21:28:29 -0500 |
commit | 5fb686dd9c5474aba3e274bbe7917e8259aa27e3 (patch) | |
tree | 7e9b8ad9b34a1410fe96c5c1fde1ed2db8aef7d6 /app/Template | |
parent | cdfd6a8abefa6cbea2dbae9e7f758914f7fb465e (diff) |
Move comment templates to a subfolder
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/comment/create.php (renamed from app/Template/comment_create.php) | 4 | ||||
-rw-r--r-- | app/Template/comment/edit.php (renamed from app/Template/comment_edit.php) | 4 | ||||
-rw-r--r-- | app/Template/comment/forbidden.php | 7 | ||||
-rw-r--r-- | app/Template/comment/remove.php | 17 | ||||
-rw-r--r-- | app/Template/comment/show.php (renamed from app/Template/comment_show.php) | 4 | ||||
-rw-r--r-- | app/Template/comment_forbidden.php | 9 | ||||
-rw-r--r-- | app/Template/comment_remove.php | 16 | ||||
-rw-r--r-- | app/Template/task_comments.php | 4 |
8 files changed, 32 insertions, 33 deletions
diff --git a/app/Template/comment_create.php b/app/Template/comment/create.php index 5590b77d..d72fa627 100644 --- a/app/Template/comment_create.php +++ b/app/Template/comment/create.php @@ -2,7 +2,7 @@ <h2><?= t('Add a comment') ?></h2> </div> -<form method="post" action="?controller=comment&action=save&task_id=<?= $task['id'] ?>" autocomplete="off"> +<form method="post" action="<?= Helper\u('comment', 'save', array('task_id' => $task['id'])) ?>" autocomplete="off"> <?= Helper\form_csrf() ?> <?= Helper\form_hidden('task_id', $values) ?> <?= Helper\form_hidden('user_id', $values) ?> @@ -30,7 +30,7 @@ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?php if (! isset($skip_cancel)): ?> <?= t('or') ?> - <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> <?php endif ?> </div> </form> diff --git a/app/Template/comment_edit.php b/app/Template/comment/edit.php index 96b7a872..386dd9b1 100644 --- a/app/Template/comment_edit.php +++ b/app/Template/comment/edit.php @@ -2,7 +2,7 @@ <h2><?= t('Edit a comment') ?></h2> </div> -<form method="post" action="?controller=comment&action=update&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>" autocomplete="off"> +<form method="post" action="<?= Helper\u('comment', 'update', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?>" autocomplete="off"> <?= Helper\form_csrf() ?> <?= Helper\form_hidden('id', $values) ?> @@ -30,6 +30,6 @@ <div class="form-actions"> <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/> <?= t('or') ?> - <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> </div> </form> diff --git a/app/Template/comment/forbidden.php b/app/Template/comment/forbidden.php new file mode 100644 index 00000000..1e306d45 --- /dev/null +++ b/app/Template/comment/forbidden.php @@ -0,0 +1,7 @@ +<div class="page-header"> + <h2><?= t('Forbidden') ?></h2> +</div> + +<p class="alert alert-error"> + <?= t('Only administrators or the creator of the comment can access to this page.') ?> +</p>
\ No newline at end of file diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php new file mode 100644 index 00000000..50382369 --- /dev/null +++ b/app/Template/comment/remove.php @@ -0,0 +1,17 @@ +<div class="page-header"> + <h2><?= t('Remove a comment') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this comment?') ?> + </p> + + <?= Helper\template('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?> + + <div class="form-actions"> + <?= Helper\a(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= Helper\a(t('cancel'), 'task', 'show', array('task_id' => $task['id'])) ?> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/comment_show.php b/app/Template/comment/show.php index b2ccc25a..5e1e9337 100644 --- a/app/Template/comment_show.php +++ b/app/Template/comment/show.php @@ -11,10 +11,10 @@ <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li> <?php if ((! isset($not_editable) || ! $not_editable) && (Helper\is_admin() || Helper\is_current_user($comment['user_id']))): ?> <li> - <a href="?controller=comment&action=confirm&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a> + <?= Helper\a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?> </li> <li> - <a href="?controller=comment&action=edit&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('edit') ?></a> + <?= Helper\a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?> </li> <?php endif ?> </ul> diff --git a/app/Template/comment_forbidden.php b/app/Template/comment_forbidden.php deleted file mode 100644 index eeea8404..00000000 --- a/app/Template/comment_forbidden.php +++ /dev/null @@ -1,9 +0,0 @@ -<section id="main"> - <div class="page-header"> - <h2><?= t('Forbidden') ?></h2> - </div> - - <p class="alert alert-error"> - <?= t('Only administrators or the creator of the comment can access to this page.') ?> - </p> -</section>
\ No newline at end of file diff --git a/app/Template/comment_remove.php b/app/Template/comment_remove.php deleted file mode 100644 index 7b117781..00000000 --- a/app/Template/comment_remove.php +++ /dev/null @@ -1,16 +0,0 @@ -<div class="page-header"> - <h2><?= t('Remove a comment') ?></h2> -</div> - -<div class="confirm"> - <p class="alert alert-info"> - <?= t('Do you really want to remove this comment?') ?> - </p> - - <?= Helper\template('comment_show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?> - - <div class="form-actions"> - <a href="?controller=comment&action=remove&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a> - <?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>#comment-<?= $comment['id'] ?>"><?= t('cancel') ?></a> - </div> -</div>
\ No newline at end of file diff --git a/app/Template/task_comments.php b/app/Template/task_comments.php index 5cfa99ce..343e66c5 100644 --- a/app/Template/task_comments.php +++ b/app/Template/task_comments.php @@ -5,7 +5,7 @@ </div> <?php foreach ($comments as $comment): ?> - <?= Helper\template('comment_show', array( + <?= Helper\template('comment/show', array( 'comment' => $comment, 'task' => $task, 'project' => $project, @@ -15,7 +15,7 @@ <?php endforeach ?> <?php if (! isset($not_editable)): ?> - <?= Helper\template('comment_create', array( + <?= Helper\template('comment/create', array( 'skip_cancel' => true, 'values' => array( 'user_id' => Helper\get_user_id(), |