aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/routes/show.html.slim
blob: 329be4b5f8952dba00a8e82e75be19051de57b48 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
- breadcrumb :route, @referential, @route
/ PageHeader
= pageheader 'itineraire',
        t('routes.index.title', route: @route.name),
             '',
             t('last_update', time: l(@route.updated_at, format: :short)),
             (policy(@route).edit? ? link_to(t('actions.edit'), edit_referential_line_route_path(@referential, @line, @route), class: 'btn btn-default') : '') do

  / Below is secundary actions & optional contents (filters, ...)
  .row.mb-sm
    .col-lg-12.text-right
      - @route.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'),
          { t('objectid') => @route.get_objectid.short_id,
            t('activerecord.attributes.route.published_name') => (@route.published_name ? @route.published_name : '-'),
            @route.human_attribute_name(:wayback) => (@route.wayback ? @route.wayback_text : '-' ),
            @route.human_attribute_name(:opposite_route) => (@route.opposite_route ? @route.opposite_route.name : '-') }

      - if @route_sp.any?
        .col-lg-6.col-md-6.col-sm-12.col-xs-12
          #route_map.map.mb-lg

    .row
      .col-lg-12
        .h3 = t('routes.show.stop_areas.title')
        - if @route_sp.any?
          = table_builder_2 @route_sp,
            [ \
              TableBuilderHelper::Column.new( \
                name: 'ID Reflex', \
                attribute: Proc.new { |s| s.try(:stop_area).try(:user_objectid) } \
              ), \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: Proc.new {|s| s.try(:stop_area).try(:name)}, \
                link_to: lambda do |stop_point| \
                  referential_stop_area_path(@referential, stop_point.stop_area) \
                end \
              ), \
              TableBuilderHelper::Column.new( \
                key: :deleted_at, \
                attribute: Proc.new { |s| line_status(s.try(:stop_area).deleted_at) } \
              ), \
              TableBuilderHelper::Column.new( \
                key: :zip_code, \
                attribute: Proc.new { |s| s.try(:stop_area).try(:zip_code) } \
              ), \
              TableBuilderHelper::Column.new( \
                key: :city_name, \
                attribute: Proc.new { |s| s.try(:stop_area).try(:city_name) } \
              ), \
              TableBuilderHelper::Column.new( \
                key: :for_boarding, \
                attribute: Proc.new { |s| t("stop_points.stop_point.for_boarding.#{s.for_boarding}") } \
              ), \
              TableBuilderHelper::Column.new( \
                key: :for_alighting, \
                attribute: Proc.new { |s| t("stop_points.stop_point.for_alighting.#{s.for_alighting}") } \
              ) \
            ],
            links: [:show],
            sortable: false,
            cls: 'table has-stoppoints'

        - else
          = replacement_msg t('stop_areas.search_no_results')

= javascript_tag do
  | window.route = "#{URI.escape(route_json_for_edit(@route))}"

= javascript_pack_tag 'routes/show.js'