This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Views/comment/comment-small.phtml
Marcin Kurczewski 50e4b40721 Upgraded to newest chibi
- Separate non-static router class
- Moved some setup code to new method, Core::init
- Persistent database connection between tests
2014-05-23 23:34:50 +02:00

74 lines
2.2 KiB
PHTML

<?php
$this->assets->addStylesheet('comment-small.css');
$this->assets->addStylesheet('comment-edit.css');
$this->assets->addScript('comment-edit.js');
?>
<div class="comment">
<div class="avatar">
<?php $commenter = $this->context->comment->getCommenter() ?>
<?php if ($commenter): ?>
<a href="<?= Core::getRouter()->linkTo(
['UserController', 'genericView'],
['identifier' => $commenter->getName()]) ?>">
<img src="<?= htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?= $commenter->getName() ?>"/>
</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="<?= Core::getRouter()->linkTo(
['UserController', 'genericView'],
['identifier' => $commenter->getName()]) ?>">
<?= $commenter->getName() ?>
</a>
<?php else: ?>
<?= UserModel::getAnonymousName() ?>
<?php endif ?>
</span>
<span class="date" title="<?= TextHelper::formatDate($this->context->comment->getCreationTime(), true) ?>">
<?= TextHelper::formatDate($this->context->comment->getCreationTime(), false) ?>
</span>
<?php if (Access::check(new Privilege(
Privilege::EditComment,
Access::getIdentity($commenter)))): ?>
<span class="edit">
<a href="<?= Core::getRouter()->linkTo(
['CommentController', 'editView'],
['id' => $this->context->comment->getId()]) ?>">
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="<?= Core::getRouter()->linkTo(
['CommentController', 'deleteAction'],
['id' => $this->context->comment->getId()]) ?>">
delete
</a>
</span>
<?php endif ?>
</div>
<div class="content">
<?= $this->context->comment->getTextMarkdown() ?>
</div>
</div>
<div class="clear"></div>
</div>