OSDN Git Service

merge v06sheet
[pettanr/pettanr.git] / app / views / scrolls / play.html.erb
diff --git a/app/views/scrolls/play.html.erb b/app/views/scrolls/play.html.erb
new file mode 100644 (file)
index 0000000..5efd909
--- /dev/null
@@ -0,0 +1,33 @@
+<% @page_title = @scroll.title %>
+<h1><%= t '.title' -%></h1>
+<p id="notice"><%= notice %></p>
+<%= render 'scroll_panels/scroll_header', :scroll => @scroll, :author => @author %>
+
+<% if @scroll_panels.empty? -%>
+  <h2><%= t('scrolls.play.empty') %></h2>
+<% else %>
+  <% @scroll_panels.each do |scroll_panel| %>
+    <% if scroll_panel.panel -%>
+      <%= render 'panels/body', :panel => scroll_panel.panel, :author => @author, :spot => nil %>
+    <% end %>
+    <%= render 'scroll_panels/footer', :scroll_panel => scroll_panel, :author => @author %>
+  <% end %>
+  <%= render 'scroll_panels/licensed_pictures', :licensed_pictures => ScrollPanel.licensed_pictures(@scroll_panels) %>
+
+  <% if @prev_offset -%>
+    <%= link_to h('<<prev'), play_scroll_path(@scroll, {:offset => @prev_offset, :count => @panel_count}) %>
+  <% end %>
+
+  <% if @next_offset -%>
+    <%= link_to h('next>>'), play_scroll_path(@scroll, {:offset => @next_offset, :count => @panel_count}) %>
+  <% end %>
+
+<% end %>
+<% if @scroll.own? @author -%>
+  <h3><%= t('scroll_panels.append.new_panels') -%></h3>
+  <table>
+    <% @new_panels.each do |panel| %>
+      <%= render 'scroll_panels/append_panel', :scroll => @scroll, :panel => panel, :author => @author %>
+    <% end %>
+  </table>
+<% end %>