bhoggard/submitter

View on GitHub
app/views/admin/works/index.html.erb

Summary

Maintainability
Test Coverage
<h1>Works</h1>

<p>Total works submitted: <%= Work.count %></p>
<p>Click thumbnail or title to view work</p>
<p><%= link_to "Add new work", new_admin_work_path %></p>


<table class="table table-striped table-bordered">
  <thead>
  <tr>
    <th>#</th>
    <th>Thumbnail</th>
    <th>Artist</th>
    <th>Title, Year</th>
    <th>Materials</th>
    <th>Dimensions</th>
    <th>Edition</th>
    <th>Estimated Value</th>
    <th>Committee Member</th>
    <th>Courtesy</th>
    <th>Date Uploaded</th>
  </tr>
  </thead>
  <tbody>
  <% @works.each_with_index do |work, index| %>
  <tr>
    <td style="text-align: right"><%= index + 1 %></td>
    <td><%= link_to image_tag(work.image(:thumb), :width => 80), [:admin, work] %><br /><%= link_to 'edit', edit_admin_work_path(work) %></td>
    <td><%= artist_name(work) %></td>
    <td>
      <%= link_to "#{work.title}, #{work.year}", [:admin, work] %>
      <% unless work.confirmed %>
        <p style="color: red">NOT CONFIRMED</p>
      <% end %>
    </td>
    <td><%= work.materials %></td>
    <td><%= work_dimensions(work) %></td>
    <td><%= work.edition %></td>
    <td style="text-align: right"><%= number_to_currency(work.estimated_value, :precision => 0) %></td>
    <td><%= work.committee_member %></td>
    <td><%= work.courtesy %></td>
    <td><%= work.created_at.strftime('%Y-%m-%d') %></td>
  </tr>
  <% end %>
  </tbody>
</table>
    
<%#= paginate @works %>