Browse Source

story-content: Added new checks for story tag management so any logged-in user can view the form if the story is open.

1.2
Gisle Aune 6 years ago
parent
commit
68f3effa8d
  1. 2
      marko/page/story-content/components/page/index.marko
  2. 8
      marko/page/story-content/components/story-tags/index.marko

2
marko/page/story-content/components/page/index.marko

@ -12,7 +12,7 @@
</if-permitted> </if-permitted>
</if> </if>
</div> </div>
<story-tags tags=state.story.tags author=state.story.author user=(!state.removed ? input.user : null) on-select("open", "story.tags")/>
<story-tags tags=state.story.tags open=state.story.open author=state.story.author user=(!state.removed ? input.user : null) on-select("open", "story.tags")/>
<annotation if(state.removed) level="error"> <annotation if(state.removed) level="error">
<p> <p>
This story has been removed. Your browser has not refreshed the page yet, This story has been removed. Your browser has not refreshed the page yet,

8
marko/page/story-content/components/story-tags/index.marko

@ -1,6 +1,14 @@
<div class="story-tags"> <div class="story-tags">
<a for(tag in input.tags) href=("/story/by-tag/" + tag.kind + "/" + encodeURIComponent(tag.name)) class=["tag", "color-tag-" + tag.kind.toLowerCase()]>${tag.name}</a> <a for(tag in input.tags) href=("/story/by-tag/" + tag.kind + "/" + encodeURIComponent(tag.name)) class=["tag", "color-tag-" + tag.kind.toLowerCase()]>${tag.name}</a>
<if(input.open)>
<if-permitted user=input.user permission="member">
<a on-click("select", "edit") class="option color-menu">Manage Tags (Open)</a>
</if-permitted>
</if>
<else>
<if-permitted user=input.user author=input.author permission="story.edit"> <if-permitted user=input.user author=input.author permission="story.edit">
<a on-click("select", "edit") class="option color-menu">Manage Tags</a> <a on-click("select", "edit") class="option color-menu">Manage Tags</a>
</if-permitted> </if-permitted>
</else>
</div> </div>
Loading…
Cancel
Save