<% extend EventPlugin::EventBlockHelper %>
<%= block_title(block.title, block.subtitle) %>
<% if block.display_as_calendar %>
<%= javascript_include_tag 'plugins/event/jquery.e-calendar' %>
<% else %>
<% block.events(user).map do |event| %>
<% days_left = ( (event.start_date - DateTime.now)/60/60/24 ).round %>
-
<%= render(
:file => 'event_plugin/event_block_item',
:locals => {
:event => event,
:block => block,
:time_class => days_left < 0 ? 'past' : 'future',
:time_left_str => human_time_left(days_left)
}
)
%>
<% end %>
<% end %>