class HomeController < ApplicationController
- layout 'test' if MagicNumber['test_layout']
before_filter :authenticate_user, :only => [
:index, :show, :profile, :configure, :create_token, :delete_token,
- :comic, :story, :panel, :resource_picture, :panel_picture, :panel_color, :ground_picture, :ground_color
+ :scrolls, :scroll_panels, :comics, :comic_stories, :stories, :story_sheets,
+ :sheets, :sheet_panels,
+ :panels, :panel_pictures, :speech_balloons, :balloons, :speeches, :ground_pictures, :ground_colors
]
- before_filter :authenticate_author, :only => [:comic, :story, :panel, :panel_picture, :panel_color, :ground_picture, :ground_color]
- before_filter :authenticate_artist, :only => [:resource_picture]
+ before_filter :authenticate_author, :only => [
+ :scrolls, :scroll_panels, :comics, :comic_stories, :stories, :story_sheets,
+ :sheets, :sheet_panels,
+ :panels, :panel_pictures, :speech_balloons, :balloons, :speeches, :ground_pictures, :ground_colors
+ ]
+ before_filter :authenticate_artist, :only => [:resource_pictures]
def index
end
end
def configure
+ @author = @operators.author
+ unless @author
+ @author = Author.new
+ @author.supply_default
+ end
+ @author.boosts 'post'
+ @author_form = Locmare::Bucket.factory @author.item_name, 'default', @author, true, true, @operators
+ @artist = @operators.artist
+ unless @artist
+ @artist = Artist.new
+ @artist.supply_default
+ end
+ @artist.boosts 'post'
+ @artist_form = Locmare::Bucket.factory @artist.item_name, 'default', @artist, true, true, @operators
end
def create_token
- if @user.create_token
+ if @operators.user.create_token
respond_to do |format|
flash[:notice] = I18n.t('flash.notice.created', :model => User.human_attribute_name(:authentication_token))
format.html { redirect_to({:action => :configure}) }
end
def delete_token
- if @user.delete_token
+ if @operators.user.delete_token
respond_to do |format|
flash[:notice] = I18n.t('flash.notice.destroyed', :model => User.human_attribute_name(:authentication_token))
format.html { redirect_to :action => :configure}
end
end
- def comic
- @page = Author.page params[:page]
- @page_size = Author.comic_page_size params[:page_size]
- @comics = Comic.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @comics.to_json(Comic.list_json_opt) }
- end
+ def scrolls
+ filer_list
end
- def story
- @page = Author.page params[:page]
- @page_size = Author.story_page_size params[:page_size]
- @stories = Story.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render text: Story.list_as_json_text(@stories) }
- end
+ def scroll_panels
+ filer_list
end
- def panel
- @page = Author.page params[:page]
- @page_size = Author.panel_page_size params[:page_size]
- @panels = Panel.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render text: Panel.list_as_json_text(@panels) }
- end
+ def comics
+ filer_list
end
- def panel_picture
- @page = Author.page params[:page]
- @page_size = Author.panel_picture_page_size params[:page_size]
- @panel_pictures = PanelPicture.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @panel_pictures.to_json(PanelPicture.list_json_opt) }
- end
+ def comic_stories
+ filer_list
end
- def panel_color
- @page = Author.page params[:page]
- @page_size = Author.panel_page_size params[:page_size]
- @panel_colors = PanelColor.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @panel_colors.to_json(PanelColor.list_json_opt) }
- end
+ def stories
+ filer_list
end
- def ground_picture
- @page = Author.page params[:page]
- @page_size = Author.panel_page_size params[:page_size]
- @ground_pictures = GroundPicture.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @ground_pictures.to_json(GroundPicture.list_json_opt) }
- end
+ def story_sheets
+ filer_list
end
- def ground_color
- @page = Author.page params[:page]
- @page_size = Author.panel_page_size params[:page_size]
- @ground_colors = GroundColor.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @ground_colors.to_json(GroundColor.list_json_opt) }
- end
+ def sheets
+ filer_list
end
- def resource_picture
- @page = Author.page params[:page]
- @page_size = Author.panel_page_size params[:page_size]
- @resource_pictures = ResourcePicture.mylist(@author, @page, @page_size)
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @resource_pictures.to_json(ResourcePicture.list_json_opt) }
- end
+ def sheet_panels
+ filer_list
+ end
+
+ def panels
+ filer_list
+ end
+
+ def panel_pictures
+ filer_list
+ end
+
+ def speech_balloons
+ filer_list
+ end
+
+ def balloons
+ filer_list
+ end
+
+ def speeches
+ filer_list
+ end
+
+ def ground_pictures
+ filer_list
+ end
+
+ def ground_colors
+ filer_list
+ end
+
+ def resource_pictures
+ filer_list
end
end