final fix for #2688: Artists are uneditable
This commit is contained in:
@@ -495,6 +495,10 @@ class Artist < ActiveRecord::Base
|
|||||||
user.is_builder?
|
user.is_builder?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def editable_by?(user)
|
||||||
|
user.is_builder? || (!is_banned? && is_active?)
|
||||||
|
end
|
||||||
|
|
||||||
def visible?
|
def visible?
|
||||||
!is_banned? || CurrentUser.is_gold?
|
!is_banned? || CurrentUser.is_gold?
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,14 +2,15 @@
|
|||||||
<div id="a-edit">
|
<div id="a-edit">
|
||||||
<h1>Edit Artist</h1>
|
<h1>Edit Artist</h1>
|
||||||
|
|
||||||
<% if !@artist.is_active? %>
|
<% if @artist.editable_by?(CurrentUser.user) %>
|
||||||
|
<%= render "form" %>
|
||||||
|
|
||||||
|
<% elsif !@artist.is_active? %>
|
||||||
<p>This artist entry is inactive and cannot be edited.</p>
|
<p>This artist entry is inactive and cannot be edited.</p>
|
||||||
|
|
||||||
<% elsif @artist.is_banned? %>
|
<% elsif @artist.is_banned? %>
|
||||||
<p>The artist requested removal of this page.</p>
|
<p>The artist requested removal of this page.</p>
|
||||||
|
|
||||||
<% else %>
|
|
||||||
<%= render "form" %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user