diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-05-22 12:28:28 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-05-22 12:28:28 -0400 |
commit | 2230dd4e6b148346c0ec596b9e3e12996a762ed8 (patch) | |
tree | ef99ccde4f8b18592a3fb06a6ec45162c501fe38 /app/Templates/comment_show.php | |
parent | a750b8ab2a0cb715da6fd9025a7ec8375db68a4d (diff) |
Code refactoring (add autoloader and change files organization)
Diffstat (limited to 'app/Templates/comment_show.php')
-rw-r--r-- | app/Templates/comment_show.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/Templates/comment_show.php b/app/Templates/comment_show.php new file mode 100644 index 00000000..24bf9070 --- /dev/null +++ b/app/Templates/comment_show.php @@ -0,0 +1,36 @@ +<div class="<?= isset($display_edit_form) && $display_edit_form === true ? 'comment-edit' : 'comment' ?>" id="comment-<?= $comment['id'] ?>"> + <p class="comment-title"> + <span class="comment-username"><?= Helper\escape($comment['username']) ?></span> @ <span class="comment-date"><?= dt('%B %e, %G at %k:%M %p', $comment['date']) ?></span> + </p> + <?php if (isset($task)): ?> + <ul class="comment-actions"> + <li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li> + <?php if (Helper\is_admin() || Helper\is_current_user($comment['user_id'])): ?> + <li> + <a href="?controller=comment&action=confirm&project_id=<?= $task['project_id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a> + </li> + <li> + <a href="?controller=comment&action=edit&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>#comment-<?= $comment['id'] ?>"><?= t('edit') ?></a> + </li> + <?php endif ?> + </ul> + <?php endif ?> + + <?php if (isset($display_edit_form) && $display_edit_form === true): ?> + <form method="post" action="?controller=comment&action=update&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>" autocomplete="off"> + + <?= Helper\form_hidden('id', $values) ?> + <?= Helper\form_textarea('comment', $values, $errors, array('required', 'placeholder="'.t('Leave a comment').'"')) ?><br/> + + <div class="form-actions"> + <input type="submit" value="<?= t('Update this comment') ?>" class="btn btn-blue"/> + <?= t('or') ?> + <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a> + </div> + </form> + <?php else: ?> + <div class="markdown"> + <?= Helper\markdown($comment['comment']) ?> + </div> + <?php endif ?> +</div>
\ No newline at end of file |