1 class ArtistsController < ApplicationController
2 if Manifest.manifest.magic_numbers['run_mode'] == 0
3 before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
4 before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
6 before_filter :authenticate_resource_reader, :only => [:index, :show, :resource_pictures]
7 before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
8 before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
24 @item = Artist.show(params[:id], @operators)
26 respond_to do |format|
31 format.json { render :json => @item.to_json(Artist.show_json_opt) }
36 @artist = {:count => Artist.visible_count}
37 respond_to do |format|
38 format.json { render json: @artist.to_json }
44 @artist.supply_default
46 respond_to do |format|
49 format.json { render json: @artist.to_json(Artist.show_json_opt) }
54 @artist = Artist.edit(params[:id], @operators)
55 respond_to do |format|
62 @artist = Artist.new()
63 @artist.supply_default
64 @artist.attributes = params[:artist]
65 @artist.overwrite @operators
66 respond_to do |format|
68 flash[:notice] = I18n.t('flash.notice.created', :model => Artist.model_name.human)
69 format.html { redirect_to root_path }
70 format.json { render json: @artist.to_json(Artist.show_json_opt), status: :created, location: @artist }
72 flash[:notice] = I18n.t('flash.notice.not_created', :model => Artist.model_name.human)
73 format.html { render action: "new" }
74 format.json { render json: @artist.errors, status: :unprocessable_entity }
80 @artist = Artist.edit(params[:id], @operators)
81 @artist.attributes = params[:artist]
82 @artist.overwrite @operators
84 respond_to do |format|
86 flash[:notice] = I18n.t('flash.notice.updated', :model => Artist.model_name.human)
87 format.html { redirect_to '/home/configure' }
88 format.json { head :ok }
90 flash[:notice] = I18n.t('flash.notice.not_updated', :model => Artist.model_name.human)
91 format.html { render action: "edit" }
92 format.json { render json: @artist.errors, status: :unprocessable_entity }
98 @artist = Artist.edit(params[:id], @operators)
101 respond_to do |format|
102 format.html { redirect_to artists_url }
103 format.json { head :ok }