Added favorite count to post list
This commit is contained in:
parent
6e22efdd6e
commit
f090a752f0
4 changed files with 32 additions and 1 deletions
1
TODO
1
TODO
|
@ -21,7 +21,6 @@ everything related to posts:
|
|||
|
||||
- post listing
|
||||
- better thumbnail loading
|
||||
- fav count
|
||||
- score
|
||||
- comment count
|
||||
- regard safety settings
|
||||
|
|
|
@ -40,6 +40,24 @@
|
|||
opacity: .9;
|
||||
}
|
||||
|
||||
#post-list .posts li a .info {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #5da;
|
||||
color: black;
|
||||
}
|
||||
#post-list .posts li a .info li {
|
||||
display: inline-block;
|
||||
margin: 0.1em 0.5em;
|
||||
}
|
||||
#post-list .posts li a:focus .info,
|
||||
#post-list .posts li a:hover .info {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#post-list .posts li:not(.post-type-image) a:before {
|
||||
display: block;
|
||||
content: '';
|
||||
|
|
|
@ -4,5 +4,18 @@
|
|||
href="#/post/<%= post.id %>">
|
||||
|
||||
<img class="thumb" src="/data/thumbnails/160x160/posts/<%= post.name %>" alt="<%= post.idMarkdown %>"/>
|
||||
|
||||
<% if (post.favoriteCount) { %>
|
||||
<div class="info">
|
||||
<ul>
|
||||
<% if (post.favoriteCount) { %>
|
||||
<li>
|
||||
<i class="fa fa-heart"></i>
|
||||
<%= post.favoriteCount %>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
<% } %>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -39,6 +39,7 @@ class PostViewProxy extends AbstractViewProxy
|
|||
$result->featureCount = $post->getFeatureCount();
|
||||
$result->lastFeatureTime = $post->getLastFeatureTime();
|
||||
$result->originalFileSize = $post->getOriginalFileSize();
|
||||
$result->favoriteCount = $post->getFavoriteCount();
|
||||
|
||||
if (!empty($config[self::FETCH_TAGS]))
|
||||
$result->tags = $this->tagViewProxy->fromArray($post->getTags());
|
||||
|
|
Loading…
Reference in a new issue