Fixed post list disregarding viewPosts privilege

This commit is contained in:
Marcin Kurczewski
2014-11-22 13:10:00 +01:00
parent b14f02810e
commit 4e6fe634e1
5 changed files with 40 additions and 21 deletions

View File

@ -1,6 +1,6 @@
<div class="post-comment">
<div class="post">
<%= postTemplate({post: post, util: util}) %>
<%= postTemplate({post: post, util: util, canViewPosts: canViewPosts}) %>
</div>
<div class="post-comments-target">

View File

@ -1,7 +1,12 @@
<div class="post-small post-type-<%= post.contentType %> ">
<a class="link"
href="<%= util.appendComplexRouteParam('#/post/' + post.id, typeof(query) !== 'undefined' ? query : {}) %>"
title="<%= _.map(post.tags, function(tag) { return '#' + tag.name; }).join(', ') %>">
<% if (canViewPosts) { %>
<a class="link"
href="<%= util.appendComplexRouteParam('#/post/' + post.id, typeof(query) !== 'undefined' ? query : {}) %>"
title="<%= _.map(post.tags, function(tag) { return '#' + tag.name; }).join(', ') %>">
<% } else { %>
<span class="link">
<% } %>
<img width="160" height="160" class="thumb" src="/data/thumbnails/160x160/posts/<%= post.name %>" alt="<%= post.idMarkdown %>"/>
@ -31,7 +36,12 @@
</ul>
</div>
<% } %>
</a>
<% if (canViewPosts) { %>
</a>
<% } else { %>
</span>
<% } %>
<div class="action">
<button>Action</button>