af83/chouette-core

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

Summary

Maintainability
Test Coverage
- breadcrumb :referential_line, @workbench, @referential, @line
- page_header_content_for @line
- javascript_additional_packs 'referential_lines/show'

.page_content
  .container-fluid
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = simple_block_for @line, title: t("lines.form.sections.identification") do |d|
          = d.attribute :objectid, value: @line.get_objectid.short_id
          = d.attribute :name
          = d.attribute :published_name
          = d.attribute :number
          = d.attribute :transport_mode, as: :enumerize
          = d.attribute :transport_submode, as: :enumerize
          = d.attribute :flexible_service, as: :boolean
          = d.attribute :seasonal, as: :boolean
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        h4.underline= t('lines.show.map')
        #routes_map.map.mb-lg
    .row
      .col-lg-12
        .h3 = t('lines.show.routes.title')
        .row
          .col-lg-12
            = render 'filters'

        - if @routes.any?
          .row
            .col-lg-12
              = table_builder_2 @routes,
                [ \
                  TableBuilderHelper::Column.new( \
                    name: 'ID', \
                    attribute: Proc.new { |n| n.get_objectid.short_id }, \
                    sortable: false \
                  ), \
                  TableBuilderHelper::Column.new( \
                    key: :name, \
                    attribute: 'name', \
                    link_to: lambda do |route| \
                      workbench_referential_line_route_path(@workbench, @referential, @line, route) \
                    end \
                  ), \
                  TableBuilderHelper::Column.new( \
                    key: :published_name, \
                    attribute: 'published_name' \
                  ), \
                  TableBuilderHelper::Column.new( \
                    key: :wayback, \
                    attribute: 'wayback_text' \
                  ), \
                  TableBuilderHelper::Column.new( \
                    name: Chouette::Route.tmf('stop_area_departure'), \
                    attribute: Proc.new { |r| r.try(:stop_points).first.try(:stop_area).try(:name) }, \
                    sortable: false \
                  ), \
                  TableBuilderHelper::Column.new( \
                    name: Chouette::Route.tmf('stop_area_arrival'), \
                    attribute: Proc.new{ |r| r.try(:stop_points).last.try(:stop_area).try(:name) }, \
                    sortable: false \
                  ), \
                  TableBuilderHelper::Column.new( \
                    key: :stop_points, \
                    attribute: Proc.new{ |r| r.try(:stop_points).count }, \
                    sortable: false \
                  ), \
                  TableBuilderHelper::Column.new( \
                    key: :journey_patterns, \
                    attribute: Proc.new{ |r| r.try(:journey_patterns).count }, \
                    sortable: false \
                  ) \
                ],
                cls: 'table has-search',
                action: :index

              = new_pagination @routes, 'pull-right'

        - unless @routes.any?
          .row.mt-xs
            .col-lg-12
              = replacement_msg t('routes.filters.no_results')