Added comment count to post list

This commit is contained in:
Marcin Kurczewski 2014-10-04 18:25:27 +02:00
parent 16f9c277a1
commit 17cc4e7947
3 changed files with 11 additions and 4 deletions

1
TODO
View file

@ -4,7 +4,6 @@ first major release.
everything related to posts:
- post listing
- better thumbnail loading
- comment count
- search filters
- file_size:3K..5M
- image_size:huge/large/medium/small

View file

@ -5,22 +5,29 @@
<img class="thumb" src="/data/thumbnails/160x160/posts/<%= post.name %>" alt="<%= post.idMarkdown %>"/>
<% if (post.favoriteCount || post.score) { %>
<% if (post.favoriteCount || post.score || post.commentCount) { %>
<div class="info">
<ul>
<% if (post.favoriteCount) { %>
<li>
<i class="fa fa-heart-o"></i>
<i class="fa fa-heart"></i>
<%= post.favoriteCount %>
</li>
<% } %>
<% if (post.score) { %>
<li>
<i class="fa fa-thumbs-o-up"></i>
<i class="fa fa-thumbs-up"></i>
<%= post.score %>
</li>
<% } %>
<% if (post.commentCount) { %>
<li>
<i class="fa fa-comments"></i>
<%= post.commentCount %>
</li>
<% } %>
</ul>
</div>
<% } %>

View file

@ -63,6 +63,7 @@ class PostViewProxy extends AbstractViewProxy
$result->originalFileSize = $post->getOriginalFileSize();
$result->favoriteCount = $post->getFavoriteCount();
$result->score = $post->getScore();
$result->commentCount = $post->getCommentCount();
if (!empty($config[self::FETCH_TAGS]))
$result->tags = $this->tagViewProxy->fromArray($post->getTags());