You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
agenda-libre-ruby/app/views/simple_calendar/_month_calendar.html.haml

24 lines
824 B

%header.calendar-header
- if params[:year]
= link_to start_date: start_date.beginning_of_month do
= I18n.t('date.month_names')[start_date.month]
= start_date.year
- else
= link_to '<<', start_date: (date_range.first - 1.day).beginning_of_month
= I18n.t('date.month_names')[start_date.month]
= link_to root_path(year: start_date.year) do
= start_date.year
= link_to '>>', start_date: (date_range.last + 1.day).beginning_of_month
%table.table.table-striped
%thead
%tr
- date_range.slice(0, 7).each do |day|
%th= I18n.t('date.day_names')[day.wday]
%tbody
- date_range.each_slice(7) do |week|
%tr
- week.each do |day|
= content_tag :td, class: calendar.td_classes_for(day) do
= block.call day, sorted_events.fetch(day, [])