YaleSTC/shifts

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

Summary

Maintainability
Test Coverage
<fieldset>
  <legend><font size=3><strong>Status:</strong> <%= @payform.status.capitalize %></font></legend>
  <strong>Created:</strong> <%= @payform.created_at.strftime(date_format + " at " + time_format) %><br/>
<% if @payform.submitted %>
  <strong>Submitted:</strong> <%= @payform.submitted.strftime(date_format + " at " + time_format) %><br/>
<% end %>
<% if @payform.approved and current_user.is_admin_of?(@payform.department) %>
  <strong>Approved:</strong> <%= @payform.approved.strftime(date_format + " at " + time_format) %> by <%= @payform.approved_by.name %><br/>
<% end %>
<% if @payform.printed %>
  <strong>Printed:</strong> <%= @payform.printed.strftime(date_format + " at " + time_format) %><br/>
  <em><%=@payform.department.department_config.printed_message%></em><br/>
<%end %>
<% if @payform.hours > current_department.department_config.payform_time_limit %>
    <% if @payform.user != current_user %>
    <h3><font color='red'><%= "#{@payform.user.name} has listed more than the allowed #{current_department.department_config.payform_time_limit} hours"%></font></h3>
    <% else %>
    <h3><font color='red'><%= "You have listed more than the allowed #{current_department.department_config.payform_time_limit} hours"%></font></h3>
    <% end %>
<% end %>
</fieldset>