af83/chouette-core

View on GitHub
app/views/calendars/show.html.slim

Summary

Maintainability
Test Coverage
- breadcrumb :calendar, @workbench, @calendar
- page_header_content_for @calendar

.page_content
  .container-fluid
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = simple_block_for @calendar, title: t('calendar.form.sections.informations') do |d|
          = d.attribute :shared, as: :boolean
          = d.attribute :organisation, value: @calendar.organisation.name
          = d.attribute :dates, as: :associations, value: @calendar.dates.collect{|d| l(d)}.join(', ').html_safe
          = d.attribute :date_ranges, as: :associations, value: resource.periods.map{|d| t('validity_range', debut: l(d.begin), end: l(d.end))}.join('<br>').html_safe

    .row
      .col-lg-12.mb-sm
        .pagination.pull-right
          = @year
          .page_links
            = link_to '', workbench_calendar_path(@workbench, @calendar, year: (@year - 1)), class: 'previous_page'
            = link_to '', workbench_calendar_path(@workbench, @calendar, year: (@year + 1)), class: 'next_page'

    = render 'time_tables/show_time_table', time_table: @calendar, edit_url: [:edit, @workbench, @calendar], disabled: !resource_policy.update?