OSDN Git Service

m
authoryasushiito <yas@pen-chan.jp>
Sun, 17 Nov 2013 05:47:42 +0000 (14:47 +0900)
committeryasushiito <yas@pen-chan.jp>
Sun, 17 Nov 2013 05:47:42 +0000 (14:47 +0900)
app/models/panel.rb
app/models/speech_balloon.rb
app/views/panels/_body.html.erb
lib/element.rb
vendor/plugins/content/lib/content.rb
vendor/plugins/element/lib/element.rb
vendor/plugins/item/lib/item.rb

index cc1dc82..e4e82f3 100644 (file)
@@ -123,6 +123,14 @@ class Panel < ActiveRecord::Base
     self.field_tag_attributes(column, no_attr, opt).to_attr
   end
   
+    def render_count
+      @render_count ||= 1
+    end
+    
+    def rendered
+      @render_count = render_count + 1
+    end
+    
   def self.default_page_size
     25
   end
index e58d0b7..8c6423f 100644 (file)
@@ -76,7 +76,7 @@ class SpeechBalloon < ActiveRecord::Base
     self.speech_balloon_template.symbol_option
   end
   
-  def new_sballoon
+  def new_balloon
     @new_balloon
   end
   
index 1002028..355017e 100644 (file)
@@ -4,7 +4,7 @@
     <% elm.boost %>
   <% end %>
 <% end %>
-<div id="<%= panel.tag_id -%>" panel_id="<%= panel.tag_panel_id -%>" class="pettanr-comic-panel" style="width:<%= panel.width %>px;height:<%= panel.height %>px;border-style: solid;border-width: <%= panel.border %>px;border-color:black; background-color:white;">
+<%= content_tag :div, :id => panel.tag_id, :panel_id => panel.tag_panel_id, :class => "pettanr-comic-panel", :style => "width: #{panel.width}px; height: #{panel.height}px; border-style: solid; border-width: #{panel.border}px; border-color: black; background-color: white;" do %>
   <% if panel.visible? author -%>
     <% panel.panel_elements.each do |elm| %>
       <%= render elm.class.to_s.tableize + '/element', :elm => elm, :spot => spot %>
@@ -12,4 +12,5 @@
   <% else %>
     <h2><%= t('panels.hidden') %></h2>
   <% end %>
-</div>
+<% end %>
+<% panel.rendered %>
index a92f430..3cfa688 100644 (file)
@@ -68,6 +68,18 @@ module Element
        end
     end
     
+    def element_index
+      @element_index ||= self.t
+    end
+    
+    def parent
+      @parent ||= self.panel
+    end
+    
+    def parent= content
+      @parent = content
+    end
+    
     def new_index
       @new_index
     end
index 2357006..7842593 100644 (file)
@@ -1,3 +1,4 @@
+=begin
 module ActiveRecord
   class Base
     module Content
@@ -73,3 +74,4 @@ module ActiveRecord
   end
 end
 
+=end
index 154a9ba..d210ed3 100644 (file)
@@ -1,3 +1,4 @@
+=begin
 module ActiveRecord
   class Base
     module Element
@@ -21,3 +22,4 @@ module ActiveRecord
   end
 end
 
+=end
index 986bd82..2110fe9 100644 (file)
@@ -1,3 +1,4 @@
+=begin
 module ActiveRecord
   class Base
     module Item
@@ -89,7 +90,7 @@ module ActiveRecord
         def item_name
         end
         
-        def item_id 
+        def dom_id_item 
           self.new_record? ? '0' : self.id.to_s
         end
         
@@ -97,7 +98,7 @@ module ActiveRecord
           self.item_name + self.item_id + c.to_s
         end
         
-        def tag_item_field_id field_name
+        def dom_id_item_field field_name
           self.tag_item_id + field_name.to_s
         end
         
@@ -158,3 +159,5 @@ module ActiveRecord
   end
 end
 
+=end
+