<% shift = @shifts.select{|i| i.shift_date == day}.sort_by{|i| i.employee_nic.downcase.to_s}%> <% employee_working_without_shift = @employee_working_without_shifts.select{|i| i.shift_date.to_date == day} %> <%= link_to_remote (day.day.to_s + "
" + ManagerShift.for_department(@department).for_date(day).map{|i| i.employee_nic}.join(', ')), :url => edit_work_shift_path(:id => 1, :date => day.to_s, :view_type => @view_type, :empl_id => params[:empl_id]), :method => :get %> <% for time in [10, 11, 12, 14, 16, 18, 19, 20, 21] do %>
  • <%= time %>
  • <%= shift.select{|i| i.time_from.hour <= time && i.time_to.hour >= time if i.time_from && i.time_to}.count %>
  • <% end %>