list_name: 'sheets',\r
},\r
},\r
+ by_comic: {\r
+ type: 'list',\r
+ list: {\r
+ list_name: 'by_comic',\r
+ },\r
+ },\r
by_sheet: {\r
type: 'list',\r
list: {\r
},\r
},\r
artist: {\r
- model_name: '',\r
+ model_name: 'artist',\r
actions: {\r
index: {\r
type: 'list',\r
association_name: 'scroll_panels',\r
},\r
panels: {\r
- type: 'has_many',\r
+ type: 'has_many_through',\r
association_name: 'panels',\r
},\r
by_author: {\r
}, \r
panels: {\r
through: 'scroll_panel',\r
- foreign_key: 'scroll_id'\r
+ foreign_key: 'scroll_id',\r
model: 'panel',\r
}, \r
},\r
},\r
has_many: {\r
stories: {\r
- foreign_key: 'comic_id'\r
+ foreign_key: 'comic_id',\r
model: 'story',\r
}, \r
},\r
has_many: {\r
story_sheets: {\r
foreign_key: 'story_id',\r
- list_method: 'list_by_story',\r
+ model: 'story_sheet',\r
}, \r
sheets: {\r
through: 'story_sheets',\r
- foreign_key: 'story_id'\r
- list_method: 'list_by_story',\r
+ foreign_key: 'story_id',\r
+ model: 'sheet',\r
}, \r
},\r
},\r
has_many: {\r
story_sheets: {\r
foreign_key: 'story_id',\r
- list_method: 'list_by_sheet',\r
+ model: 'story_sheet',\r
}, \r
stories: {\r
through: 'story_sheets',\r
- foreign_key: 'sheet_id'\r
- list_method: 'list_by_sheet',\r
+ foreign_key: 'sheet_id',\r
+ model: 'story',\r
}, \r
sheet_panels: {\r
foreign_key: 'sheet_id',\r
- list_method: 'list_by_sheet',\r
+ model: 'sheet_panel',\r
}, \r
panels: {\r
through: 'sheet_panels',\r
- foreign_key: 'sheet_id'\r
- list_method: 'list_by_sheet',\r
+ foreign_key: 'sheet_id',\r
+ model: 'panel',\r
}, \r
},\r
},\r
has_many: {\r
scroll_panels: {\r
foreign_key: 'panel_id',\r
- list_method: 'list_by_panel',\r
+ model: 'scroll_panel',\r
}, \r
scrolls: {\r
through: 'scroll_panels',\r
- foreign_key: 'panel_id'\r
- list_method: 'list_by_panel',\r
+ foreign_key: 'panel_id',\r
+ model: 'scroll',\r
}, \r
sheet_panels: {\r
foreign_key: 'panel_id',\r
- list_method: 'list_by_panel',\r
+ model: 'sheet_panel',\r
}, \r
sheets: {\r
through: 'sheet_panels',\r
- foreign_key: 'panel_id'\r
- list_method: 'list_by_panel',\r
+ foreign_key: 'panel_id',\r
+ model: 'sheet',\r
}, \r
panel_pictures: {\r
foreign_key: 'panel_id',\r
- list_method: 'list_by_panel',\r
+ model: 'panel_picture',\r
}, \r
speech_balloons: {\r
foreign_key: 'panel_id',\r
- list_method: 'list_by_panel',\r
+ model: 'speech_balloon',\r
}, \r
ground_pictures: {\r
foreign_key: 'panel_id',\r
- list_method: 'list_by_panel',\r
+ model: 'ground_picture',\r
}, \r
ground_colors: {\r
foreign_key: 'panel_id',\r
- list_method: 'list_by_panel',\r
+ model: 'ground_color',\r
}, \r
},\r
},\r
has_one: {\r
balloon: {\r
foreign_key: 'speech_balloon_id',\r
- list_method: 'list_by_speech_balloon',\r
+ model: 'balloon',\r
}, \r
speech: {\r
foreign_key: 'speech_balloon_id',\r
- list_method: 'list_by_speech_balloon',\r
+ model: 'speech',\r
}, \r
},\r
},\r
has_many: {\r
pictures: {\r
foreign_key: 'original_picture_id',\r
- list_method: 'list_by_original_picture',\r
+ model: 'picture',\r
}, \r
},\r
has_one: {\r
resource_picture: {\r
foreign_key: 'original_picture_id',\r
- list_method: 'list_by_original_picture',\r
+ model: 'resource_picture',\r
}, \r
},\r
},\r
has_many: {\r
speech_balloons: {\r
foreign_key: 'speech_balloon_template_id',\r
- list_method: 'list_by_speech_balloon_template',\r
+ model: 'speech_balloon',\r
}, \r
panels: {\r
through: 'speech_balloons',\r
foreign_key: 'speech_balloon_template_id',\r
- list_method: 'list_by_speech_balloon_template',\r
+ model: 'panel',\r
}, \r
},\r
has_one: {\r
has_many: {\r
speeches: {\r
foreign_key: 'writing_format_id',\r
- list_method: 'list_by_writing_format',\r
+ model: 'speech',\r
}, \r
},\r
has_one: {\r
has_many: {\r
licenses: {\r
foreign_key: 'license_group_id',\r
- list_method: 'list_by_license_group',\r
+ model: 'license',\r
}, \r
},\r
has_one: {\r
has_many: {\r
resource_pictures: {\r
foreign_key: 'license_id',\r
- list_method: 'list_by_license',\r
+ model: 'resource_picture',\r
}, \r
},\r
has_one: {\r
has_many: {\r
scrolls: {\r
foreign_key: 'author_id',\r
- list_method: 'list_by_author',\r
+ model: 'scroll',\r
}, \r
comics: {\r
foreign_key: 'author_id',\r
- list_method: 'list_by_author',\r
+ model: 'comic',\r
}, \r
stories: {\r
foreign_key: 'author_id',\r
- list_method: 'list_by_author',\r
+ model: 'story',\r
}, \r
sheets: {\r
foreign_key: 'author_id',\r
- list_method: 'list_by_author',\r
+ model: 'sheet',\r
}, \r
panels: {\r
foreign_key: 'author_id',\r
- list_method: 'list_by_author',\r
+ model: 'panel',\r
}, \r
},\r
has_one: {\r
has_many: {\r
resource_pictures: {\r
foreign_key: 'artist_id',\r
- list_method: 'list_by_artist',\r
+ model: 'resource_picture',\r
}, \r
},\r
has_one: {\r
has_many: {\r
balloons: {\r
foreign_key: 'system_picture_id',\r
- list_method: 'list_by_system_picture',\r
+ model: 'balloon',\r
}, \r
balloon_templates: {\r
foreign_key: 'system_picture_id',\r
- list_method: 'list_by_system_picture',\r
+ model: 'balloon_template',\r
}, \r
licenses: {\r
foreign_key: 'system_picture_id',\r
- list_method: 'list_by_system_picture',\r
+ model: 'license',\r
}, \r
},\r
has_one: {\r
},\r
speech_balloon_template: {\r
lists: {\r
- 'speech_balloons.by_speech_balloon_template': {\r
- model_name: 'speech_balloon',\r
- list_name: 'by_speech_balloon_template',\r
- }, \r
- 'panels.by_speech_balloon_template': {\r
- model_name: 'panel',\r
- list_name: 'by_speech_balloon_template',\r
- }, \r
}, \r
columns: [\r
'id', \r
'system_picture',\r
],\r
has_many: [\r
- 'speech_balloons.by_speech_balloon_template', \r
- 'panels.by_speech_balloon_template', \r
],\r
has_one: [\r
],\r
Pettanr::Application::manifest.profiler_managers[self.model.item_name]
end
- def public_list
+ def public_list
action_name = params[:action]
@action = self.class.controller.open(action_name, params, @operators)
@items = @action.items
:filer => @filer
}
}
- format.json { render json: @items.to_json(Scroll.list_json_opt) }
+ format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+ end
+ end
+
+ def has_many_list
+ @parent_item = self.class.model.show(params[:id], @operators)
+ controller_name = self.class.model.item_name
+ action_name = params[:action]
+ controller = Pettanr::Application::manifest.controller_managers[controller_name]
+ @action = controller.open(action_name, params, @operators)
+ many_name = @action.list.association_model_name
+ @items = @action.list.items @parent_item
+ respond_to do |format|
+ format.html {
+ @filer = Pettanr::Application::manifest.filer_managers[many_name].open(many_name, @items, @operators, @action.list.paginate(@parent_item))
+ render :template => 'system/filer', :locals => {
+ :filer => @filer
+ }
+ }
+ format.json { render json: @items.to_json(self.class.model.list_json_opt) }
+ end
+ end
+
+ def filter_list
+ controller_name = self.class.model.item_name
+ action_name = params[:action]
+ controller = Pettanr::Application::manifest.controller_managers[controller_name]
+ @action = controller.open(action_name, params, @operators)
+ @filter_item = @action.list.from_model.show(params[:id], @operators)
+ item_model_name = @action.list.item_name
+ @items = @action.list.items @filter_item
+ respond_to do |format|
+ format.html {
+ @filer = Pettanr::Application::manifest.filer_managers[item_model_name].open(item_model_name, @items, @operators, @action.list.paginate(@filter_item))
+ render :template => 'system/filer', :locals => {
+ :filer => @filer
+ }
+ }
+ format.json { render json: @items.to_json(self.class.model.list_json_opt) }
end
end
public_list
end
+ def resource_pictures
+ has_many_list
+ end
+
def show
@item = Artist.show(params[:id], @operators)
end
end
- def resource_pictures
- @artist = Artist.show(params[:id], @operators)
- @page = Author.page params[:page]
- @page_size = Author.resource_picture_page_size params[:page_size]
- @resource_pictures = ResourcePicture.himlist(@artist, @page, @page_size)
- respond_to do |format|
- format.html {
- @paginate = ResourcePicture.himlist_paginate(@artist, @page, @page_size)
- }
- format.json { render json: @resource_pictures.to_json(ResourcePicture.list_json_opt) }
- end
- end
-
def count
@artist = {:count => Artist.visible_count}
respond_to do |format|
def index
public_list
end
-
- def show
- @item = Author.show(params[:id], @operators)
-
- respond_to do |format|
- format.html {
- @author = @item
- }
- format_prof format
- format.json { render :json => @item.to_json(Author.show_json_opt) }
- end
- end
-
+
def scrolls
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.scroll_page_size params[:page_size]
- @scrolls = Scroll.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = Scroll.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @scrolls, :model => Scroll,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @scrolls.to_json(Scroll.list_json_opt) }
- end
+ has_many_list
end
def scroll_panels
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.scroll_page_size params[:page_size]
- @scroll_panels = ScrollPanel.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = ScrollPanel.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @scroll_panels, :model => ScrollPanel,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @scroll_panels.to_json(ScrollPanel.list_json_opt) }
- end
+ has_many_list
end
def comics
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.comic_page_size params[:page_size]
- @comics = Comic.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = Comic.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @comics, :model => Comic,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @comics.to_json(Comic.list_json_opt) }
- end
+ has_many_list
end
def stories
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.story_page_size params[:page_size]
- @stories = Story.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = Story.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @stories, :model => Story,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @stories.to_json(Story.list_json_opt) }
- end
+ has_many_list
end
def story_sheets
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.sheet_page_size params[:page_size]
- @story_sheets = StorySheet.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = StorySheet.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @story_sheets, :model => StorySheet,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @story_sheets.to_json(StorySheet.list_json_opt) }
- end
+ has_many_list
end
def sheets
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.sheet_page_size params[:page_size]
- @sheets = Sheet.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = Sheet.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @sheets, :model => Sheet,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @sheets.to_json(Sheet.list_json_opt) }
- end
+ has_many_list
end
def sheet_panels
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.sheet_page_size params[:page_size]
- @sheet_panels = SheetPanel.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = SheetPanel.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @sheet_panels, :model => SheetPanel,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @sheet_panels.to_json(SheetPanel.list_json_opt) }
- end
+ has_many_list
end
def panels
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.panel_page_size params[:page_size]
- @panels = Panel.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = Panel.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @panels, :model => Panel,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render text: Panel.list_as_json_text(@panels) }
- end
+ has_many_list
end
def panel_pictures
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.panel_picture_page_size params[:page_size]
- @panel_pictures = PanelPicture.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = PanelPicture.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @panel_pictures, :model => PanelPicture,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @panel_pictures.to_json(PanelPicture.list_json_opt) }
- end
+ has_many_list
end
def speech_balloons
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.panel_picture_page_size params[:page_size]
- @speech_balloons = SpeechBalloon.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = SpeechBalloon.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @speech_balloons, :model => SpeechBalloon,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @speech_balloons.to_json(SpeechBalloon.list_json_opt) }
- end
+ has_many_list
end
def ground_pictures
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.ground_picture_page_size params[:page_size]
- @ground_pictures = GroundPicture.himlist(@au, @page, @page_size)
-
- respond_to do |format|
- format.html {
- @paginate = GroundPicture.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @ground_pictures, :model => GroundPicture,
- :roles => [@user, @admin], :pager => @paginate
- }
- }
- format.json { render json: @ground_pictures.to_json(GroundPicture.list_json_opt) }
- end
+ has_many_list
end
def ground_colors
- @au = Author.show(params[:id], [@user, @admin])
-
- @page = Author.page params[:page]
- @page_size = Author.ground_color_page_size params[:page_size]
- @ground_colors = GroundColor.himlist(@au, @page, @page_size)
+ has_many_list
+ end
+
+ def show
+ @item = Author.show(params[:id], @operators)
respond_to do |format|
format.html {
- @paginate = GroundColor.himlist_paginate(@au, @page, @page_size)
- render :template => 'system/filer', :locals => {
- :items => @ground_colors, :model => GroundColor,
- :roles => [@user, @admin], :pager => @paginate
- }
+ @author = @item
}
- format.json { render json: @ground_colors.to_json(GroundColor.list_json_opt) }
+ format_prof format
+ format.json { render :json => @item.to_json(Author.show_json_opt) }
end
end
-
+
def count
@au = {:count => Author.visible_count}
respond_to do |format|
before_filter :authenticate_user, :only => []
before_filter :authenticate_author, :only => []
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_speech_balloon]
before_filter :authenticate_user, :only => []
before_filter :authenticate_author, :only => []
end
public_list
end
+ def by_speech_balloon
+ has_one_list
+ end
+
def show
@item = Balloon.show(params[:id], @operators)
respond_to do |format|
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:top, :index, :show]
+ before_filter :authenticate_reader, :only => [:top, :index, :show, :stories, :by_author]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
public_list
end
+ def stories
+ has_many_list
+ end
+
+ def by_author
+ filter_list
+ end
+
+ def by_me
+ my_li
+ end
+
def show
@item = Comic.show(params[:id], @operators)
respond_to do |format|
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
end
public_list
end
+ def by_panel
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
def show
@item = GroundColor.show(params[:id], @operators)
respond_to do |format|
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
end
def index
public_list
end
-
+
+ def by_panel
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
def show
@item = GroundPicture.show(params[:id], @operators)
respond_to do |format|
def index
public_list
end
-
+
+ def licenses
+ has_many_list
+ end
+
def show
@item = LicenseGroup.show(params[:id], @operators)
respond_to do |format|
class LicensesController < ApplicationController
layout 'test' if MagicNumber['test_layout']
+ before_filter :authenticate_resource_reader, :only => [:resource_pictures, :by_license_group, :by_system_picture]
def self.model
License
def index
public_list
end
-
+
+ def resource_pictures
+ has_many_list
+ end
+
+ def by_license_group
+ filter_list
+ end
+
+ def by_system_picture
+ filter_list
+ end
+
def show
@item = License.show(params[:id], @operators)
respond_to do |format|
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
end
def index
public_list
end
-
+
+ def by_panel
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
def show
@item = PanelPicture.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy, :catch]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :scroll_panels, :scrolls, :sheet_panels, :sheets, :panel_pictures, :speech_balloons, :ground_pictures, :ground_colors, :by_scroll, :by_sheet, :by_author]
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy, :catch]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy, :catch]
end
def index
public_list
end
-
+
+ def scroll_panels
+ has_many_list
+ end
+
+ def scrolls
+ has_many_list
+ end
+
+ def sheet_panels
+ has_many_list
+ end
+
+ def sheets
+ has_many_list
+ end
+
+ def panel_pictures
+ has_many_list
+ end
+
+ def speech_balloons
+ has_many_list
+ end
+
+ def ground_pictures
+ has_many_list
+ end
+
+ def ground_colors
+ has_many_list
+ end
+
+ def by_scroll
+ filter_list
+ end
+
+ def by_sheet
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
+
def show
@item = Panel.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
else
- before_filter :authenticate_resource_reader, :only => [:index, :show, :credit]
+ before_filter :authenticate_resource_reader, :only => [:index, :show, :credit, :by_license, :artist]
before_filter :authenticate_user, :only => [:new, :create, :update, :destroy]
before_filter :authenticate_artist, :only => [:new, :create, :update, :destroy]
end
def index
public_list
end
-
+
+ def by_license
+ filter_list
+ end
+
+ def artist
+ has_one_list
+ end
+
def show
@item = ResourcePicture.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show, :scroll]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_scroll]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
def index
public_list
end
-
+
+ def by_panel
+ filter_list
+ end
+
+ def by_scroll
+ filter_list
+ end
+
def show
@item = ScrollPanel.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:top, :index, :show, :play]
+ before_filter :authenticate_reader, :only => [:top, :index, :show, :play, :scroll_panels, :panels, :by_author, :by_panel]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
def index
public_list
end
-
+
+ def scroll_panels
+ has_many_list
+ end
+
+ def panels
+ has_many_list
+ end
+
+ def by_author
+ filter_list
+ end
+
+ def by_panel
+ filter_list
+ end
+
def show
@item = Scroll.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_sheet, :by_panel]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
def index
public_list
end
-
+
+ def by_sheet
+ filter_list
+ end
+
+ def by_panel
+ filter_list
+ end
+
def show
@item = SheetPanel.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show, :play]
+ before_filter :authenticate_reader, :only => [:index, :show, :play, :story_sheets, :stories, :sheet_panels, :panels, :by_story, :by_panel, :by_author]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
def index
public_list
end
-
+
+ def story_sheets
+ has_many_list
+ end
+
+ def stories
+ has_many_list
+ end
+
+ def sheet_panels
+ has_many_list
+ end
+
+ def panels
+ has_many_list
+ end
+
+ def by_story
+ filter_list
+ end
+
+ def by_panel
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
def show
@item = Sheet.show(params[:id], @operators)
if MagicNumber['run_mode'] == 0
before_filter :authenticate_user, :only => []
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :speech_balloons, :panels, :by_system_picture]
before_filter :authenticate_user, :only => []
end
before_filter :authenticate_admin!, :only => [:list, :browse, :destroy]
def index
public_list
end
-
+
+ def speech_balloons
+ has_many_list
+ end
+
+ def panels
+ has_many_list
+ end
+
+ def by_system_picture
+ filter_list
+ end
+
def show
@item = SpeechBalloonTemplate.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_panel, :by_author]
before_filter :authenticate_user, :only => [:new, :edit, :create, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :edit, :create, :update, :destroy]
end
public_list
end
+ def by_panel
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
def show
@item = SpeechBalloon.show(params[:id], @operators)
respond_to do |format|
before_filter :authenticate_user, :only => []
before_filter :authenticate_author, :only => []
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_speech_balloon, :by_writing_format]
before_filter :authenticate_user, :only => []
before_filter :authenticate_author, :only => []
end
public_list
end
+ def by_speech_balloon
+ filter_list
+ end
+
+ def by_writing_format
+ filter_list
+ end
+
def show
@item = Speech.show(params[:id], @operators)
respond_to do |format|
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show, :play]
+ before_filter :authenticate_reader, :only => [:index, :show, :play, :story_sheets, :sheets, :by_comic, :by_sheet, :by_author]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
def index
public_list
end
-
+
+ def story_sheets
+ has_many_list
+ end
+
+ def sheets
+ has_many_list
+ end
+
+ def by_comic
+ filter_list
+ end
+
+ def by_sheet
+ filter_list
+ end
+
+ def by_author
+ filter_list
+ end
+
def show
@item = Story.show(params[:id], @operators)
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
else
- before_filter :authenticate_reader, :only => [:index, :show]
+ before_filter :authenticate_reader, :only => [:index, :show, :by_story, :by_sheet]
before_filter :authenticate_user, :only => [:new, :create, :edit, :update, :destroy]
before_filter :authenticate_author, :only => [:new, :create, :edit, :update, :destroy]
end
def index
public_list
end
-
+
+ def by_story
+ filter_list
+ end
+
+ def by_sheet
+ filter_list
+ end
+
def show
@item = StorySheet.show(params[:id], @operators)
before_filter :authenticate_user, :only => []
before_filter :authenticate_author, :only => []
else
- before_filter :authenticate_resource_reader, :only => [:index, :show]
+ before_filter :authenticate_resource_reader, :only => [:index, :show, :speech_balloon_templates, :licenses]
before_filter :authenticate_user, :only => []
before_filter :authenticate_author, :only => []
end
def index
public_list
end
-
+
+ def speech_balloon_templates
+ has_many_list
+ end
+
+ def licenses
+ has_many_list
+ end
+
def show
@item = SystemPicture.show(params[:id], @operators)
+++ /dev/null
-$("#register").html("<%= escape_javascript(render('form')) -%>");
<%= l @artist.updated_at %>
</p>
-<p>
- <%= link_to t('artists.show.to_resource_pictures'), resource_pictures_artist_path(@artist) %>
-</p>
-
<% if @artist.own?(@artist) %>
<%= link_to t('link.edit'), edit_artist_path(@artist) %>
<% end %>
<%= l @author.updated_at %>
</p>
-<p>
- <%= link_to t('authors.show.to_scrolls'), scrolls_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_scroll_panels'), scroll_panels_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_comics'), comics_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_stories'), stories_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_story_sheets'), story_sheets_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_sheets'), sheets_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_sheet_panels'), sheet_panels_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_panels'), panels_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_panel_pictures'), panel_pictures_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_speech_balloons'), speech_balloons_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_ground_pictures'), ground_pictures_author_path(@author) %>
-</p>
-
-<p>
- <%= link_to t('authors.show.to_ground_colors'), ground_colors_author_path(@author) %>
-</p>
-
<% if @author.own?(@author) %>
<%= link_to t('link.edit'), edit_author_path(@author) %>
<% end %>
<%= h @ground_picture.caption %>
</p>
-<p>
- <b><%= t_m 'GroundPicture.z' -%>:</b>
- <%= @ground_picture.z %>
-</p>
-
-<p>
- <b><%= t_m 'GroundPicture.repeat' -%>:</b>
- <%= @ground_picture.repeat %>
-</p>
-
-<p>
- <b><%= t_m 'GroundPicture.x' -%>:</b>
- <%= @ground_picture.x %>
-</p>
-
-<p>
- <b><%= t_m 'GroundPicture.y' -%>:</b>
- <%= @ground_picture.y %>
-</p>
-
-<p>
- <b><%= t_m 'GroundPicture.created_at' -%>:</b>
- <%= l @ground_picture.created_at %>
-</p>
-
-<p>
- <b><%= t_m 'GroundPicture.updated_at' -%>:</b>
- <%= l @ground_picture.updated_at %>
-</p>
-
<%= link_to t('link.edit'), edit_ground_picture_path(@ground_picture) %>
<%= link_to t('link.destroy'), ground_picture_path(@ground_picture), :method => :delete %>
<%= h @panel_picture.caption %>
</p>
-<p>
- <b><%= t_m 'PanelPicture.link' -%>:</b>
- <%= link_to h(@panel_picture.link), @panel_picture.link %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.x' -%>:</b>
- <%= @panel_picture.x %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.y' -%>:</b>
- <%= @panel_picture.y %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.z' -%>:</b>
- <%= @panel_picture.z %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.t' -%>:</b>
- <%= @panel_picture.t %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.width' -%>:</b>
- <%= @panel_picture.width %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.height' -%>:</b>
- <%= @panel_picture.height %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.created_at' -%>:</b>
- <%= l @panel_picture.created_at %>
-</p>
-
-<p>
- <b><%= t_m 'PanelPicture.updated_at' -%>:</b>
- <%= l @panel_picture.updated_at %>
-</p>
-
<%= link_to t('link.edit'), edit_panel_picture_path(@panel_picture) %>
<%= link_to t('link.destroy'), panel_picture_path(@panel_picture), :method => :delete %>
<div>\r
<%= 'has_many' %>\r
</div>\r
-<% profiler.each_has_many do |has_many_filer| %>\r
+<% profiler.each_has_many do |has_many_filer, more_url| %>\r
<%= render 'system/filer.html', :filer => has_many_filer %>\r
+ <%= link_to h('more'), more_url %>\r
<% end %>\r
<div>\r
<%= 'has_one' %>\r
play:
title: スクロールを読む
empty: スクコマはありません
+ scroll_panels:
+ title: スクロールのスクコマ一覧
+ panels:
+ title: スクロールのコマ一覧
+ by_author:
+ title: 作家のスクロール一覧
+ by_panel:
+ title: コマのスクロール一覧
new:
title: 新刊作成
edit:
scroll_panels:
index:
title: スクコマ一覧
+ by_panel:
+ title: コマのスクコマ一覧
+ by_scroll:
+ title: スクロールのスクコマ一覧
show:
title: スクコマ詳細
new:
index:
title: コミック一覧
new: 新刊
+ stories:
+ title: コミックのストーリー一覧
+ by_author:
+ title: 作家のコミック一覧
show:
title: コミック詳細
new:
play:
title: ストーリーを読む
empty: 用紙はありません
+ story_sheets:
+ title: ストーリーのスト紙一覧
+ sheets:
+ title: ストーリーの用紙一覧
+ by_comic:
+ title: コミックのストーリー一覧
+ by_sheet:
+ title: 作家のストーリー一覧
+ by_author:
+ title: 作家のストーリー一覧
new:
title: 新ストーリー作成
edit:
story_sheets:
index:
title: スト紙一覧
+ by_story:
+ title: ストーリーのスト紙一覧
+ by_sheet:
+ title: 用紙のスト紙一覧
show:
title: スト紙詳細
new:
play:
title: 用紙を読む
empty: 紙コマはありません
+ story_sheets:
+ title: 用紙のスト紙一覧
+ stories:
+ title: 用紙のストーリー一覧
+ sheet_panels:
+ title: 用紙の紙コマ一覧
+ panels:
+ title: 用紙のコマ一覧
+ by_story:
+ title: ストーリーの用紙一覧
+ by_panel:
+ title: コマの用紙一覧
+ by_author:
+ title: 作家の用紙一覧
new:
title: 用紙作成
edit:
sheet_panels:
index:
title: 紙コマ一覧
+ by_sheet:
+ title: 用紙の紙コマ一覧
+ by_panel:
+ title: コマの紙コマ一覧
show:
title: 紙コマ詳細
new:
panels:
index:
title: コマ一覧
+ scroll_panels:
+ title: コマのスクコマ一覧
+ scrolls:
+ title: コマのスクロール一覧
+ sheet_panels:
+ title: コマの紙コマ一覧
+ sheets:
+ title: コマの用紙一覧
+ panel_pictures:
+ title: コマのコマ絵一覧
+ speech_balloons:
+ title: コマのフキダシ一覧
+ ground_pictures:
+ title: コマの絵地一覧
+ ground_colors:
+ title: コマの色地一覧
+ by_scroll:
+ title: スクロールのコマ一覧
+ by_sheet:
+ title: 用紙のコマ一覧
+ by_author:
+ title: 作家のコマ一覧
show:
title: コマ詳細
copy: コマをコピーしたい
panel_pictures:
index:
title: コマ絵一覧
+ by_panel:
+ title: コマのコマ絵一覧
+ by_author:
+ title: 作家のコマ絵一覧
show:
title: コマ絵詳細
new:
speech_balloons:
index:
title: フキダシ一覧
+ by_panel:
+ title: コマのコマ絵一覧
+ by_author:
+ title: 作家のコマ絵一覧
show:
title: フキダシ詳細
new:
speeches:
index:
title: セリフ一覧
+ by_speech_balloon:
+ title: フキダシのセリフ一覧
+ by_writing_format:
+ title: 記法のセリフ一覧
show:
title: セリフ詳細
list:
balloons:
index:
title: フキダシ枠一覧
+ by_speech_balloon:
+ title: フキダシのフキダシ枠一覧
show:
title: フキダシ枠詳細
list:
ground_pictures:
index:
title: 絵地一覧
+ by_panel:
+ title: コマの絵地一覧
+ by_author:
+ title: 作家の絵地一覧
show:
title: 絵地詳細
new:
ground_colors:
index:
title: 色地一覧
+ by_panel:
+ title: コマの色地一覧
+ by_author:
+ title: 作家の色地一覧
show:
title: 色地詳細
new:
resource_pictures:
index:
title: 素材一覧
+ artist:
+ title: 素材の絵師一覧
+ by_license:
+ title: ライセンスの素材一覧
show:
title: 素材詳細
new:
speech_balloon_templates:
index:
title: フキダシテンプレート一覧
+ speech_balloons:
+ title: フキダシテンプレートのフキダシ一覧
+ panels:
+ title: フキダシテンプレートのコマ一覧
+ by_system_picture:
+ title: システム画像のフキダシテンプレート一覧
show:
title: フキダシテンプレート詳細
list:
license_groups:
index:
title: ライセンスグループ一覧
+ licenses:
+ title: ライセンスグループのライセンス一覧
show:
title: ライセンスグループ詳細
list:
licenses:
index:
title: ライセンス一覧
+ resource_pictures:
+ title: ライセンスの素材一覧
+ by_license_group:
+ title: ライセンスグループのライセンス一覧
+ by_system_picture:
+ title: システム画像のライセンス一覧
show:
title: ライセンス詳細
search:
system_pictures:
index:
title: システム画像一覧
+ speech_balloon_templates:
+ title: システム画像のフキダシテンプレート一覧
+ licenses:
+ title: システム画像のライセンス一覧
show:
title: システム画像詳細
list:
member do
get :stories
get :by_author
+ get :by_me
get :play
get :edit
put :update
member do
get :story_sheets
get :sheets
+ get :by_comic
get :by_sheet
get :by_author
get :play
member do
get :by_panel
get :by_author
+ #get :by_speech_balloon_template
get :edit
put :update
delete :destroy
module Pettanr
class ControllerManager
class ActionList
+ attr :list
def initialize action_name, item_name, operators, list, conf, manifest
@action_name = action_name
@item_name = item_name
@items ||= @list.items
end
- def filer
- @filer ||= @manifest.filer_managers[@item_name].open(@item_name, @items, @operators, @list.paginate)
+ def filer opt = nil
+ paginate = opt ? @list.paginate(opt) : @list.paginate
+ @filer ||= @manifest.filer_managers[@item_name].open(@item_name, @items, @operators, paginate)
end
end
Kaminari.paginate_array(Array.new(c, nil)).page(@offset).per(@page_size)
end
+ def self.add_action item_name, action_name, list_name, list_conf
+ return
+ end
end
class PublicList < BaseList
+
+ def self._add_action item_name, action_name, list_name, list_conf
+ model = item_name.classify.constantize
+ controller_name = model.plural + 'Controller'
+ controller = controller_name.constantize
+ return if controller.method_defined?(action_name)
+ controller.define_method(action_name) do
+ public_list
+ end
+ end
end
class PrivateList < BaseList
end
class HasManyList < BaseList
+ attr :association_model_name
def initialize page, page_size, operators, item_name, list_name, conf, manifest
super
- @association_name = @conf['association_name']
+ @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
+ @association_name = @list_list_conf['association_name']
@has_many_conf = @manifest.model(@item_name).associations['has_many'] || {}
@association_conf = @has_many_conf[@association_name] || {}
@association_model_name = @association_conf['model']
@association_model = @association_model_name.classify.constantize
@foreign_key = @association_conf['foreign_key']
+ if @association_model.content?
+ @owner_model = @association_model.owner_model
+ @owner_table_name = @owner_model.table_name if @owner_model
+ end
end
def where parent_item
- w = @model.list_where
+ w = @association_model.list_where
w += ' and ' unless w.blank?
- t = @owner_model ? @owner_table_name : @table_name
- [w + @association_model_name + '.' + @foreign_key + ' = ?', parent_item.id]
+ [w + @association_model.table_name + '.' + @foreign_key + ' = ?', parent_item.id]
end
def includes
# @with_model_name ? {@with_model_name.classify.constantize.table_name => {}} : {}
w = @owner_model ? {@owner_model.item_name => {}} : {}
- w.merge({@association_model.table_name => {} })
+ w.merge({})
end
def items parent_item
- @model.where(self.where(parent_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
+ @association_model.where(self.where(parent_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
end
def paginate parent_item
- Kaminari.paginate_array(Array.new(@model.where(self.where(parent_item).includes(self.includes)).count, nil)).page(@offset).per(@page_size)
+ Kaminari.paginate_array(Array.new(@association_model.where(self.where(parent_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size)
+ end
+
+ def self._add_action item_name, action_name, list_name, list_conf
+ model = item_name.classify.constantize
+ controller_name = model.plural + 'Controller'
+ controller = controller_name.constantize
+ association_name = list_conf['association_name']
+ has_many_conf = Pettanr::Application::manifest.model(item_name).associations['has_many'] || {}
+ association_conf = has_many_conf[association_name] || {}
+ association_model_name = association_conf['model']
+ return if controller.method_defined?(action_name)
+ controller.define_method(action_name) do
+ has_many_list item_name, list_name, association_model_name, params
+ end
+ end
+
+ end
+
+ class HasManyThroughList < BaseList
+ attr :association_model_name
+ def initialize page, page_size, operators, item_name, list_name, conf, manifest
+ super
+ @list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
+ @association_name = @list_list_conf['association_name']
+ @has_many_conf = @manifest.model(@item_name).associations['has_many'] || {}
+ @association_conf = @has_many_conf[@association_name] || {}
+ @association_through_model_name = @association_conf['through']
+ @association_through_model = @association_through_model_name.classify.constantize
+ @association_model_name = @association_conf['model']
+ @association_model = @association_model_name.classify.constantize
+ @foreign_key = @association_conf['foreign_key']
+ if @association_model.content?
+ @owner_model = @association_model.owner_model
+ @owner_table_name = @owner_model.table_name if @owner_model
+ end
+ end
+
+ def where root_item
+ w = @association_model.list_where
+ w += ' and ' unless w.blank?
+ [w + @association_through_model.table_name + '.' + @foreign_key + ' = ?', root_item.id]
+ end
+
+ def includes
+ {@association_through_model.table_name => {@item_name => {}}}
+ end
+
+ def items root_item
+ @association_model.where(self.where(root_item)).includes(self.includes).order(self.order).offset(@offset).limit(@page_size)
+ end
+
+ def paginate root_item
+ Kaminari.paginate_array(Array.new(@association_model.where(self.where(root_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size)
end
end
class FilterList < BaseList
+ attr :item_name, :from_model
def initialize page, page_size, operators, item_name, list_name, conf, manifest
super
@list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
@from = @list_list_conf['from']
+ @from_model = @from.classify.constantize
@filter_key = @list_list_conf['filter_key']
@includes = @list_list_conf['includes']
end
def paginate filter_item
- Kaminari.paginate_array(Array.new(@model.where(self.where(filter_item).includes(self.includes)).count, nil)).page(@offset).per(@page_size)
+ Kaminari.paginate_array(Array.new(@model.where(self.where(filter_item)).includes(self.includes).count, nil)).page(@offset).per(@page_size)
+ end
+
+ def self._add_action item_name, action_name, list_name, list_conf
+ model = item_name.classify.constantize
+ controller_name = model.plural + 'Controller'
+ controller = controller_name.constantize
+ list_list_conf = Pettanr::Application::manifest.list(item_name).lists[list_name] || {}
+ from = list_list_conf['from']
+ filter_model = from.classify.constantize
+ filter_key = list_list_conf['filter_key']
+ return if controller.method_defined?(action_name)
+ controller.define_method(action_name) do
+ filter_list filter_model, params
+ end
end
end
@@types = {
'public' => PublicList, 'private' => PrivateList, 'system_resource' => SystemResourceList,
- 'has_many' => HasManyList, 'filter' => FilterList,
+ 'has_many' => HasManyList, 'has_many_through' => HasManyThroughList, 'filter' => FilterList,
'through_filter' => ThroughFilterList, 'element_filter' => ElementFilterList
}
def initialize list_manifest
@lists[list_name].new page, page_size, operators, @item_name, list_name, @list_conf, @manifest
end
+ def add_action action_name, list_name
+ @lists[list_name].add_action @item_name, action_name, list_name, @list_conf
+ end
+
end
end
def init
select_items_loader
select_items_font_size
+ add_action
end
#oh my ...
}
end
+ def add_action
+ @controllers.each do |controller_name, controller|
+ model_name = controller.model_name
+ next if model_name.blank?
+ controller.actions.each do |action_name, conf|
+ next unless conf['type'] == 'list'
+ list_name = conf['list']['list_name']
+ list = Pettanr::Application::manifest.list_managers[model_name]
+ list.add_action action_name, list_name
+ end
+ end
+ end
+
def controller item_name
@controllers[item_name] || @mcontrollers[item_name.tableize]
end
items = list.items @item
#p [model_name, list_name, @item, list.class, list.includes, list.where(@item )]
has_many_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil
- yield has_many_filer
+ model = model_name.classify.constantize
+ more_url = "/#{model.table_name}/#{list_name}/#{@item.id}"
+ yield has_many_filer, more_url
end
end
"list_name": "sheets"\r
}\r
},\r
+ "by_comic": {\r
+ "type": "list",\r
+ "list": {\r
+ "list_name": "by_comic"\r
+ }\r
+ },\r
"by_sheet": {\r
"type": "list",\r
"list": {\r
}\r
},\r
"artist": {\r
- "model_name": "",\r
+ "model_name": "artist",\r
"actions": {\r
"index": {\r
"type": "list",\r
"has_many": {\r
"story_sheets": {\r
"foreign_key": "story_id",\r
- "list_method": "list_by_story"\r
+ "model": "story_sheet"\r
},\r
"sheets": {\r
"through": "story_sheets",\r
"foreign_key": "story_id",\r
- "list_method": "list_by_story"\r
+ "model": "sheet"\r
}\r
}\r
},\r
"has_many": {\r
"story_sheets": {\r
"foreign_key": "story_id",\r
- "list_method": "list_by_sheet"\r
+ "model": "story_sheet"\r
},\r
"stories": {\r
"through": "story_sheets",\r
"foreign_key": "sheet_id",\r
- "list_method": "list_by_sheet"\r
+ "model": "story"\r
},\r
"sheet_panels": {\r
"foreign_key": "sheet_id",\r
- "list_method": "list_by_sheet"\r
+ "model": "sheet_panel"\r
},\r
"panels": {\r
"through": "sheet_panels",\r
"foreign_key": "sheet_id",\r
- "list_method": "list_by_sheet"\r
+ "model": "panel"\r
}\r
}\r
},\r
"has_many": {\r
"scroll_panels": {\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "scroll_panel"\r
},\r
"scrolls": {\r
"through": "scroll_panels",\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "scroll"\r
},\r
"sheet_panels": {\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "sheet_panel"\r
},\r
"sheets": {\r
"through": "sheet_panels",\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "sheet"\r
},\r
"panel_pictures": {\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "panel_picture"\r
},\r
"speech_balloons": {\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "speech_balloon"\r
},\r
"ground_pictures": {\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "ground_picture"\r
},\r
"ground_colors": {\r
"foreign_key": "panel_id",\r
- "list_method": "list_by_panel"\r
+ "model": "ground_color"\r
}\r
}\r
},\r
"has_one": {\r
"balloon": {\r
"foreign_key": "speech_balloon_id",\r
- "list_method": "list_by_speech_balloon"\r
+ "model": "balloon"\r
},\r
"speech": {\r
"foreign_key": "speech_balloon_id",\r
- "list_method": "list_by_speech_balloon"\r
+ "model": "speech"\r
}\r
}\r
},\r
"has_many": {\r
"pictures": {\r
"foreign_key": "original_picture_id",\r
- "list_method": "list_by_original_picture"\r
+ "model": "picture"\r
}\r
},\r
"has_one": {\r
"resource_picture": {\r
"foreign_key": "original_picture_id",\r
- "list_method": "list_by_original_picture"\r
+ "model": "resource_picture"\r
}\r
}\r
},\r
"has_many": {\r
"speech_balloons": {\r
"foreign_key": "speech_balloon_template_id",\r
- "list_method": "list_by_speech_balloon_template"\r
+ "model": "speech_balloon"\r
},\r
"panels": {\r
"through": "speech_balloons",\r
"foreign_key": "speech_balloon_template_id",\r
- "list_method": "list_by_speech_balloon_template"\r
+ "model": "panel"\r
}\r
},\r
"has_one": {}\r
"has_many": {\r
"speeches": {\r
"foreign_key": "writing_format_id",\r
- "list_method": "list_by_writing_format"\r
+ "model": "speech"\r
}\r
},\r
"has_one": {}\r
"has_many": {\r
"licenses": {\r
"foreign_key": "license_group_id",\r
- "list_method": "list_by_license_group"\r
+ "model": "license"\r
}\r
},\r
"has_one": {}\r
"has_many": {\r
"resource_pictures": {\r
"foreign_key": "license_id",\r
- "list_method": "list_by_license"\r
+ "model": "resource_picture"\r
}\r
},\r
"has_one": {}\r
"has_many": {\r
"scrolls": {\r
"foreign_key": "author_id",\r
- "list_method": "list_by_author"\r
+ "model": "scroll"\r
},\r
"comics": {\r
"foreign_key": "author_id",\r
- "list_method": "list_by_author"\r
+ "model": "comic"\r
},\r
"stories": {\r
"foreign_key": "author_id",\r
- "list_method": "list_by_author"\r
+ "model": "story"\r
},\r
"sheets": {\r
"foreign_key": "author_id",\r
- "list_method": "list_by_author"\r
+ "model": "sheet"\r
},\r
"panels": {\r
"foreign_key": "author_id",\r
- "list_method": "list_by_author"\r
+ "model": "panel"\r
}\r
},\r
"has_one": {}\r
"has_many": {\r
"resource_pictures": {\r
"foreign_key": "artist_id",\r
- "list_method": "list_by_artist"\r
+ "model": "resource_picture"\r
}\r
},\r
"has_one": {}\r
"has_many": {\r
"balloons": {\r
"foreign_key": "system_picture_id",\r
- "list_method": "list_by_system_picture"\r
+ "model": "balloon"\r
},\r
"balloon_templates": {\r
"foreign_key": "system_picture_id",\r
- "list_method": "list_by_system_picture"\r
+ "model": "balloon_template"\r
},\r
"licenses": {\r
"foreign_key": "system_picture_id",\r
- "list_method": "list_by_system_picture"\r
+ "model": "license"\r
}\r
},\r
"has_one": {}\r
"association_name": "scroll_panels"\r
},\r
"panels": {\r
- "type": "has_many",\r
+ "type": "has_many_through",\r
"association_name": "panels"\r
},\r
"by_author": {\r