YaleSTC/shifts

View on GitHub
app/views/payforms/_category.html.erb

Summary

Maintainability
Test Coverage
<% jobs = @payform.payform_items.in_category(category) %>


<% if !current_user.is_admin_of?(@payform.department) %>
  <% jobs = jobs.active #only show active %>
<% end %>

<% unless jobs.empty? %>

<thead>
  <tr class="category">
    <th scope="col" id="<%= category.name %>" colspan=7>
      <div class="hours-right">
        <%= number_with_precision(PayformItem.rounded_hours(jobs), precision: 2) %>
      </div>
      <%= category.name %>
    </th>
  </tr>
</thead>
<tbody>
  <%= render partial: "payform_item", collection: jobs, locals: {type: 'payform_item'} %>
</tbody>
<% end %>