MiraitSystems/enju_trunk

View on GitHub
app/views/subscriptions/index.html.erb

Summary

Maintainability
Test Coverage
<div id="content_detail" class="ui-corner-all">
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.subscription')) -%></h1>
<div id="content_list">

<table class="index">
  <tr>
    <th><%= t('page.title') -%></th>
    <th><%= t('activerecord.attributes.subscription.subscribes_count') -%></th>
    <th></th>
  </tr>

<%- @subscriptions.each do |subscription| -%>
  <tr class="line<%= cycle("0", "1") -%>">
    <td><%= link_to subscription.title, subscription -%></td>
    <td><%= subscription.works.size -%></td>
    <td>
      <% if can? :destroy, subscription %>
        <%= link_to t('page.edit'), edit_subscription_path(subscription) -%>
        <%= link_to t('page.destroy'), subscription, :confirm => t('page.are_you_sure'), :method => :delete -%>
      <% end %>
    </td>
  </tr>
<%- end -%>
</table>

<%= paginate(@subscrpitions) -%>

</div>
</div>

<div id="submenu" class="ui-corner-all">
  <ul>
    <%- if @work -%>
      <li><%= link_to t('page.add', :model => t('activerecord.models.work')), subscriptions_path -%></li>
    <%- else -%>
      <li><%= link_to t('page.new', :model => t('activerecord.models.subscription')), new_subscription_path -%></li>
    <%- end -%>
  </ul>
</div>