<% g_uuid = EasyUtils::UUID.generate -%>
<% user_name = i.user ? i.user.name : '' %>
<div id="<%= "el-#{g_uuid}" -%>" class="easy-attendance-calendar-item" data-can-edit="<%= i.can_edit? %>">
  <%= format_time(i.arrival, false) if i.arrival && i.start_date(User.current) == day -%> - <%= format_time(i.departure, false) if i.departure && i.due_date(User.current) == day -%>
  <%= content_tag(:em, i.easy_attendance_activity.name) -%>
  <br/>
  <% if i.can_edit? %>
    <%= link_to(user_name, edit_easy_attendance_path(i, back_url: original_url), :remote => true, :class => 'easy-attendance-calendar-item-link-to-edit') -%>
  <% else %>
    <%= content_tag(:a, user_name, :href => '#') %>
  <% end %>
</div>
<div id="tooltip-<%= g_uuid -%>" style="display:none;" class="tooltip">
  <%= render :partial => 'easy_attendances/info', :locals => {:easy_attendance => i, :day => day} -%>
</div>
<script>
EASY.scheduledTasks.scheduledEarly.push(function(){
  var uuid = '<%= g_uuid %>';
  new easyClasses.EasyTooltip($('#tooltip-'+uuid).html(), $('#el-' + uuid), 0, -30);
});
</script>
