1 class HomeController < ApplicationController
2 layout 'test' if MagicNumber['test_layout']
3 before_filter :authenticate_user, :only => [
4 :index, :show, :profile, :configure, :create_token, :delete_token,
5 :scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :resource_pictures, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors
7 before_filter :authenticate_author, :only => [:scrolls, :scroll_panels, :comics, :stories, :story_sheets, :sheets, :sheet_panels, :panels, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors]
8 before_filter :authenticate_artist, :only => [:resource_pictures]
20 if @operators.user.create_token
21 respond_to do |format|
22 flash[:notice] = I18n.t('flash.notice.created', :model => User.human_attribute_name(:authentication_token))
23 format.html { redirect_to({:action => :configure}) }
26 flash[:notice] = I18n.t('flash.notice.not_created', :model => User.human_attribute_name(:authentication_token))
27 format.html { render action: "configure" }
32 if @operators.user.delete_token
33 respond_to do |format|
34 flash[:notice] = I18n.t('flash.notice.destroyed', :model => User.human_attribute_name(:authentication_token))
35 format.html { redirect_to :action => :configure}
38 flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => User.human_attribute_name(:authentication_token))
39 format.html { render action: "configure" }