<%= link_to_next_admin_calendar_month(@calendar_date, :class => "btn") %>

<%= link_to_previous_admin_calendar_month(@calendar_date, :class => "btn") %>

<%= build_calendar_for @calendar_events, :year => @calendar_date.year, :month => @calendar_date.month do |t| %> <%= raw t.head('S', 'M', 'T', 'W', 'T', 'F', 'S') %> <%= t.day do |day, tasks| %>
<%= content_tag :span, day.day, :class => (tasks.count > 0 ? "spud_events_admin_calendar_date spud_events_admin_calendar_date_active" : "spud_events_admin_calendar_date") %> <% tasks.each do |task| %> <%= link_to task.title[0,25], edit_spud_admin_calendar_event_path(task.id), :class => "spud_events_admin_calendar_event_marker spud_events_calendar_event_#{task.spud_calendar_id}", :style => "background-color: \##{task.spud_calendar.color}; color:\##{calendar_fore_color(task.spud_calendar.color)}" %> <% end %>
<% end %> <% end %>