YaleSTC/shifts

View on GitHub
app/views/timeline/_day.html.erb

Summary

Maintainability
Test Coverage
<% day_preprocessing(day) %>

<% @location_row = 1 %>
<% @location_group_row = 0 %>

<%#TODO: this whole section needs to be cleaned up... we should standardize ids, classes, etc... %>
<div id="<%= day.to_s %>" class="day_partial">
  <h4 class="trigger"><%= day.to_s(:just_date_long) %></h2>
  <div class="timeline" id="day_<%=day.to_s %>">
    <div class="days">
      <div class="day" style="height: <%= @table_pixels / (@table_height)%>px;"></div>
      <%= render partial: "shifts/schedule/loc_group", collection: @loc_groups, locals: {day: day} %>
    </div>
    <div class="timeline-data">
      <ul class="intervals" style="height: <%= @table_pixels / (@table_height)%>px;">
        <%= render partial: "shifts/schedule/hour", collection:  (@dept_start_hour...@dept_end_hour).to_a %>
      </ul>
      <%= render partial: "shifts/schedule/loc_group_row", collection: @loc_groups, locals: {day: day} %>
    </div>
  </div>

  <% unless @hidden_shifts.empty? %>
    <h3> Shifts outside of schedule:</h3>
    <ul class="hidden_shifts">
      <%= render partial: "shifts/schedule/hidden_shift", collection: @hidden_shifts %>
    </ul>
  <% end %>
</div>