-<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(spot)), elm.link) %>
- <% when 'SpeechBalloon' %>
- <div id="vballoon<%= elm.id -%>" class="pettanr-comic-balloon" style="width:<%= elm.balloon.width -%>px; height:<%= elm.balloon.height -%>px; top:<%= elm.balloon.y -%>px; left:<%= elm.balloon.x -%>px; z-index:<%= elm.z -%>; ">
- <img src="<%= elm.balloon.system_picture.url -%>" alt="<%= elm.caption -%>">
- <p style="top:<%= elm.speech.y -%>px; left:<%= elm.speech.x -%>px;width:<%= elm.speech.width -%>px; height:<%= elm.speech.height -%>px;">
- <span><%= h elm.speech.content -%></span>
- </p>
- </div>
- <% when 'GroundPicture' %>
- <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' %>
- <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>
+<% panel.panel_elements.each do |elm| %>
+ <% case elm.class.to_s %>
+ <% when 'SpeechBalloon' %>
+ <% elm.boost %>
+ <% end %>
+<% end %>
+<%= 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? operators -%>
+ <% panel.panel_elements.each do |elm| %>
+ <%= render elm.class.to_s.tableize + '/element', :elm => elm, :spot => spot %>
<% end %>
+ <% else %>
+ <h2><%= t('panels.hidden') %></h2>
<% end %>
-</div>
+<% end %>
+<% panel.rendered %>