YaleSTC/shifts

View on GitHub
app/views/time_slots/_time_slot.html.erb

Summary

Maintainability
Test Coverage
<li id="timeslot<%=time_slot.id%>" style="<%=time_slot_style(time_slot, time_slot_day)%>" class="click_to_edit_timeslot timeslot">
  <div class="time-slot">
    <% if @right_overflow or @left_overflow %>
      <%= image_tag "overflow_arrow_right.png", {class: "right_arrow", alt: "right arrow", height: 17 } if @right_overflow %>
      <%= image_tag "overflow_arrow_left.png",  {class: "left_arrow",  alt: "left arrow",  height: 17 } if @left_overflow %>
    <% end %>
    <div class="center_container">
      <div class="center_content">
        <% unless time_slot.repeating_event %>
          <%= link_to "x", time_slot, confirm: 'Are you sure?', method: :delete, remote: true, style: "float:right;margin-right:5px", class: 'delete_link' %>
        <% else %>
          <%= link_to "x", edit_time_slot_path(time_slot, delete_options: true) %>
        <% end %>
        <%= link_to "#{time_slot.start.strftime("%l:%M%p")} - #{time_slot.end.strftime("%l:%M%p")}", edit_time_slot_path(time_slot) %>
      </div>
    </div>
  </div>
</li>