self.speech_balloon
end
+ def get_panel_id
+ if self.get_speech_balloon == nil or self.get_speech_balloon.panel == nil or self.get_speech_balloon.panel.new_record?
+ 0
+ else
+ self.get_speech_balloon.panel.id
+ end
+ end
+
def tag_id c = nil
'panel' + tag_panel_id + tag_element_type + tag_element_id + tag_element_part_type + tag_element_part_id + c.to_s
end
end
def tag_panel_id
- self.get_speech_balloon.panel.new_record? ? '0' : self.get_speech_balloon.panel.id.to_s
+ self.get_panel_id.to_s
end
def tag_element_id
- self.get_speech_balloon.new_record? ? '0' : self.get_speech_balloon.id.to_s
+ r = if self.get_speech_balloon == nil or self.get_speech_balloon.new_record?
+ 0
+ else
+ self.get_speech_balloon.panel.id
+ end
+ r.to_s
end
def tag_element_type
self.panel.remove_element(self, au)
end
+ def copy from_panel
+ r = GroundColor.new self.attributes
+ r.panel_id = from_panel.id
+ r.t = r.panel.new_t
+ r.z = r.panel.new_z
+ r
+ end
+
def scenario
if caption.blank?
''
self.panel.remove_element(self, au)
end
+ def copy from_panel
+ r = GroundPicture.new self.attributes
+ r.panel_id = from_panel.id
+ r.t = r.panel.new_t
+ r.z = r.panel.new_z
+ r
+ end
+
def scenario
if caption.blank?
''
self.panel.remove_element(self, au)
end
+ def copy from_panel
+ r = PanelPicture.new self.attributes
+ r.panel_id = from_panel.id
+ r.t = r.panel.new_t
+ r.z = r.panel.new_z
+ r
+ end
+
def scenario
if caption.blank?
''
self.speech_balloon
end
+ def get_panel_id
+ if self.get_speech_balloon == nil or self.get_speech_balloon.panel == nil or self.get_speech_balloon.panel.new_record?
+ 0
+ else
+ self.get_speech_balloon.panel.id
+ end
+ end
+
def tag_id c = nil
'panel' + tag_panel_id + tag_element_type + tag_element_id + tag_element_part_type + tag_element_part_id + c.to_s
end
end
def tag_panel_id
- self.get_speech_balloon.panel.new_record? ? '0' : self.get_speech_balloon.panel.id.to_s
+ self.get_panel_id.to_s
end
def tag_element_id
- self.get_speech_balloon.new_record? ? '0' : self.get_speech_balloon.id.to_s
+ r = if self.get_speech_balloon == nil or self.get_speech_balloon.new_record?
+ 0
+ else
+ self.get_speech_balloon.panel.id
+ end
+ r.to_s
end
def tag_element_type
self.panel.remove_element(self, au)
end
+ def copy from_panel
+ sb = SpeechBalloon.new self.attributes
+ sb.panel_id = from_panel.id
+ sb.t = sb.panel.new_t
+ sb.z = sb.panel.new_z
+ b = sb.build_balloon(self.balloon.attributes)
+ s = sb.build_speech(self.speech.attributes)
+ sb.extend self.speech_balloon_template.engine_speech_balloon_module
+ b.extend self.speech_balloon_template.engine_balloon_module
+ s.extend self.speech_balloon_template.engine_speech_module
+ b.new_speech_balloon = sb
+ s.new_speech_balloon = sb
+ sbe = sb.extend_speech_balloon
+ be = b.extend_balloon
+ se = s.extend_speech
+ {:speech_balloon => sb, :balloon => b, :speech => s, :speech_balloon_extend => sbe, :balloon_extend => be, :speech_extend => se }
+ end
+
def scenario
ERB::Util.html_escape(self.caption.to_s) + self.balloon.scenario.to_s +
self.speech.scenario.to_s
--- /dev/null
+<% if author and author.working? -%>
+ <h2><%= 'Copying my working panel' -%></h2>
+ <h3><%= t('home.index.catch') -%></h3>
+ <%= link_to panel_icon(:object => author.working_panel, :size => 25), panel_path(author.working_panel) %>
+ <%= link_to author.working_panel.caption, main_app.panel_path(author.working_panel) %>
+
+ <%= render 'ground_colors/form', :ground_color => ground_color.copy(author.working_panel) %>
+<% end -%>
<%= link_to t('link.edit'), edit_ground_color_path(@ground_color) %>
<%= link_to t('link.destroy'), ground_color_path(@ground_color), :method => :delete %>
-<% if @author and @author.working? -%>
- <h3><%= t('home.index.catch') -%></h3>
- <%= link_to panel_icon(:object => @author.working_panel, :size => 25), panel_path(@author.working_panel) %>
- <%= link_to @author.working_panel.caption, main_app.panel_path(@author.working_panel) %>
-
- <p>
- <%= link_to t('resource_pictures.add_to_panel_for_ground_color'), main_app.new_ground_color_path(:code => @ground_color.code) %>
- </p>
-<% end -%>
+<%= render 'copy', :ground_color => @ground_color, :author => @author %>
--- /dev/null
+<% if author and author.working? -%>
+ <h2><%= 'Copying my working panel' -%></h2>
+ <h3><%= t('home.index.catch') -%></h3>
+ <%= link_to panel_icon(:object => author.working_panel, :size => 25), panel_path(author.working_panel) %>
+ <%= link_to author.working_panel.caption, main_app.panel_path(author.working_panel) %>
+
+ <%= render 'ground_pictures/form', :ground_picture => ground_picture.copy(author.working_panel) %>
+<% end -%>
<%= link_to t('link.edit'), edit_ground_picture_path(@ground_picture) %>
<%= link_to t('link.destroy'), ground_picture_path(@ground_picture), :method => :delete %>
+
+<%= render 'copy', :ground_picture => @ground_picture, :author => @author %>
--- /dev/null
+<% if author and author.working? -%>
+ <h2><%= 'Copying my working panel' -%></h2>
+ <h3><%= t('home.index.catch') -%></h3>
+ <%= link_to panel_icon(:object => author.working_panel, :size => 25), panel_path(author.working_panel) %>
+ <%= link_to author.working_panel.caption, main_app.panel_path(author.working_panel) %>
+
+ <%= render 'panel_pictures/form', :panel_picture => panel_picture.copy(author.working_panel) %>
+<% end -%>
<%= link_to t('link.edit'), edit_panel_picture_path(@panel_picture) %>
<%= link_to t('link.destroy'), panel_picture_path(@panel_picture), :method => :delete %>
+
+<%= render 'copy', :panel_picture => @panel_picture, :author => @author %>
--- /dev/null
+<% if author and author.working? -%>
+ <h2><%= 'Copying my working panel' -%></h2>
+ <h3><%= t('home.index.catch') -%></h3>
+ <%= link_to panel_icon(:object => author.working_panel, :size => 25), panel_path(author.working_panel) %>
+ <%= link_to author.working_panel.caption, main_app.panel_path(author.working_panel) %>
+ <% sbset = speech_balloon.copy(author.working_panel) -%>
+
+ <%= render speech_balloon.speech_balloon_template.engine_name + '/speech_balloons/form', :speech_balloon => sbset[:speech_balloon], :balloon => sbset[:balloon], :speech => sbset[:speech], :speech_balloon_extend => sbset[:speech_balloon_extend], :balloon_extend => sbset[:balloon_extend], :speech_extend => sbset[:speech_extend] %>
+<% end -%>
<%= link_to t('link.edit'), edit_speech_balloon_path(@speech_balloon) %>
<%= link_to t('link.destroy'), speech_balloon_path(@speech_balloon), :method => :delete %>
+
+<%= render 'copy', :speech_balloon => @speech_balloon, :author => @author %>
<div class="field">
<%= f.label :content %><br />
- <%= f.number_field :content, :id => speech.field_tag_id(:content), :panel_id => speech.tag_panel_id, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :content, :tree => speech.field_tree(:content) %>
+ <%= f.texxt_area :content, :id => speech.field_tag_id(:content), :panel_id => speech.tag_panel_id, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :content, :tree => speech.field_tree(:content) %>
</div>
<%= f.hidden_field :x, :id => speech.field_tag_id(:x), :panel_id => speech.tag_panel_id, :element_id => speech.tag_element_id, :element_type => speech.tag_element_type, :element_part_id => speech.tag_element_part_id, :element_part_type => speech.tag_element_part_type, :column => :x, :tree => speech.field_tree(:x) %>