OSDN Git Service

t#29822:upd;update resource pict view
authoryasushiito <yas@pen-chan.jp>
Thu, 11 Oct 2012 23:30:49 +0000 (08:30 +0900)
committeryasushiito <yas@pen-chan.jp>
Thu, 11 Oct 2012 23:30:49 +0000 (08:30 +0900)
app/views/original_pictures/_history_list.html.erb
app/views/pictures/_head.html.erb
app/views/pictures/show.html.erb
app/views/resource_pictures/index.html.erb
app/views/resource_pictures/show.html.erb

index 1e955fd..603671a 100644 (file)
@@ -1,5 +1,5 @@
 <% history.each do |picture| -%>
-  <h3>revision:<%= picture.revision %></h3>
+  <h3>revision:<%= link_to picture.revision, picture_path(picture) %></h3>
   <div>licensed at <%= picture.created_at %></div>
   <table class="no-border">
     <tr>
index ac14f8f..6cb17a8 100644 (file)
@@ -1,3 +1,31 @@
 <img src="<%= picture.url -%>">
-<%= render picture.credit_template, :picture => picture %>
-<div>revision:<%= picture.revision %></div>
+<table>
+  <tr>
+    <th>credit</th>
+    <th>artist</th>
+    <th>properties</th>
+    <th>revision</th>
+  </tr>
+  <tr>
+    <td>
+      <%= render picture.credit_template, :picture => picture %>
+    </td>
+    <td>
+      <%= link_to(h(picture.artist.name), artist_path(picture.artist)) %>
+    </td>
+    <td>
+      <div>
+        <%= picture.ext %>
+      </div>
+      <div>
+        <%= picture.width %>x<%= picture.height %>px
+      </div>
+      <div>
+        <%= picture.filesize %>bytes
+      </div>
+    </td>
+    <td>
+      <%= picture.revision %>
+    </td>
+  </tr>
+</table>
index 952542a..af095f8 100644 (file)
@@ -1,33 +1,3 @@
-<p>
-  <b>Ext:</b>
-  <%= @original_picture.ext %>
-</p>
-
-<p>
-  <b>Width:</b>
-  <%= @original_picture.width %>
-</p>
-
-<p>
-  <b>Height:</b>
-  <%= @original_picture.height %>
-</p>
-
-<p>
-  <b>filesize:</b>
-  <%= @original_picture.filesize %>
-</p>
-
-<p>
-  <b>md5:</b>
-  <%= @original_picture.md5 %>
-</p>
-
-<p>
-  <b>artist:</b>
-  <%= @original_picture.artist_id %>
-</p>
-
 <% if @picture.head? %>
   <%= render 'head', :picture => @picture %>
 <% else %>
index 71e7566..4d04af2 100644 (file)
@@ -1,11 +1,33 @@
 <h1>Listing resource_pictures</h1>
+<table>
+  <tr>
+    <th>picture</th>
+    <th>credit</th>
+    <th>artist</th>
+    <th>properties</th>
+  </tr>
 <% @resource_pictures.each do |resource_picture| %>
-  <% @resource_picture = resource_picture %>
-  <div>
-    <%= link_to resource_picture.filename, resource_picture_path(resource_picture) %>
-    <%= tag :img, resource_picture.opt_img_tag %>
-    <%= resource_picture.width %>x<%= resource_picture.height %>
-    <%= resource_picture.filesize %>bytes
-    <%= render resource_picture.credit_template, :picture => resource_picture %>
-  </div>
+  <tr>
+    <td>
+      <%= link_to tag(:img, resource_picture.opt_img_tag), resource_picture %>
+    </td>
+    <td>
+      <%= render resource_picture.credit_template, :picture => resource_picture %>
+    </td>
+    <td>
+      <%= link_to(h(resource_picture.artist.name), artist_path(resource_picture.artist)) %>
+    </td>
+    <td>
+      <div>
+        <%= resource_picture.ext %>
+      </div>
+      <div>
+        <%= resource_picture.width %>x<%= resource_picture.height %>px
+      </div>
+      <div>
+        <%= resource_picture.filesize %>bytes
+      </div>
+    </td>
+  </tr>
 <% end %>
+</table>
index 6827972..081e7f0 100644 (file)
@@ -1,3 +1,30 @@
+<h1>Resource Picture #<%= @resource_picture.id %></h1>
 <p id="notice"><%= notice %></p>
-  <%= render 'pictures/head', :picture => @resource_picture.picture %>
+<img src="<%= @resource_picture.url 'full' -%>">
+<table>
+  <tr>
+    <th>credit</th>
+    <th>artist</th>
+    <th>properties</th>
+  </tr>
+  <tr>
+    <td>
+      <%= render @resource_picture.credit_template, :picture => @resource_picture %>
+    </td>
+    <td>
+      <%= link_to(h(@resource_picture.artist.name), artist_path(@resource_picture.artist)) %>
+    </td>
+    <td>
+      <div>
+        <%= @resource_picture.ext %>
+      </div>
+      <div>
+        <%= @resource_picture.width %>x<%= @resource_picture.height %>px
+      </div>
+      <div>
+        <%= @resource_picture.filesize %>bytes
+      </div>
+    </td>
+  </tr>
+</table>
 <%= link_to 'Back', resource_pictures_path %>