client/posts: display edit link for tagless posts

This commit is contained in:
rr- 2016-07-28 22:05:35 +02:00
parent 1ed7ad4173
commit ef4806e142
2 changed files with 31 additions and 21 deletions

View File

@ -62,6 +62,7 @@
<nav class='tags'>
<h1>Tags (<%- ctx.post.tags.length %>)</h1>
<% if (ctx.post.tags.length) { %>
<ul><!--
--><% for (let tag of ctx.post.tags) { %><!--
--><li><!--
@ -83,5 +84,13 @@
--></li><!--
--><% } %><!--
--></ul>
<% } else { %>
<p>
No tags yet!
<% if (ctx.canEditPosts) { %>
<a href='<%= ctx.getPostEditUrl(ctx.post.id, ctx.parameters) %>'>Add some.</a>
<% } %>
</p>
<% } %>
</nav>
</div>

View File

@ -24,6 +24,7 @@ class PostReadonlySidebarControl extends events.EventTarget {
getTagCategory: this._getTagCategory,
getTagUsages: this._getTagUsages,
canListPosts: api.hasPrivilege('posts:list'),
canEditPosts: api.hasPrivilege('posts:edit'),
canViewTags: api.hasPrivilege('tags:view'),
}));