class ArtistsController < ApplicationController
-layout 'test'
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show, :new, :create, :edit, :update, :destroy]
before_filter :authenticate_admin!, :only => [:list, :browse]
class AuthorsController < ApplicationController
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show, :edit, :update]
before_filter :authenticate_admin!, :only => [:list, :browse]
class BalloonsController < ApplicationController
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_admin!, :only => [:list, :browse]
def list
class ColorsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
# GET /colors
# GET /colors.json
class ComicsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
if MagicNumber['run_mode'] == 0
before_filter :authenticate_user!, :only => [:new, :create, :edit, :update, :destroy]
else
class GroundColorsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index]
# GET /ground_colors
class GroundPicturesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index]
# GET /ground_pictures
class HomeController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [
:index, :show, :profile, :configure, :create_token, :delete_token, :step2, :save_step2, :step3, :save_step3,
:comic, :panel, :picture, :panel_picture, :panel_color, :ground_picture, :ground_color
class LicenseGroupsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /license_groups
class LicensesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_admin!, :only => [:list, :browse]
# GET /licenses
class OriginalPictureLicenseGroupsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:new, :create]
before_filter :authenticate_artist, :only => [:new, :create]
#原画
class OriginalPicturesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show, :history, :new, :edit, :create, :update, :destroy]
before_filter :authenticate_admin!, :only => [:list, :browse]
before_filter :authenticate_artist, :only => [:index, :show, :history, :new, :edit, :create, :update, :destroy]
class PanelColorsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index]
# GET /ground_pictures
class PanelPicturesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show]
before_filter :authenticate_admin!, :only => [:list, :browse]
class PanelsController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
before_filter :authenticate_admin!, :only => [:list, :browse]
class PicturesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:show, :credit, :md5]
before_filter :authenticate_artist, :only => [:md5]
class ResourcePicturesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show, :credit, :new, :create, :update]
before_filter :authenticate_admin!, :only => [:list, :browse]
before_filter :authenticate_artist, :only => [:new, :create]
class SpeechBalloonTemplatesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show]
before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
class SpeechBalloonsController < ApplicationController
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_admin!, :only => [:list, :browse]
def list
class SpeechesController < ApplicationController
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show]
before_filter :authenticate_admin!, :only => [:list, :browse]
class StoriesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
if MagicNumber['run_mode'] == 0
before_filter :authenticate_user!, :only => [:new, :create, :edit, :update, :destroy]
else
end
def production_layout
- Pettanr::Application.test_layout = false
+ MagicNumber['test_layout'] = false
respond_to do |format|
format.html { render text: 'production', status: 200 }
end
end
def test_layout
- Pettanr::Application.test_layout = 'test'
+ MagicNumber['test_layout'] = 'test'
respond_to do |format|
format.html { render text: 'test', status: 200 }
end
class SystemPicturesController < ApplicationController
- layout 'test' if Pettanr::Application.test_layout
+ layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user!, :only => [:index, :show]
before_filter :authenticate_admin!, :only => [:list, :browse, :new, :create]
<head>\r
<title>Pettanr</title>\r
<%= stylesheet_link_tag "application" %>\r
+ <%= stylesheet_link_tag "test.css" %>\r
<%= javascript_include_tag "application" %>\r
<%= csrf_meta_tags %>\r
</head>\r
def self.licenses
@@licenses
end
-
- def self.test_layout=(arg)
- @@test_layout = arg
- end
-
- def self.test_layout
- @@test_layout
- end
end
end
-if File.exist? Rails.root + 'config/test_layout'
- Pettanr::Application.test_layout = 'test'
-else
- Pettanr::Application.test_layout = false
-end
Pettanr::Application.licenses = YAML.load(open(Rails.root + 'config/license.yml').read)
MagicNumber = YAML.load(open(Rails.root + 'config/magic_number.yml').read)
+MagicNumber['test_layout'] = if File.exist? Rails.root + 'config/test_layout'
+ 'test'
+else
+ false
+end
y = YAML.load(open(Rails.root + 'config/picture_io.yml').read)
require y[Rails.env]["adapter"]
pio = PictureIO.const_get y[Rails.env]["io"]