take suggestions on moderator stories, just not those with privileged tags
also allow moderators to make tag suggestions, we're people too
This commit is contained in:
parent
1d30378877
commit
a337ee850e
|
@ -209,15 +209,19 @@ class Story < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_have_suggestions_from_user?(user)
|
def can_have_suggestions_from_user?(user)
|
||||||
if user
|
if !user
|
||||||
if self.user.is_moderator?
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if user.id == self.user_id
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.tags.select{|t| t.privileged? }.any?
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
# this has to happen just before save rather than in tags_a= because we need
|
# this has to happen just before save rather than in tags_a= because we need
|
||||||
|
|
|
@ -127,7 +127,8 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
|
||||||
:confirm => "Are you sure you want to delete this story?" } %>
|
:confirm => "Are you sure you want to delete this story?" } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% elsif story.can_have_suggestions_from_user?(@user) %>
|
<% end %>
|
||||||
|
<% if story.can_have_suggestions_from_user?(@user) %>
|
||||||
| <%= link_to "suggest", story_suggest_path(story.short_id),
|
| <%= link_to "suggest", story_suggest_path(story.short_id),
|
||||||
:class => "suggester" %>
|
:class => "suggester" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue