summaryrefslogtreecommitdiff
path: root/client/html/posts_page.tpl
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2016-06-02 00:07:51 +0200
committerrr- <rr-@sakuya.pl>2016-06-02 23:39:38 +0200
commitf8e6d07feac0927f62b88b5bf00662ad5cfbdcf7 (patch)
tree0a989deae33ebd22330d9aab63bad33ea4469980 /client/html/posts_page.tpl
parent28009bf46d15f2b9bcbbb91e6c0fd7b1a647766d (diff)
client/posts: add proof of concept for post list
Diffstat (limited to 'client/html/posts_page.tpl')
-rw-r--r--client/html/posts_page.tpl39
1 files changed, 39 insertions, 0 deletions
diff --git a/client/html/posts_page.tpl b/client/html/posts_page.tpl
new file mode 100644
index 0000000..1518980
--- /dev/null
+++ b/client/html/posts_page.tpl
@@ -0,0 +1,39 @@
+<div class='post-list'>
+ <% if (ctx.results.length) { %>
+ <ul>
+ <% _.each(ctx.results, post => { %>
+ <li>
+ <a href='/post/<%= post.id %>' title='@<%= post.id %> (<%= post.type %>)&#10;&#10;Tags: <%= post.tags.map(tag => '#' + tag).join(' ') %>'>
+ <%= ctx.makeThumbnail(post.thumbnailUrl) %>
+ <span class='type' data-type='<%= post.type %>'>
+ <%= post.type %>
+ </span>
+ <% if (post.score || post.favoriteCount || post.commentCount) { %>
+ <span class='stats'>
+ <% if (post.score) { %>
+ <span class='icon'>
+ <i class='fa fa-star'></i>
+ <%= post.score %>
+ </span>
+ <% } %>
+ <% if (post.favoriteCount) { %>
+ <span class='icon'>
+ <i class='fa fa-heart'></i>
+ <%= post.favoriteCount %>
+ </span>
+ <% } %>
+ <% if (post.commentCount) { %>
+ <span class='icon'>
+ <i class='fa fa-commenting'></i>
+ <%= post.commentCount %>
+ </span>
+ <% } %>
+ </span>
+ <% } %>
+ </a>
+ </li>
+ <% }) %>
+ <%= ctx.makeFlexboxAlign() %>
+ </ul>
+ <% } %>
+</div>