class ArtistsController < ApplicationController
layout 'test' if MagicNumber['test_layout']
- before_filter :authenticate_user!, :only => [:index, :show, :new, :create, :edit, :update, :destroy]
- before_filter :authenticate_author, :only => [:index, :show, :new, :create, :edit, :update, :destroy]
+ if MagicNumber['run_mode'] == 0
+ before_filter :authenticate_user!, :only => [:new, :create, :edit, :update, :destroy]
+ before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
+ else
+ before_filter :authenticate_user!, :only => [:index, :show, :new, :create, :edit, :update, :destroy]
+ before_filter :authenticate_author, :only => [:index, :show, :new, :create, :edit, :update, :destroy]
+ end
before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /artists
@ar.overwrite @author
respond_to do |format|
if @ar.save
- format.html { redirect_to root_path, notice: 'Artist was successfully created.' }
+ flash[:notice] = I18n.t('flash.notice.created', :model => Artist.model_name.human)
+ format.html { redirect_to root_path }
format.json { render json: @ar.to_json(Artist.show_json_opt), status: :created, location: @artist }
else
format.html { render action: "new" }
respond_to do |format|
if @ar.save
- format.html { redirect_to '/home/configure', notice: 'Artist was successfully updated.' }
+ flash[:notice] = I18n.t('flash.notice.updated', :model => Artist.model_name.human)
+ format.html { redirect_to '/home/configure' }
format.json { head :ok }
else
format.html { render action: "edit" }