72 lines
2.1 KiB
PHTML
72 lines
2.1 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', 'genericView'], ['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', 'genericView'],
|
|
['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(new Privilege(
|
|
Privilege::EditComment,
|
|
Access::getIdentity($commenter)))): ?>
|
|
<span class="edit">
|
|
<a href="<?= \Chibi\Router::linkTo(
|
|
['CommentController', 'editView'],
|
|
['id' => $this->context->comment->id]) ?>">
|
|
edit
|
|
</a>
|
|
</span>
|
|
<?php endif ?>
|
|
|
|
<?php if (Access::check(new Privilege(
|
|
Privilege::DeleteComment,
|
|
Access::getIdentity($commenter)))): ?>
|
|
<span class="delete">
|
|
<a class="simple-action confirmable"
|
|
data-confirm-text="Are you sure you want to delete this comment?"
|
|
href="<?= \Chibi\Router::linkTo(
|
|
['CommentController', 'deleteAction'],
|
|
['id' => $this->context->comment->id]) ?>">
|
|
delete
|
|
</a>
|
|
</span>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<?= $this->context->comment->getText() ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|