YaleSTC/shifts

View on GitHub
app/views/reports/tasks_and_objects_list.html.erb

Summary

Maintainability
Test Coverage
<!-- when you make an entry(make_entry.js.erb) it currently renders report tasks which is the 
same as below except the links for the tasks dont have the all_tasks param. The partial 
should instead have a conditional that adds the param to the link if you are on the all 
tasks page and leaves it off if you are on a normal shift report page. That would allow
the below code to be rendered in with a simple partial and would allow make_entry.js.erb
to load the proper tasks list after you complete a task. -->


<div id = "left_stuff">
  <fieldset id = "shift_tasks" class= "index">
    <legend>All Tasks</legend>
    <div id = "tasks">
    <%= render partial: 'tasks/report_tasks', locals: {all_tasks: true} %>
    </div>
  </fieldset>
</div>


<div id = "right_stuff">
  <fieldset id = "report_data_objects" class = "index">
     <legend>All Data Objects</legend>
     <% @loc_groups.each do |loc_group| %>
         <div >
             <strong><%= loc_group.name %></strong>
         </div>
         <% unless loc_group.data_objects.empty? %>
            <% loc_group.data_objects.each do |data_object| %>
                 <div style="width: 60%; float:left">
                    <%= link_to "Update #{data_object.name}", 
                        new_data_object_data_entry_path(data_object), 
                        title: "Record New Data Entry", 
                        data: {toggle: "modal", target: "#modal", remote: new_data_object_data_entry_path(data_object, layout: "false")}%>
                    <br/>
                </div>
            <% end %>
        <% else %>
             <em>There are no data objects in this location.</em>
        <% end %>
        <div style="clear:both"></div>
    <% end %>
  </fieldset>
</div>