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]
19 def show_html_format format
27 respond_to do |format|
28 show_html_format format
29 show_prof_format format
30 show_json_format format
40 @artist.supply_default
42 respond_to do |format|
45 format.json { render json: @artist.to_json(Artist.show_json_opt) }
50 @artist = Artist.edit(params[:id], @operators)
51 respond_to do |format|
58 @artist = Artist.new()
59 @artist.supply_default
60 @artist.attributes = params[:artist]
61 @artist.overwrite @operators
62 respond_to do |format|
64 flash[:notice] = I18n.t('flash.notice.created', :model => Artist.model_name.human)
65 format.html { redirect_to root_path }
66 format.json { render json: @artist.to_json(Artist.show_json_opt), status: :created, location: @artist }
68 flash[:notice] = I18n.t('flash.notice.not_created', :model => Artist.model_name.human)
69 format.html { render action: "new" }
70 format.json { render json: @artist.errors, status: :unprocessable_entity }
76 @artist = Artist.edit(params[:id], @operators)
77 @artist.attributes = params[:artist]
78 @artist.overwrite @operators
80 respond_to do |format|
82 flash[:notice] = I18n.t('flash.notice.updated', :model => Artist.model_name.human)
83 format.html { redirect_to '/home/configure' }
84 format.json { head :ok }
86 flash[:notice] = I18n.t('flash.notice.not_updated', :model => Artist.model_name.human)
87 format.html { render action: "edit" }
88 format.json { render json: @artist.errors, status: :unprocessable_entity }
94 @artist = Artist.edit(params[:id], @operators)
97 respond_to do |format|
98 format.html { redirect_to artists_url }
99 format.json { head :ok }