aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/time_tables/show.html.slim
blob: f596fd480682cee8a44a8af6d647dc6970a44ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- require 'calendar_helper'

/ PageHeader
= pageheader 'map-marker',
             @time_table.comment,
             '',
             t('last_update', time: l(@time_table.updated_at, format: :short)),
             (policy(@time_table).edit? ? link_to(t('actions.edit'), edit_referential_time_table_path(@referential, @time_table), class: 'btn btn-default') : '')

  / Below is secundary actions & optional contents (filters, ...)
  .row.mb-sm
    .col-lg-12.text-right
      - @time_table.action_links.each do |link|
        = link_to link.href,
            method: link.method,
            data: link.data,
            class: 'btn btn-primary' do
              = link.content

/ PageContent
.page_content
  .container-fluid
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = definition_list t('metadatas'),
          { "Période d'application" => (@time_table.bounding_dates.empty? ? '-' : t('bounding_dates', debut: l(@time_table.bounding_dates.min), end: l(@time_table.bounding_dates.max))),
            'Couleur associée' => (@time_table.color.nil? ? '-' : content_tag(:span, '', class: 'fa fa-circle', style: "color:#{@time_table.try(:color)}")),
            'Etiquettes' => @time_table.tag_list,
            'Modèle de calendrier' => (@time_table.calendar ? link_to(@time_table.calendar.name, @time_table.calendar) : '-'),
            "Journées d'application pour les périodes ci-dessous" => %w(monday tuesday wednesday thursday friday saturday sunday).collect{ |d| content_tag(:span, t("calendars.days.#{d}"), class: "label label-default #{@time_table.send(d) ? '' : 'disabled'}") }.join.html_safe }

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

    = render 'show_time_table'