<% ids = [] %>
<% start_date = nil %>

<p>
  <%= l(:'easy_attendance.approved_by')+' : '+@approved_by.to_s %>
</p>

<table style='border: 1px solid black;border-spacing: 0px;'>
  <thead>
    <tr style='border: 1px solid black;'>
      <th style='border: 1px solid black;'><%= l(:label_date_from) %></th>
      <th style='border: 1px solid black;'><%= l(:label_date_to) %></th>
      <th style='border: 1px solid black;'><%= l(:field_user) %></th>
      <th style='border: 1px solid black;'><%= l(:field_easy_attendance_activity) %></th>
      <th style='border: 1px solid black;'><%= l(:field_status) %></th>
    </tr>
  </thead>
  <tbody>
    <% @easy_attendances.each do |activity, attendances| %>
      <% start_date ||= attendances.first.arrival %>
      <%= render :partial => 'approval_list', :collection => attendances, :as => 'easy_attendance' %>
      <% ids.concat(attendances.collect(&:id)) %>
    <% end %>
  </tbody>
</table>

<br />

<%= textilizable(@notes, :only_path => false) if @notes %>

<p>
  <%= link_to l(:'easy_attendance.attendance_overview'), easy_attendances_url(:start_date => start_date.try(:to_date).to_s) %>
</p>