2014-02-01 11:17:02 +01:00
|
|
|
<?php
|
2014-02-27 15:04:36 +01:00
|
|
|
CustomAssetViewDecorator::setSubTitle('comments');
|
2014-02-01 11:17:02 +01:00
|
|
|
?>
|
|
|
|
|
2014-02-24 00:17:01 +01:00
|
|
|
<?php if (empty($this->context->transport->posts)): ?>
|
2013-10-17 22:57:32 +02:00
|
|
|
<p class="alert alert-warning">No comments to show.</p>
|
|
|
|
<?php else: ?>
|
2014-02-01 11:17:02 +01:00
|
|
|
<?php
|
2014-02-27 15:04:36 +01:00
|
|
|
CustomAssetViewDecorator::addStylesheet('comment-list.css');
|
|
|
|
CustomAssetViewDecorator::addStylesheet('comment-small.css');
|
|
|
|
CustomAssetViewDecorator::addStylesheet('comment-edit.css');
|
|
|
|
CustomAssetViewDecorator::addScript('comment-edit.js');
|
2014-02-01 11:17:02 +01:00
|
|
|
?>
|
|
|
|
|
2014-01-25 16:34:20 +01:00
|
|
|
<div class="comments-wrapper">
|
|
|
|
<div class="comments paginator-content">
|
2014-02-24 00:17:01 +01:00
|
|
|
<?php foreach ($this->context->transport->posts as $post): ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
<div class="comment-group">
|
|
|
|
<div class="post-wrapper">
|
2014-02-24 00:17:01 +01:00
|
|
|
<?php $this->context->post = $post ?>
|
2014-04-27 14:44:06 +02:00
|
|
|
<?= $this->renderFile('post-small') ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="comments">
|
2014-02-24 00:17:01 +01:00
|
|
|
<?php $comments = array_reverse($post->getComments()) ?>
|
|
|
|
<?php foreach (array_slice($comments, 0, $this->config->comments->maxCommentsInList) as $comment): ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
<?php $this->context->comment = $comment ?>
|
2014-04-27 14:44:06 +02:00
|
|
|
<?= $this->renderFile('comment-small') ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
<?php endforeach ?>
|
2014-02-24 00:17:01 +01:00
|
|
|
|
|
|
|
<?php if (count($comments) > $this->config->comments->maxCommentsInList): ?>
|
2014-04-27 14:44:06 +02:00
|
|
|
<a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
|
2014-02-24 00:17:01 +01:00
|
|
|
<span class="hellip">(more…)</span>
|
|
|
|
</a>
|
|
|
|
<?php endif ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
2013-10-17 22:57:32 +02:00
|
|
|
</div>
|
2014-01-25 16:34:20 +01:00
|
|
|
<?php endforeach ?>
|
|
|
|
</div>
|
2013-10-17 22:57:32 +02:00
|
|
|
|
2014-01-25 16:34:20 +01:00
|
|
|
<?php $this->renderFile('paginator') ?>
|
|
|
|
</div>
|
2013-10-17 22:57:32 +02:00
|
|
|
<?php endif ?>
|