<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %> <%= t('date.month_names')[start_date.month] %> <%= start_date.year %> <%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
<% if calendar.orientation == :vertical %>
<% date_range.slice(0, 7).each do |day| %>
<%= t('date.abbr_day_names')[day.wday] %> <%= day %>
<%= content_tag :div, class: calendar.td_classes_for(day) do %>
<% if calendar.display_grid %>
<% if calendar.display_bucket_title %>
<% end %> <% (0..23).each do |hour| %>
<%=hour%>
<% end %>
<% end %> <% events = sorted_events.fetch(day, []) %> <% buckets = calendar.split_into_buckets(events) %>
<% buckets.each do |bucket| %>
<% if calendar.display_bucket_title %>
<%= bucket&.first&.send calendar.display_bucket_title %>
<% end %>
<% events_size = calendar.slot_events(bucket, day) %> <% bucket.each do |event| %>
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %> <% capture_haml(event, &passed_block) %> <% else %> <% passed_block.call event %> <% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% elsif calendar.orientation == :horizontal %>
<% date_range.slice(0, 7).each do |day| %>
<%= t('date.abbr_day_names')[day.wday] %> <%= day %>
<%= content_tag :div, class: calendar.td_classes_for(day) do %>
<% if calendar.display_grid %>
<% if calendar.display_bucket_title %>
<% end %> <% (0..23).each do |hour| %>
<%=hour%>
<% end %>
<% end %> <% events = sorted_events.fetch(day, []) %> <% buckets = calendar.split_into_buckets(events) %>
<% buckets.each do |bucket| %>
<% if calendar.display_bucket_title %>
<%= bucket&.first&.send calendar.display_bucket_title %>
<% end %>
<% events_size = calendar.slot_events(bucket, day) %> <% bucket.each do |event| %>
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %> <% capture_haml(event, &passed_block) %> <% else %> <% passed_block.call event %> <% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% else %>
Unsupported orientation: <%= calendar.orientation %>
<% end %>