diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-03-19 11:56:28 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-03-19 11:56:28 -0400 |
commit | 344f585a325a77e86874d0deebe7cd927569bdb4 (patch) | |
tree | 559a8cb8ee955bdd14ee0fcd0bc1646ec35dc3ad /app/Template/comment | |
parent | 9d4ba1471dd8410e1597a18478dbb3b7789d4ec7 (diff) |
Improve comments design
Diffstat (limited to 'app/Template/comment')
-rw-r--r-- | app/Template/comment/remove.php | 6 | ||||
-rw-r--r-- | app/Template/comment/show.php | 48 |
2 files changed, 32 insertions, 22 deletions
diff --git a/app/Template/comment/remove.php b/app/Template/comment/remove.php index 1b5004f4..3174df02 100644 --- a/app/Template/comment/remove.php +++ b/app/Template/comment/remove.php @@ -7,7 +7,11 @@ <?= t('Do you really want to remove this comment?') ?> </p> - <?= $this->render('comment/show', array('comment' => $comment, 'task' => $task, 'preview' => true)) ?> + <?= $this->render('comment/show', array( + 'comment' => $comment, + 'task' => $task, + 'hide_actions' => true + )) ?> <div class="form-actions"> <?= $this->url->link(t('Yes'), 'comment', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), true, 'btn btn-red') ?> diff --git a/app/Template/comment/show.php b/app/Template/comment/show.php index c5963666..ebf4142b 100644 --- a/app/Template/comment/show.php +++ b/app/Template/comment/show.php @@ -1,30 +1,16 @@ <div class="comment <?= isset($preview) ? 'comment-preview' : '' ?>" id="comment-<?= $comment['id'] ?>"> - <p class="comment-title"> - <?= $this->user->avatar($comment['user_id'], $comment['username'], $comment['name'], $comment['email']) ?> + <?= $this->user->avatar($comment['user_id'], $comment['username'], $comment['name'], $comment['email']) ?> + <div class="comment-title"> <?php if (! empty($comment['username'])): ?> - <span class="comment-username"><?= $this->text->e($comment['name'] ?: $comment['username']) ?></span> @ + <span class="comment-username"><?= $this->text->e($comment['name'] ?: $comment['username']) ?></span> <?php endif ?> <span class="comment-date"><?= $this->dt->datetime($comment['date_creation']) ?></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 ($editable && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?> - <li> - <?= $this->url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?> - </li> - <li> - <?= $this->url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?> - </li> - <?php endif ?> - </ul> - <?php endif ?> + </div> + <div class="comment-content"> <div class="markdown"> <?php if (isset($is_public) && $is_public): ?> <?= $this->text->markdown( @@ -50,6 +36,26 @@ ) ?> <?php endif ?> </div> - </div> -</div>
\ No newline at end of file + + <?php if (! isset($hide_actions)): ?> + <div class="comment-actions"> + <ul> + <li> + <i class="fa fa-link fa-fw"></i> + <a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a> + </li> + <?php if ($editable && ($this->user->isAdmin() || $this->user->isCurrentUser($comment['user_id']))): ?> + <li> + <i class="fa fa-remove fa-fw"></i> + <?= $this->url->link(t('remove'), 'comment', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?> + </li> + <li> + <i class="fa fa-edit fa-fw"></i> + <?= $this->url->link(t('edit'), 'comment', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'comment_id' => $comment['id']), false, 'popover') ?> + </li> + <?php endif ?> + </ul> + </div> + <?php endif ?> +</div> |