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
47 @artist = Artist.new()
48 @artist.supply_default
49 @artist.attributes = params[:artist]
50 @artist.overwrite @operators
51 respond_to do |format|
53 flash[:notice] = I18n.t('flash.notice.created', :model => Artist.model_name.human)
54 format.html { redirect_to root_path }
55 format.json { render json: @artist.to_json(Artist.show_json_opt), status: :created, location: @artist }
57 flash[:notice] = I18n.t('flash.notice.not_created', :model => Artist.model_name.human)
58 format.html { render action: "new" }
59 format.json { render json: @artist.errors, status: :unprocessable_entity }
65 @artist = Artist.edit(params[:id], @operators)
66 @artist.attributes = params[:artist]
67 @artist.overwrite @operators
69 respond_to do |format|
71 flash[:notice] = I18n.t('flash.notice.updated', :model => Artist.model_name.human)
72 format.html { redirect_to '/home/configure' }
73 format.json { head :ok }
75 flash[:notice] = I18n.t('flash.notice.not_updated', :model => Artist.model_name.human)
76 format.html { render action: "edit" }
77 format.json { render json: @artist.errors, status: :unprocessable_entity }
83 @artist = Artist.edit(params[:id], @operators)
86 respond_to do |format|
87 format.html { redirect_to artists_url }
88 format.json { head :ok }