Move comment templates to a subfolder
This commit is contained in:
@@ -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>
|
||||
@@ -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>
|
||||
7
app/Template/comment/forbidden.php
Normal file
7
app/Template/comment/forbidden.php
Normal file
@@ -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>
|
||||
17
app/Template/comment/remove.php
Normal file
17
app/Template/comment/remove.php
Normal file
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user