YaleSTC/shifts

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

Summary

Maintainability
Test Coverage
<% title "Tasks Index" %>

<table id="tasks_table" class="tablesorter">
    <thead>
      <tr>
        <th>Name</th>
        <% unless mobile_device?%>
        <th>Kind</th>
            <th>Location</th>
        <th>Start</th>
        <th>End</th>
        <th>Time</th>
        <th>Weekday</th>
        <th>Active</th>
        <th colspan=2>Task Records</th>
        <% end %>
      </tr>
    </thead>
    <tbody>
        <%= render partial: "task", collection: @active_tasks  %>
    </tbody>
</table>

<% if !@inactive_tasks.empty? %>
    <h4>Expired/Inactive Tasks:</h4>

    <table class = "tablesorter">
    <%= render partial: "task", collection: @inactive_tasks %>
    </table>
<% end %>

<br />

<% if current_user.is_admin_of?(current_department)%>
  <%= link_to 'New Task', new_task_path %>
<% end %>