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 5 years ago
parent
commit
68f3effa8d
  1. 4
      marko/page/story-content/components/page/index.marko
  2. 14
      marko/page/story-content/components/story-tags/index.marko

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

@ -8,11 +8,11 @@
<a on-click("open", "story.edit") class="color-menu">Edit</a>
</if-permitted>
<if-permitted user=input.user author=state.story.author permission="story.remove">
<a on-click("open", "story.remove") class="color-menu">Remove</a>
<a on-click("open", "story.remove") class="color-menu">Remove</a>
</if-permitted>
</if>
</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">
<p>
This story has been removed. Your browser has not refreshed the page yet,

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

@ -1,6 +1,14 @@
<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>
<if-permitted user=input.user author=input.author permission="story.edit">
<a on-click("select", "edit") class="option color-menu">Manage Tags</a>
</if-permitted>
<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">
<a on-click("select", "edit") class="option color-menu">Manage Tags</a>
</if-permitted>
</else>
</div>
Loading…
Cancel
Save