diff options
Diffstat (limited to 'app/Template/comment')
-rw-r--r-- | app/Template/comment/create.php | 36 | ||||
-rw-r--r-- | app/Template/comment/edit.php | 35 | ||||
-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 | 41 |
5 files changed, 136 insertions, 0 deletions
diff --git a/app/Template/comment/create.php b/app/Template/comment/create.php new file mode 100644 index 00000000..d72fa627 --- /dev/null +++ b/app/Template/comment/create.php @@ -0,0 +1,36 @@ +<div class="page-header"> + <h2><?= t('Add a comment') ?></h2> +</div> + +<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) ?> + + <div class="form-tabs"> + <ul class="form-tabs-nav"> + <li class="form-tab form-tab-selected"> + <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a> + </li> + <li class="form-tab"> + <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a> + </li> + </ul> + <div class="write-area"> + <?= Helper\form_textarea('comment', $values, $errors, array(! isset($skip_cancel) ? 'autofocus' : '', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?> + </div> + <div class="preview-area"> + <div class="markdown"></div> + </div> + </div> + + <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div> + + <div class="form-actions"> + <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> + <?php if (! isset($skip_cancel)): ?> + <?= t('or') ?> + <?= 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 new file mode 100644 index 00000000..386dd9b1 --- /dev/null +++ b/app/Template/comment/edit.php @@ -0,0 +1,35 @@ +<div class="page-header"> + <h2><?= t('Edit a comment') ?></h2> +</div> + +<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) ?> + <?= Helper\form_hidden('task_id', $values) ?> + + <div class="form-tabs"> + <ul class="form-tabs-nav"> + <li class="form-tab form-tab-selected"> + <i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a> + </li> + <li class="form-tab"> + <a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a> + </li> + </ul> + <div class="write-area"> + <?= Helper\form_textarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?> + </div> + <div class="preview-area"> + <div class="markdown"></div> + </div> + </div> + + <div class="form-help"><a href="http://kanboard.net/documentation/syntax-guide" target="_blank" rel="noreferrer"><?= t('Write your text in Markdown') ?></a></div> + + <div class="form-actions"> + <input type="submit" value="<?= t('Update') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <?= 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 new file mode 100644 index 00000000..5e1e9337 --- /dev/null +++ b/app/Template/comment/show.php @@ -0,0 +1,41 @@ +<div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>"> + + <p class="comment-title"> + <span class="comment-username"><?= Helper\escape($comment['name'] ?: $comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %Y at %k:%M %p', $comment['date']) ?></span> + </p> + + <div class="comment-inner"> + + <?php if (! isset($preview)): ?> + <ul class="comment-actions"> + <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> + <?= Helper\a(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?> + </li> + <li> + <?= Helper\a(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'comment_id' => $comment['id'])) ?> + </li> + <?php endif ?> + </ul> + <?php endif ?> + + <div class="markdown"> + <?php if (isset($is_public) && $is_public): ?> + <?= Helper\markdown( + $comment['comment'], + array( + 'controller' => 'task', + 'action' => 'readonly', + 'params' => array( + 'token' => $project['token'] + ) + ) + ) ?> + <?php else: ?> + <?= Helper\markdown($comment['comment']) ?> + <?php endif ?> + </div> + + </div> +</div>
\ No newline at end of file |