fixes #1383
This commit is contained in:
@@ -2,7 +2,7 @@ class ArtistsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :member_only, :except => [:index, :show, :banned]
|
||||
before_filter :builder_only, :only => [:destroy]
|
||||
before_filter :admin_only, :only => [:ban]
|
||||
before_filter :admin_only, :only => [:ban, :unban]
|
||||
|
||||
def new
|
||||
@artist = Artist.new_with_defaults(params)
|
||||
@@ -32,6 +32,12 @@ class ArtistsController < ApplicationController
|
||||
redirect_to(artist_path(@artist), :notice => "Artist was banned")
|
||||
end
|
||||
|
||||
def unban
|
||||
@artist = Artist.find(params[:id])
|
||||
@artist.unban!
|
||||
redirect_to(artist_path(@artist), :notice => "Artist was unbanned")
|
||||
end
|
||||
|
||||
def index
|
||||
search_params = params[:search].present? ? params[:search] : params
|
||||
@artists = Artist.search(search_params).order("id desc").paginate(params[:page], :limit => params[:limit])
|
||||
|
||||
Reference in New Issue
Block a user