OSDN Git Service

t#31470:create pager
[pettanr/pettanr.git] / app / views / original_pictures / index.html.erb
1 <h1><%= t '.title' -%></h1>
2
3 <%= render 'form' %>
4 <table>
5   <tr>
6     <th><%= t_m 'OriginalPicture' -%></th>
7     <th><%= t 'original_pictures.index.history' -%></th>
8     <th><%= t 'original_pictures.index.status' -%></th>
9     <th><%= t_m 'ResourcePicture' -%></th>
10     <th><%=  -%></th>
11     <th><%=  -%></th>
12   </tr>
13   <% @original_pictures.each do |original_picture| %>
14     <tr>
15       <td>
16         <%= link_to tag(:img, original_picture.tmb_opt_img_tag), original_picture %>
17       </td>
18       <td>
19         <% if original_picture.pictures.empty? %>
20           -
21         <% else %>
22           <%= link_to original_picture.history.first.revision, history_original_picture_path(original_picture) %>
23         <% end %>
24       </td>
25       <td>
26         <% case true %>
27         <% when  original_picture.unpublished? %>
28           <%= t('original_pictures.unpublished') %>
29         <% when  original_picture.unlicensed? %>
30           <%= t('original_pictures.unlicensed') %>
31         <% when  original_picture.stopped? %>
32           <%= t('original_pictures.stopped') %>
33         <% when  original_picture.published? %>
34           <%= t('original_pictures.published') %>
35         <% end %>
36       </td>
37       <td>
38         <% if original_picture.resource_picture %>
39           <%= link_to tag(:img, original_picture.resource_picture.tmb_opt_img_tag), original_picture.resource_picture %>
40         <% else %>
41         <% end %>
42       </td>
43       <td>
44         <% if original_picture.resource_picture %>
45           <%= link_to t('original_pictures.index.stop'), original_picture.resource_picture, confirm: 'Are you sure?', method: :delete %>
46         <% else %>
47         <% end %>
48       </td>
49       <td>
50         <%= link_to t('original_pictures.index.destroy'), original_picture, confirm: 'Are you sure?', method: :delete %>
51       </td>
52     </tr>
53   <% end %>
54 </table>
55 <%= paginate(@paginate) %>