<ul>
  <% if @can[:edit] && EasyAttendanceActivity.sorted.any? %>
    <li class="folder">
      <%= link_to_function(l(:label, :scope => [:easy_attendance, :activities, :enumerations]), :class => 'submenu') -%>
      <ul>
        <% EasyAttendanceActivity.sorted.each do |activity| %>
          <li>
            <%= context_menu_link(activity.name, {:controller => 'easy_attendances', :action => 'bulk_update', :ids => params[:ids], :tab => params[:tab], :easy_attendance => {:easy_attendance_activity_id => activity.id} },
              :method => :put,
              :selected =>  (@easy_attendances.count == 1 && activity.id == @easy_attendances.first.easy_attendance_activity_id)) -%>
          </li>
        <% end %>
      </ul>
    </li>
  <% end %>

  <% if @approval_menu.present? %>
    <li class="folder">
      <%= link_to_function(@approval_menu[:title], :class => 'submenu') -%>
      <ul>
        <% @approval_menu[:actions].each do |approve, title| %>
          <li>
            <%= context_menu_link(title, approval_easy_attendances_path({:ids => params[:ids], :approve => approve}), :remote => true) -%>
          </li>
        <% end %>
      </ul>
    </li>
  <% end -%>

  <%= content_tag(:li, context_menu_link(@cancel_link_text, {:controller => 'easy_attendances', :action => 'bulk_cancel', :ids => params[:ids], :tab => params[:tab]},
    :class => 'icon icon-cancel',
    :method => :post,
    :data => {:confirm => l(:text_are_you_sure)})) if @can[:request_cancel] -%>
  <%= content_tag(:li, context_menu_link(l(:button_delete), {:controller => 'easy_attendances', :action => 'bulk_destroy', :ids => params[:ids], :tab => params[:tab]},
    :class => 'icon icon-del',
    :method => :delete,
    :data => {:confirm => l(:text_are_you_sure)})) if @can[:destroy] -%>
</ul>
