OSDN Git Service

fix filter include
authoryasushiito <yas@pen-chan.jp>
Sat, 8 Mar 2014 09:33:56 +0000 (18:33 +0900)
committeryasushiito <yas@pen-chan.jp>
Sat, 8 Mar 2014 09:33:56 +0000 (18:33 +0900)
app/assets/javascripts/manifest/work/models.js.coffee.erb
app/models/balloon.rb
app/models/speech.rb
app/views/balloons/_summary.html.erb
app/views/speeches/_summary.html.erb
app/views/top/index.html.erb
lib/manifest/list_group/list/base.rb
lib/manifest/list_group/list/filter.rb
lib/manifest/list_group/list/includes/auto.rb
lib/manifest/model/tree.rb
public/manifest.json

index f61a285..670c916 100644 (file)
       },\r
       by_panel: {\r
         type: 'filter',\r
-        args: {\r
-          where_name: 'public_list_where',\r
-        },\r
       },\r
       by_author: {\r
         type: 'foreign_filter',\r
-        args: {\r
-          tree_name: 'owner',\r
-        },\r
       },\r
     },\r
   },\r
index 8f08c83..b6a4bbb 100644 (file)
@@ -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
index f42b2a7..fd0dd99 100644 (file)
@@ -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
index 92be2ad..6655049 100644 (file)
@@ -1,4 +1,4 @@
 <div>
-  <%= 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) %>
 </div>
index 92be2ad..6655049 100644 (file)
@@ -1,4 +1,4 @@
 <div>
-  <%= 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) %>
 </div>
index 80de95a..365f350 100644 (file)
       <%= link_to t_m('SpeechBalloon'), main_app.speech_balloons_path %>\r
     </td>\r
     <td width="200px" align="center" valign="middle">\r
+      <%= link_to t_m('Balloon'), main_app.balloons_path %>\r
+    </td>\r
+    <td width="200px" align="center" valign="middle">\r
+      <%= link_to t_m('Speech'), main_app.speeches_path %>\r
+    </td>\r
+  </tr>\r
+  <tr height="100px">\r
+    <td width="200px" align="center" valign="middle">\r
       <%= link_to t_m('GroundPicture'), main_app.ground_pictures_path %>\r
     </td>\r
     <td width="200px" align="center" valign="middle">\r
@@ -57,6 +65,8 @@
     </td>\r
     <td width="200px" align="center" valign="middle">\r
     </td>\r
+    <td width="200px" align="center" valign="middle">\r
+    </td>\r
   </tr>\r
 </table>\r
 <h2><%= t('top.human_resources') -%></h2>\r
index 9053bdf..9766ff6 100644 (file)
@@ -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
index 0239edb..3e31ab0 100644 (file)
@@ -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
index ff5a03b..81fda7b 100644 (file)
@@ -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
index 27f41ee..5b17f70 100644 (file)
@@ -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
       
index 742b311..8075e79 100644 (file)
       },\r
       "lists": {\r
         "public": {\r
-          "type": "public"\r
+          "type": "public",\r
+          "args": {\r
+            "tree_name": "owner"\r
+          }\r
         },\r
         "private": {\r
           "type": "private"\r
         },\r
         "by_panel": {\r
-          "type": "filter",\r
-          "args": {\r
-            "where_name": "public_list_where"\r
-          }\r
+          "type": "filter"\r
         },\r
         "by_author": {\r
           "type": "foreign_filter",\r