OSDN Git Service

t30350#:fix destroy in op, p, user
[pettanr/pettanr.git] / app / views / pictures / show.html.erb
index 5a11460..59402e7 100644 (file)
@@ -1,26 +1,32 @@
 <h1><%= t('.title') %></h1>
 <div>
-  <% if @picture.enable? %>
-    <% if @picture.head? %>
+  <% if @picture.original_picture %>
+    <% if @picture.enable? %>
+      <% if @picture.head? %>
+        <p>
+          <%= t 'pictures.show.announce.head' -%>
+          <%= link_to tag(:img, @picture.tmb_opt_img_tag), resource_picture_path(@picture.resource_picture) %>
+        </p>
+      <% else %>
+        <p>
+          <%= t 'pictures.show.announce.tail' -%>
+          <%= link_to tag(:img, @picture.head.tmb_opt_img_tag), resource_picture_path(@picture.head.resource_picture) %>
+        </p>
+      <% end %>
+    <% else %>
       <p>
-        <%= t 'pictures.show.announce.head' -%>
-        <%= link_to tag(:img, @picture.tmb_opt_img_tag), resource_picture_path(@picture.resource_picture) %>
+        <%= t 'pictures.show.announce.disable' -%>
       </p>
-    <% else %>
+    <% end %>
+    <% if @picture.own? @artist %>
       <p>
-        <%= t 'pictures.show.announce.tail' -%>
-        <%= link_to tag(:img, @picture.head.tmb_opt_img_tag), resource_picture_path(@picture.head.resource_picture) %>
+        <%= t 'pictures.show.announce.owner' -%>
+        <%= link_to tag(:img, @picture.original_picture.tmb_opt_img_tag), original_picture_path(@picture.original_picture) %>
       </p>
     <% end %>
   <% else %>
     <p>
-      <%= t 'pictures.show.announce.disable' -%>
-    </p>
-  <% end %>
-  <% if @picture.own? @artist %>
-    <p>
-      <%= t 'pictures.show.announce.owner' -%>
-      <%= link_to tag(:img, @picture.original_picture.tmb_opt_img_tag), original_picture_path(@picture.original_picture) %>
+      <%= t 'pictures.show.announce.destroyed' -%>
     </p>
   <% end %>
 </div>