66 lines
2 KiB
PHTML
66 lines
2 KiB
PHTML
<?php
|
|
Assets::addStylesheet('comment-small.css');
|
|
Assets::addStylesheet('comment-edit.css');
|
|
Assets::addScript('comment-edit.js');
|
|
?>
|
|
|
|
<div class="comment">
|
|
<div class="avatar">
|
|
<?php $commenter = $this->context->comment->getCommenter() ?>
|
|
<?php if ($commenter): ?>
|
|
<a href="<?= \Chibi\Router::linkTo(['UserController', 'viewAction'], ['name' => $commenter->name]) ?>">
|
|
<img src="<?= htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?= $commenter->name ?>"/>
|
|
</a>
|
|
<?php else: ?>
|
|
<img
|
|
src="<?= \Chibi\Util\Url::makeAbsolute('/media/img/pixel.gif') ?>"
|
|
alt="<?= UserModel::getAnonymousName() ?>">
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<div class="body">
|
|
<div class="header">
|
|
<span class="nickname">
|
|
<?php if ($commenter): ?>
|
|
<a href="<?= \Chibi\Router::linkTo(['UserController', 'viewAction'], ['name' => $commenter->name]) ?>">
|
|
<?= $commenter->name ?>
|
|
</a>
|
|
<?php else: ?>
|
|
<?= UserModel::getAnonymousName() ?>
|
|
<?php endif ?>
|
|
</span>
|
|
|
|
<span class="date" title="<?= TextHelper::formatDate($this->context->comment->commentDate, true) ?>">
|
|
<?= TextHelper::formatDate($this->context->comment->commentDate, false) ?>
|
|
</span>
|
|
|
|
<?php if (Access::check(
|
|
Privilege::EditComment,
|
|
Access::getIdentity($commenter))): ?>
|
|
<span class="edit">
|
|
<a href="<?= \Chibi\Router::linkTo(['CommentController', 'editAction'], ['id' => $this->context->comment->id]) ?>">
|
|
edit
|
|
</a>
|
|
</span>
|
|
<?php endif ?>
|
|
|
|
<?php if (
|
|
Access::check(Privilege::DeleteComment,
|
|
Access::getIdentity($commenter))): ?>
|
|
<span class="delete">
|
|
<a href="<?= \Chibi\Router::linkTo(['CommentController', 'deleteAction'], ['id' => $this->context->comment->id]) ?>"
|
|
class="simple-action confirmable"
|
|
data-confirm-text="Are you sure you want to delete this comment?">
|
|
delete
|
|
</a>
|
|
</span>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<?= $this->context->comment->getText() ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|