44 lines
1.7 KiB
PHTML
44 lines
1.7 KiB
PHTML
<div class="comment">
|
|
<div class="avatar">
|
|
<?php if ($this->context->comment->commenter): ?>
|
|
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->comment->commenter->name]) ?>">
|
|
<img src="<?php echo htmlspecialchars($this->context->comment->commenter->getAvatarUrl(40)) ?>" alt="<?php echo $this->context->comment->commenter->name ?: '[deleted user]' ?>"/>
|
|
</a>
|
|
<?php else: ?>
|
|
<img src="<?php echo \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="[deleted user]">
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<div class="body">
|
|
<div class="header">
|
|
<span class="nickname">
|
|
<?php if ($this->context->comment->commenter): ?>
|
|
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->comment->commenter->name]) ?>">
|
|
<?php echo $this->context->comment->commenter->name ?>
|
|
</a>
|
|
<?php else: ?>
|
|
<div class="nickname">[deleted user]</div>
|
|
<?php endif ?>
|
|
</span>
|
|
|
|
<span class="date">
|
|
<?php echo date('Y-m-d H:i', $this->context->comment->comment_date) ?>
|
|
</span>
|
|
|
|
<?php $secondary = $this->context->comment->commenter->id == $this->context->user->id ? 'own' : 'all' ?>
|
|
<?php if (PrivilegesHelper::confirm($this->context->user, Privilege::DeleteComment, $secondary)): ?>
|
|
<span class="delete">
|
|
<a class="simple-action" href="<?php echo \Chibi\UrlHelper::route('comment', 'delete', ['id' => $this->context->comment->id]) ?>" data-confirm-text="Are you sure you want to delete this comment?">
|
|
delete
|
|
</a>
|
|
</span>
|
|
<?php endif ?>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<?php echo $this->context->comment->getText() ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|