2014-02-01 11:17:02 +01:00
|
|
|
<?php
|
2014-04-29 21:35:29 +02:00
|
|
|
Assets::addStylesheet('comment-small.css');
|
|
|
|
Assets::addStylesheet('comment-edit.css');
|
|
|
|
Assets::addScript('comment-edit.js');
|
2014-02-01 11:17:02 +01:00
|
|
|
?>
|
|
|
|
|
2013-10-17 22:57:32 +02:00
|
|
|
<div class="comment">
|
|
|
|
<div class="avatar">
|
2013-12-18 15:10:53 +01:00
|
|
|
<?php $commenter = $this->context->comment->getCommenter() ?>
|
|
|
|
<?php if ($commenter): ?>
|
2014-04-29 21:35:29 +02:00
|
|
|
<a href="<?= \Chibi\Router::linkTo(['UserController', 'viewAction'], ['name' => $commenter->name]) ?>">
|
2014-04-27 14:44:06 +02:00
|
|
|
<img src="<?= htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?= $commenter->name ?>"/>
|
2013-10-17 22:57:32 +02:00
|
|
|
</a>
|
|
|
|
<?php else: ?>
|
2014-04-27 15:59:29 +02:00
|
|
|
<img
|
2014-04-29 21:35:29 +02:00
|
|
|
src="<?= \Chibi\Util\Url::makeAbsolute('/media/img/pixel.gif') ?>"
|
2014-04-27 15:59:29 +02:00
|
|
|
alt="<?= UserModel::getAnonymousName() ?>">
|
2013-10-17 22:57:32 +02:00
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="body">
|
|
|
|
<div class="header">
|
|
|
|
<span class="nickname">
|
2013-12-18 15:10:53 +01:00
|
|
|
<?php if ($commenter): ?>
|
2014-04-29 21:35:29 +02:00
|
|
|
<a href="<?= \Chibi\Router::linkTo(['UserController', 'viewAction'], ['name' => $commenter->name]) ?>">
|
2014-04-27 14:44:06 +02:00
|
|
|
<?= $commenter->name ?>
|
2013-10-17 22:57:32 +02:00
|
|
|
</a>
|
|
|
|
<?php else: ?>
|
2014-04-27 14:44:06 +02:00
|
|
|
<?= UserModel::getAnonymousName() ?>
|
2013-10-17 22:57:32 +02:00
|
|
|
<?php endif ?>
|
|
|
|
</span>
|
|
|
|
|
2014-04-27 14:44:06 +02:00
|
|
|
<span class="date" title="<?= TextHelper::formatDate($this->context->comment->commentDate, true) ?>">
|
|
|
|
<?= TextHelper::formatDate($this->context->comment->commentDate, false) ?>
|
2013-10-17 22:57:32 +02:00
|
|
|
</span>
|
2013-10-17 23:37:41 +02:00
|
|
|
|
2014-04-27 15:59:29 +02:00
|
|
|
<?php if (PrivilegesHelper::confirm(
|
|
|
|
Privilege::EditComment,
|
|
|
|
PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
<span class="edit">
|
2014-04-29 21:35:29 +02:00
|
|
|
<a href="<?= \Chibi\Router::linkTo(['CommentController', 'editAction'], ['id' => $this->context->comment->id]) ?>">
|
2014-01-25 16:34:20 +01:00
|
|
|
edit
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
<?php endif ?>
|
|
|
|
|
2014-04-27 15:59:29 +02:00
|
|
|
<?php if (
|
|
|
|
PrivilegesHelper::confirm(Privilege::DeleteComment,
|
|
|
|
PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
|
2013-10-17 23:37:41 +02:00
|
|
|
<span class="delete">
|
2014-04-29 21:35:29 +02:00
|
|
|
<a href="<?= \Chibi\Router::linkTo(['CommentController', 'deleteAction'], ['id' => $this->context->comment->id]) ?>"
|
2014-04-27 15:59:29 +02:00
|
|
|
class="simple-action confirmable"
|
|
|
|
data-confirm-text="Are you sure you want to delete this comment?">
|
2013-10-17 23:37:41 +02:00
|
|
|
delete
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
<?php endif ?>
|
2013-10-17 22:57:32 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content">
|
2014-04-27 14:44:06 +02:00
|
|
|
<?= $this->context->comment->getText() ?>
|
2013-10-17 22:57:32 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|