2016-06-01 22:07:51 +00:00
|
|
|
<div class='post-list'>
|
|
|
|
<% if (ctx.results.length) { %>
|
|
|
|
<ul>
|
2016-06-11 07:59:06 +00:00
|
|
|
<% for (let post of ctx.results) { %>
|
2016-06-01 22:07:51 +00:00
|
|
|
<li>
|
2016-06-11 07:59:29 +00:00
|
|
|
<% if (ctx.canViewPosts) { %>
|
2016-07-07 19:18:35 +00:00
|
|
|
<a class='thumbnail-wrapper' href='<%= ctx.getPostUrl(post.id, ctx.parameters) %>' title='@<%- post.id %> (<%- post.type %>) Tags: <%- post.tags.map(tag => '#' + tag).join(' ') %>'>
|
2016-06-11 07:59:29 +00:00
|
|
|
<% } else { %>
|
2016-07-05 19:20:28 +00:00
|
|
|
<a class='thumbnail-wrapper'>
|
2016-06-11 07:59:29 +00:00
|
|
|
<% } %>
|
2016-06-01 22:07:51 +00:00
|
|
|
<%= ctx.makeThumbnail(post.thumbnailUrl) %>
|
2016-06-23 09:41:52 +00:00
|
|
|
<span class='type' data-type='<%- post.type %>'>
|
|
|
|
<%- post.type %>
|
2016-06-01 22:07:51 +00:00
|
|
|
</span>
|
|
|
|
<% if (post.score || post.favoriteCount || post.commentCount) { %>
|
|
|
|
<span class='stats'>
|
|
|
|
<% if (post.score) { %>
|
|
|
|
<span class='icon'>
|
|
|
|
<i class='fa fa-star'></i>
|
2016-06-23 09:41:52 +00:00
|
|
|
<%- post.score %>
|
2016-06-01 22:07:51 +00:00
|
|
|
</span>
|
|
|
|
<% } %>
|
|
|
|
<% if (post.favoriteCount) { %>
|
|
|
|
<span class='icon'>
|
|
|
|
<i class='fa fa-heart'></i>
|
2016-06-23 09:41:52 +00:00
|
|
|
<%- post.favoriteCount %>
|
2016-06-01 22:07:51 +00:00
|
|
|
</span>
|
|
|
|
<% } %>
|
|
|
|
<% if (post.commentCount) { %>
|
|
|
|
<span class='icon'>
|
|
|
|
<i class='fa fa-commenting'></i>
|
2016-06-23 09:41:52 +00:00
|
|
|
<%- post.commentCount %>
|
2016-06-01 22:07:51 +00:00
|
|
|
</span>
|
|
|
|
<% } %>
|
|
|
|
</span>
|
|
|
|
<% } %>
|
|
|
|
</a>
|
2016-07-07 19:18:35 +00:00
|
|
|
<% if (ctx.parameters && ctx.parameters.tag) { %>
|
2016-07-05 19:20:28 +00:00
|
|
|
<a data-post-id='<%= post.id %>' class='masstag'>
|
|
|
|
</a>
|
|
|
|
<% } %>
|
2016-06-01 22:07:51 +00:00
|
|
|
</li>
|
2016-06-11 07:59:06 +00:00
|
|
|
<% } %>
|
2016-06-01 22:07:51 +00:00
|
|
|
<%= ctx.makeFlexboxAlign() %>
|
|
|
|
</ul>
|
|
|
|
<% } %>
|
|
|
|
</div>
|