client/posts: display edit link for tagless posts
This commit is contained in:
parent
1ed7ad4173
commit
ef4806e142
|
@ -62,6 +62,7 @@
|
||||||
|
|
||||||
<nav class='tags'>
|
<nav class='tags'>
|
||||||
<h1>Tags (<%- ctx.post.tags.length %>)</h1>
|
<h1>Tags (<%- ctx.post.tags.length %>)</h1>
|
||||||
|
<% if (ctx.post.tags.length) { %>
|
||||||
<ul><!--
|
<ul><!--
|
||||||
--><% for (let tag of ctx.post.tags) { %><!--
|
--><% for (let tag of ctx.post.tags) { %><!--
|
||||||
--><li><!--
|
--><li><!--
|
||||||
|
@ -83,5 +84,13 @@
|
||||||
--></li><!--
|
--></li><!--
|
||||||
--><% } %><!--
|
--><% } %><!--
|
||||||
--></ul>
|
--></ul>
|
||||||
|
<% } else { %>
|
||||||
|
<p>
|
||||||
|
No tags yet!
|
||||||
|
<% if (ctx.canEditPosts) { %>
|
||||||
|
<a href='<%= ctx.getPostEditUrl(ctx.post.id, ctx.parameters) %>'>Add some.</a>
|
||||||
|
<% } %>
|
||||||
|
</p>
|
||||||
|
<% } %>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -24,6 +24,7 @@ class PostReadonlySidebarControl extends events.EventTarget {
|
||||||
getTagCategory: this._getTagCategory,
|
getTagCategory: this._getTagCategory,
|
||||||
getTagUsages: this._getTagUsages,
|
getTagUsages: this._getTagUsages,
|
||||||
canListPosts: api.hasPrivilege('posts:list'),
|
canListPosts: api.hasPrivilege('posts:list'),
|
||||||
|
canEditPosts: api.hasPrivilege('posts:edit'),
|
||||||
canViewTags: api.hasPrivilege('tags:view'),
|
canViewTags: api.hasPrivilege('tags:view'),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue