respond_to do |format|
if @comic.destroy_with_story
flash[:notice] = I18n.t('flash.notice.destroyed', :model => Comic.model_name.human)
- format.html { redirect_to '/home/comic' }
+ format.html { redirect_to '/home/comics' }
format.json { head :ok }
else
flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Comic.model_name.human)
Panel.transaction do
if @panel.destroy_with_elements
flash[:notice] = I18n.t('flash.notice.destroyed', :model => Panel.model_name.human)
- format.html { redirect_to '/home/panel' }
+ format.html { redirect_to '/home/panels' }
format.json { head :ok }
else
flash[:notice] = I18n.t('flash.notice.not_destroyed', :model => Panel.model_name.human)
end
def opt_div_style full_url, spot = nil, opacity = 20
- o = spot and spot != self ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
- "width:#{self.panel.width}px; height:#{self.panel.height}px; z-index:#{self.z}; background-image: url(#{full_url}); background-repeat: #{self.repeat_text}; background-position: #{self.x}px, #{self.y}px; #{o}"
+ o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
+ "position: absolute; width:#{self.panel.width}px; height:#{self.panel.height}px; top: 0px; left: 0px; z-index:#{self.z}; background-image: url(#{full_url}); background-repeat: #{self.repeat_text}; background-position: #{self.x}px, #{self.y}px; #{o}"
end
def tmb_opt_img_tag
end
def panel_elements
- parts + grounds
+ (parts + grounds).compact
end
@@elm_json_opt = {
end
def opt_img_tag spot = nil, opacity = 20
- o = spot and spot != self ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
+ o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
{:src => self.url, :vPicture => self.id, :width => self.width.abs, :height => self.height.abs, :alt => self.caption, :style => "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; #{o}"}
end
+++ /dev/null
-<div 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;">
- <% panel.panel_elements.each do |elm| %>
- <% case elm.class.to_s %>
- <% when 'PanelPicture' %>
- <%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(elm == spot ? nil : 33)), elm.link) %>
- <% when 'SpeechBalloon' %>
- <% balloon = elm.balloons.first %>
- <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
- <img src="<%= balloon.system_picture.url -%>" alt="<%= balloon.caption -%>">
- <% elm.speeches.each do |speech| %>
- <p style="top:<%= speech.y -%>px; left:<%= speech.x -%>px;width:<%= speech.width -%>px; height:<%= speech.height -%>px;">
- <span><%= h speech.content -%></span>
- </p>
- <% end %>
- </div>
- <% when 'GroundColor' %>
- <div id="ground-color<%= elm.id -%>" class="pettanr-comic-ground-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%06x", elm.code) -%>;">
-
- </div>
- <% when 'GroundPicture' %>
- <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-image: url(<%= full_url elm.picture.url -%>); background-repeat: <%= elm.repeat_text -%>; background-position: <%= elm.x -%>px, <%= elm.y -%>px;">
-
- </div>
- <% end %>
- <% end %>
-</div>
<b><%= t_m 'Panel.caption' -%>:</b>
<%= h(panel.caption) %>
-<%= render 'panel_pictures/body', :panel => panel, :author => author, :spot => spot %>
+<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
<%= render 'panels/footer', :panel => panel, :author => author %>
<%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
+++ /dev/null
-<div 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;">
- <% panel.panel_elements.each do |elm| %>
- <% case elm.class.to_s %>
- <% when 'PanelPicture' %>
- <%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(elm == spot ? nil : 33)), elm.link) %>
- <% when 'SpeechBalloon' %>
- <% balloon = elm.balloons.first %>
- <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
- <img src="<%= balloon.system_picture.url -%>" alt="<%= balloon.caption -%>">
- <% elm.speeches.each do |speech| %>
- <p style="top:<%= speech.y -%>px; left:<%= speech.x -%>px;width:<%= speech.width -%>px; height:<%= speech.height -%>px;">
- <span><%= h speech.content -%></span>
- </p>
- <% end %>
- </div>
- <% when 'GroundColor' %>
- <div id="ground-color<%= elm.id -%>" class="pettanr-comic-ground-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%06x", elm.code) -%>;">
-
- </div>
- <% when 'GroundPicture' %>
- <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-image: url(<%= full_url elm.picture.url -%>); background-repeat: <%= elm.repeat_text -%>; background-position: <%= elm.x -%>px, <%= elm.y -%>px;">
-
- </div>
- <% end %>
- <% end %>
-</div>
<b><%= t_m 'Panel.caption' -%>:</b>
<%= h(panel.caption) %>
-<%= render 'panel_pictures/body', :panel => panel, :author => author, :spot => spot %>
+<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
<%= render 'panels/footer', :panel => panel, :author => author %>
<%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
+++ /dev/null
-<div 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;">
- <% panel.panel_elements.each do |elm| %>
- <% case elm.class.to_s %>
- <% when 'PanelPicture' %>
- <%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(elm == spot ? nil : 33)), elm.link) %>
- <% when 'SpeechBalloon' %>
- <% balloon = elm.balloons.first %>
- <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
- <img src="<%= balloon.system_picture.url -%>" alt="<%= balloon.caption -%>">
- <% elm.speeches.each do |speech| %>
- <p style="top:<%= speech.y -%>px; left:<%= speech.x -%>px;width:<%= speech.width -%>px; height:<%= speech.height -%>px;">
- <span><%= h speech.content -%></span>
- </p>
- <% end %>
- </div>
- <% when 'GroundColor' %>
- <div id="ground-color<%= elm.id -%>" class="pettanr-comic-ground-color" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-color:#<%= format("%06x", elm.code) -%>;">
-
- </div>
- <% when 'GroundPicture' %>
- <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="width:<%= panel.width -%>px; height:<%= panel.height -%>px; z-index:<%= elm.z -%>; background-image: url(<%= full_url elm.picture.url -%>); background-repeat: <%= elm.repeat_text -%>; background-position: <%= elm.x -%>px, <%= elm.y -%>px;">
-
- </div>
- <% end %>
- <% end %>
-</div>
<b><%= t_m 'Panel.caption' -%>:</b>
<%= h(panel.caption) %>
-<%= render 'panel_pictures/body', :panel => panel, :author => author, :spot => spot %>
+<%= render 'panels/body', :panel => panel, :author => author, :spot => spot %>
<%= render 'panels/footer', :panel => panel, :author => author %>
<%= render 'panels/licensed_pictures', :licensed_pictures => panel.licensed_pictures %>
<% panel.panel_elements.each do |elm| %>
<% case elm.class.to_s %>
<% when 'PanelPicture' %>
- <%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(elm == spot ? nil : 20)), elm.link) %>
+ <%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(spot)), elm.link) %>
<% when 'SpeechBalloon' %>
<% balloon = elm.balloons.first %>
<div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= balloon.width -%>px; height:<%= balloon.height -%>px; top:<%= balloon.y -%>px; left:<%= balloon.x -%>px; z-index:<%= elm.z -%>; ">
<% end %>
</div>
<% when 'GroundPicture' %>
- <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="<%= elm.opt_div_style(full_url(elm.picture.url)) -%>">
+ <div id="ground-picture<%= elm.id -%>" class="pettanr-comic-ground-picture" style="<%= elm.opt_div_style(full_url(elm.picture.url), spot) -%>">
</div>
<% when 'GroundColor' %>