%h1 L'agenda du Pic Vert -first_month = @start_list_date.beginning_of_month -last_month = @end_list_date.beginning_of_month -the_month = first_month -while the_month <= last_month %h2{:class => "month_title"}=l(the_month.to_date, :format => :month_and_year) .month_content =render :partial => "public/events/event", :collection =>Event.where('(start_at <= ? AND start_at >= ?) OR (stop_at <= ? AND stop_at >= ?)',the_month.end_of_month, the_month.beginning_of_month,the_month.end_of_month, the_month.beginning_of_month).order(:start_at) -the_month = the_month.next_month -content_for :sidebar do %h2{:class => "month_title"} Agenda par mois %ul -first_month = Event.order(:start_at).first.start_at.beginning_of_month -last_month = Event.order(:start_at).last.start_at.beginning_of_month -the_month = last_month -while the_month >= first_month %li=link_to l(the_month.to_date, :format => :month_and_year), public_events_path(:year => the_month.year, :month => the_month.month) -the_month = the_month.last_month