From 17cc4e7947107bcb0521fc42d1bf08e9408087a3 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 4 Oct 2014 18:25:27 +0200 Subject: [PATCH] Added comment count to post list --- TODO | 1 - public_html/templates/post-list-item.tpl | 13 ++++++++++--- src/Controllers/ViewProxies/PostViewProxy.php | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 0fbcbcea..4e4909d0 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/public_html/templates/post-list-item.tpl b/public_html/templates/post-list-item.tpl index 0d94a4d8..b5c44144 100644 --- a/public_html/templates/post-list-item.tpl +++ b/public_html/templates/post-list-item.tpl @@ -5,22 +5,29 @@ <%= post.idMarkdown %> - <% if (post.favoriteCount || post.score) { %> + <% if (post.favoriteCount || post.score || post.commentCount) { %>
<% } %> diff --git a/src/Controllers/ViewProxies/PostViewProxy.php b/src/Controllers/ViewProxies/PostViewProxy.php index c93c5c3a..c4a3f738 100644 --- a/src/Controllers/ViewProxies/PostViewProxy.php +++ b/src/Controllers/ViewProxies/PostViewProxy.php @@ -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());