Sha256: 1e126973370299a120137bee612a2ad443ae723e9f7e422865c3aba97b3195f2

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

<div class="simple-calendar">
  <div class="calendar-heading">
    <span class="calendar-title">
      <%= t('simple_calendar.week', default: 'Week') %>
      <%= calendar.week_number %>
      <% if calendar.number_of_weeks > 1 %>
        - <%= calendar.end_week %>
      <% end %>
    </span>

    <nav>
      <%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
      <%= link_to t('simple_calendar.today', default: 'Today'), calendar.url_for_today_view %>
      <%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
    </nav>
  </div>

  <table class="table table-striped">
    <thead>
      <tr>
        <% date_range.slice(0, 7).each do |day| %>
          <th><%= t('date.abbr_day_names')[day.wday] %></th>
        <% end %>
      </tr>
    </thead>

    <tbody>
      <% date_range.each_slice(7) do |week| %>
        <tr>
          <% week.each do |day| %>
            <%= content_tag :td, class: calendar.td_classes_for(day) do %>
              <% instance_exec(day, calendar.sorted_events_for(day), &passed_block) %>
            <% end %>
          <% end %>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_calendar-3.0.4 app/views/simple_calendar/_week_calendar.html.erb
simple_calendar-3.0.3 app/views/simple_calendar/_week_calendar.html.erb
simple_calendar-3.0.2 app/views/simple_calendar/_week_calendar.html.erb
simple_calendar-3.0.1 app/views/simple_calendar/_week_calendar.html.erb
simple_calendar-3.0.0 app/views/simple_calendar/_week_calendar.html.erb