From b70e509e0e79e68b96f94f9e5bd4a7fd1b2b4827 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Sat, 8 Mar 2014 18:33:56 +0900 Subject: [PATCH] fix filter include --- app/assets/javascripts/manifest/work/models.js.coffee.erb | 6 ------ app/models/balloon.rb | 2 +- app/models/speech.rb | 2 +- app/views/balloons/_summary.html.erb | 4 ++-- app/views/speeches/_summary.html.erb | 4 ++-- app/views/top/index.html.erb | 10 ++++++++++ lib/manifest/list_group/list/base.rb | 1 + lib/manifest/list_group/list/filter.rb | 3 ++- lib/manifest/list_group/list/includes/auto.rb | 2 +- lib/manifest/model/tree.rb | 4 ++-- public/manifest.json | 10 +++++----- 11 files changed, 27 insertions(+), 21 deletions(-) diff --git a/app/assets/javascripts/manifest/work/models.js.coffee.erb b/app/assets/javascripts/manifest/work/models.js.coffee.erb index f61a2859..670c9164 100644 --- a/app/assets/javascripts/manifest/work/models.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/models.js.coffee.erb @@ -692,15 +692,9 @@ }, by_panel: { type: 'filter', - args: { - where_name: 'public_list_where', - }, }, by_author: { type: 'foreign_filter', - args: { - tree_name: 'owner', - }, }, }, }, diff --git a/app/models/balloon.rb b/app/models/balloon.rb index 8f08c83c..b6a4bbb0 100644 --- a/app/models/balloon.rb +++ b/app/models/balloon.rb @@ -32,7 +32,7 @@ self.system_picture_id = 1 end def symbol_option - self.get_parent.speech_balloon_template.symbol_option + self.speech_balloon.speech_balloon_template.symbol_option end def self.list_where diff --git a/app/models/speech.rb b/app/models/speech.rb index f42b2a7b..fd0dd993 100644 --- a/app/models/speech.rb +++ b/app/models/speech.rb @@ -30,7 +30,7 @@ class Speech < Peta::Content end def symbol_option - self.get_parent.speech_balloon_template.symbol_option + self.speech_balloon.speech_balloon_template.symbol_option end def outer_style diff --git a/app/views/balloons/_summary.html.erb b/app/views/balloons/_summary.html.erb index 92be2ad0..6655049c 100644 --- a/app/views/balloons/_summary.html.erb +++ b/app/views/balloons/_summary.html.erb @@ -1,4 +1,4 @@
- <%= link_to panel_icon(:object => item, :size => 32), panel_path(item.get_parent.get_panel) %> - <%= link_to h(truncate(item.get_parent.get_panel.author.name, :length => 12)), author_path(item.get_parent.get_panel.author) %> + <%= link_to panel_icon(:object => item, :size => 32), panel_path(item.speech_balloon.panel) %> + <%= link_to h(truncate(item.speech_balloon.panel.author.name, :length => 12)), author_path(item.speech_balloon.panel.author) %>
diff --git a/app/views/speeches/_summary.html.erb b/app/views/speeches/_summary.html.erb index 92be2ad0..6655049c 100644 --- a/app/views/speeches/_summary.html.erb +++ b/app/views/speeches/_summary.html.erb @@ -1,4 +1,4 @@
- <%= link_to panel_icon(:object => item, :size => 32), panel_path(item.get_parent.get_panel) %> - <%= link_to h(truncate(item.get_parent.get_panel.author.name, :length => 12)), author_path(item.get_parent.get_panel.author) %> + <%= link_to panel_icon(:object => item, :size => 32), panel_path(item.speech_balloon.panel) %> + <%= link_to h(truncate(item.speech_balloon.panel.author.name, :length => 12)), author_path(item.speech_balloon.panel.author) %>
diff --git a/app/views/top/index.html.erb b/app/views/top/index.html.erb index 80de95a3..365f350b 100644 --- a/app/views/top/index.html.erb +++ b/app/views/top/index.html.erb @@ -50,6 +50,14 @@ <%= link_to t_m('SpeechBalloon'), main_app.speech_balloons_path %> + <%= link_to t_m('Balloon'), main_app.balloons_path %> + + + <%= link_to t_m('Speech'), main_app.speeches_path %> + + + + <%= link_to t_m('GroundPicture'), main_app.ground_pictures_path %> @@ -57,6 +65,8 @@ + +

<%= t('top.human_resources') -%>

diff --git a/lib/manifest/list_group/list/base.rb b/lib/manifest/list_group/list/base.rb index 9053bdf0..9766ff60 100644 --- a/lib/manifest/list_group/list/base.rb +++ b/lib/manifest/list_group/list/base.rb @@ -29,6 +29,7 @@ module Manifest @model_list_manifest = @model_manifest.lists[@list_name] @list_manifest['where'] ||= {} @list_manifest['includes'] ||= {} + @list_manifest['tree_name'] ||= @list_group.tree_name end def init diff --git a/lib/manifest/list_group/list/filter.rb b/lib/manifest/list_group/list/filter.rb index 0239edb2..3e31ab05 100644 --- a/lib/manifest/list_group/list/filter.rb +++ b/lib/manifest/list_group/list/filter.rb @@ -21,7 +21,8 @@ module Manifest def include_hash w = super - w.merge({@filter_item_name => {} }) unless w[@filter_item_name] + w.merge!({@filter_item_name => {} }) unless w[@filter_item_name] + w end def items operators, options, offset, page_size diff --git a/lib/manifest/list_group/list/includes/auto.rb b/lib/manifest/list_group/list/includes/auto.rb index ff5a03bb..81fda7b0 100644 --- a/lib/manifest/list_group/list/includes/auto.rb +++ b/lib/manifest/list_group/list/includes/auto.rb @@ -16,7 +16,7 @@ module Manifest def includes model_manifest = ::Manifest.manifest.models[self.item_name] - tree_manifest = model_manifest.tree[self.tree_name] + tree_manifest = model_manifest.tree[@list.list_group.tree_name] if tree_manifest tree_manifest.include_hash else diff --git a/lib/manifest/model/tree.rb b/lib/manifest/model/tree.rb index 27f41ee7..5b17f706 100644 --- a/lib/manifest/model/tree.rb +++ b/lib/manifest/model/tree.rb @@ -23,14 +23,14 @@ module Manifest end def parent_tree_manifest - self.parent_model_manifest[@tree_name] + self.parent_model_manifest.tree[@tree_name] end def include_hash if self.parent_tree_manifest {@parent_model_name => self.parent_tree_manifest.include_hash} else - {} + {@parent_model_name => {}} end end diff --git a/public/manifest.json b/public/manifest.json index 742b311e..8075e79f 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1545,16 +1545,16 @@ }, "lists": { "public": { - "type": "public" + "type": "public", + "args": { + "tree_name": "owner" + } }, "private": { "type": "private" }, "by_panel": { - "type": "filter", - "args": { - "where_name": "public_list_where" - } + "type": "filter" }, "by_author": { "type": "foreign_filter", -- 2.11.0