2014-02-01 11:17:02 +01:00
|
|
|
<?php
|
2014-04-29 21:35:29 +02:00
|
|
|
Assets::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-04-29 21:35:29 +02:00
|
|
|
Assets::addStylesheet('comment-list.css');
|
|
|
|
Assets::addStylesheet('comment-small.css');
|
|
|
|
Assets::addStylesheet('comment-edit.css');
|
|
|
|
Assets::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-04-27 15:59:29 +02:00
|
|
|
<?php
|
|
|
|
$this->context->post = $post;
|
|
|
|
$comments = array_reverse($post->getComments());
|
2014-04-29 21:35:29 +02:00
|
|
|
$commentsToDisplay = array_slice($comments, 0, getConfig()->comments->maxCommentsInList);
|
2014-04-27 15:59:29 +02:00
|
|
|
?>
|
2014-04-29 21:35:29 +02:00
|
|
|
<?php \Chibi\View::render('post-small', $this->context) ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
</div>
|
|
|
|
<div class="comments">
|
2014-04-27 15:59:29 +02:00
|
|
|
<?php foreach ($commentsToDisplay as $comment): ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
<?php $this->context->comment = $comment ?>
|
2014-04-29 21:35:29 +02:00
|
|
|
<?php \Chibi\View::render('comment-small', $this->context) ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
<?php endforeach ?>
|
2014-02-24 00:17:01 +01:00
|
|
|
|
2014-04-27 15:59:29 +02:00
|
|
|
<?php if (count($comments) > count($commentsToDisplay)): ?>
|
2014-04-29 21:35:29 +02:00
|
|
|
<a href="<?= \Chibi\Router::linkTo(['PostController', 'viewAction'], ['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-04-29 21:35:29 +02:00
|
|
|
<?php \Chibi\View::render('paginator', $this->context) ?>
|
2014-01-25 16:34:20 +01:00
|
|
|
</div>
|
2013-10-17 22:57:32 +02:00
|
|
|
<?php endif ?>
|