OSDN Git Service

add comic story
[pettanr/pettanr.git] / app / views / stories / show.html.erb
index fa0c3a0..28f5e3a 100644 (file)
@@ -1,41 +1,54 @@
 <h1><%= t('.title') %></h1>
 <p id="notice"><%= notice %></p>
 
-<p>
-  <b><%= t_m 'Story.comic_id' -%>:</b>
-  <%= link_to comic_icon(:object => @story.comic), comic_path(@story.comic) %>
-  <%= link_to h(@story.comic.title), :controller => 'stories', :action => :comic, :id => @story.comic.id %>
-</p>
+<div>
+  <%= link_to @item.title, story_path(@item) %>
+  <%= link_to_if @item, h(@item.title), play_story_path(@item) %>
+</div>
 
 <p>
-  <b><%= t_m 'Story.panel_id' -%>:</b>
-  <%= link_to panel_icon(:object => @story.panel), panel_path(@story.panel) %>
+  <b><%= t_m 'Story.description' -%>:</b>
+  <%= h(@item.description) %>
 </p>
 
 <p>
-  <b><%= t_m 'Story.t' -%>:</b>
-  <%= @story.t %>
-</p>
-
-<p>
-  <b><%= t_m 'Story.author_id' -%>:</b>
-  <%= link_to author_icon(:object => @story.author), author_path(@story.author) %>
-  <%= link_to h(@story.author.name), author_path(@story.author) %>
+  <b><%= t_m 'Story.visible' -%>:</b>
+  <%= t_selected_item('story_visible_items', @item.visible) %>
 </p>
 
 <p>
   <b><%= t_m 'Story.created_at' -%>:</b>
-  <%= l @story.created_at %>
+  <%= l @item.created_at %>
 </p>
 
 <p>
   <b><%= t_m 'Story.updated_at' -%>:</b>
-  <%= l @story.updated_at %>
+  <%= l @item.updated_at %>
 </p>
-<% if @story.own? @author -%>
-  <%= link_to t('link.edit'), edit_story_path(@story) %>
-  <%= link_to t('link.destroy'), story_path(@story), :method => :delete %>
+<% @item.story_sheets.each do |story_sheet| %>
+  <% if story_sheet.sheet and story_sheet.sheet.visible?(@operators) -%>
+    <div>
+      <%= link_to sheet_icon(:object => story_sheet.sheet, :size => 25), sheet_path(story_sheet.sheet) %>
+      <%= link_to h(truncate(story_sheet.sheet.caption, :length => 40)), play_sheet_path(story_sheet.sheet) %>
+      (<%= story_sheet.sheet.sheet_panels.size -%>)
+    </div>
+  <% end %>
 <% end %>
+<% if @item.own? @operators -%>
+  <%= link_to t('link.edit'), edit_story_path(@item) %>
+  <%= link_to t('link.destroy'), story_path(@item), :method => :delete %>
+
+  <h3><%= t('comic_stories.append.new_comics') -%></h3>
+  <table>
+    <% @new_comic_items.each do |comic| %>
+      <%= render 'comic_stories/append_comic', :story => @item, :comic => comic, :operators => @operators %>
+    <% end %>
+  </table>
 
-<hr>
-<%= render 'panels/standard', :panel => @story.panel, :author => @author %>
+  <h3><%= t('story_sheets.append.new_sheets') -%></h3>
+  <table>
+    <% @new_sheet_items.each do |sheet| %>
+      <%= render 'story_sheets/append_sheet', :story => @item, :sheet => sheet, :operators => @operators %>
+    <% end %>
+  </table>
+<% end %>