aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/lines/index.html.slim
blob: d7b6be5c8e5b63eb69484662643c6f27a87086ce (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
/ PageHeader
= pageheader 'map-marker',
             t('lines.index.title'),
             'Lorem ipsum dolor sit amet',
             '',
             ((policy(Chouette::Line).create? && @line_referential.organisations.include?(current_organisation)) ? link_to(t('lines.actions.new'), new_line_referential_line_path(@line_referential), class: 'btn btn-primary') : '')

/ PageContent
.page_content
  .container-fluid
    - if params[:q].present? or @lines.any?
      .row
        .col-lg-12
          = render 'filters'

    - if @lines.any?
      .row
        .col-lg-12
          = table_builder @lines,
            { 'Oid' => Proc.new { |n| n.objectid.local_id },
            :number => 'number',
            :name => 'name',
            :deactivated => Proc.new{|n| n.deactivated? ? t('false') : t('true')},
            'networks.name' => Proc.new { |n| n.try(:network).try(:name) },
            'companies.name' => Proc.new { |n| n.try(:company).try(:name) },
            :transport_mode => Proc.new { |n| n.transport_mode.nil? ? '-' :  t("enumerize.line.transport_mode.#{n.try(:transport_mode)}") },
            :transport_submode => Proc.new { |n| n.transport_submode.nil? ? '-' :  t("enumerize.line.transport_submode.#{n.try(:transport_submode)}") } },
            [:show, :delete],
            [],
            'table has-filter has-search'

          = new_pagination @lines, 'pull-right'

    - unless @lines.any?
      .row.mt-xs
        .col-lg-12
          = replacement_msg t('referential_lines.search_no_results')