pic_vert_app/app/views/public/events/index.html.haml
Nicolas Bally 6ac6f91d8f agenda
2015-10-21 15:06:43 +02:00

28 lines
909 B
Plaintext

%p
-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 stop_at > ?',the_month.next_month, the_month.beginning_of_month).order(:start_at)
-the_month = the_month.next_month
%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