aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/companies/index.html.slim
blob: dad905c606c4b584e56e421d747dff36fe49e573 (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
/ PageHeader
= pageheader 'transporteur',
             t('companies.index.title'),
             'Lorem ipsum dolor sit amet',
             '',
             (policy(Chouette::Company).create? ? link_to(t('companies.actions.new'), new_line_referential_company_path(@line_referential), class: 'btn btn-primary') : '')

/ PageContent
.page_content
  .container-fluid
    - if params[:q].present? or @companies.any?
      .row
        .col-lg-12
          = search_form_for @q, url: line_referential_companies_path(@line_referential), html: {method: :get}, class: 'form form-filter' do |f|
            .input-group.search_bar
              = f.search_field :name_or_objectid_cont, placeholder: t('.name_or_objectid'), class: 'form-control'

              span.input-group-btn
                button.btn.btn-default#search-btn type='submit'
                  span.fa.fa-search

    - if @companies.any?
      .row
        .col-lg-12
          = table_builder_2 @companies,
            [ \
              TableBuilderHelper::Column.new( \
                name: 'Oid', \
                attribute: Proc.new { |n| n.try(:objectid).try(:local_id) }, \
                sortable: false \
              ), \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: 'name', \
                link_to: lambda do |company| \
                  line_referential_company_path(current_referential, company) \
                end \
              ) \
            ],
            links: [:show, :edit],
            cls: 'table has-search'

          = new_pagination @companies, 'pull-right'

    - unless @companies.any?
      .row
        .col-lg-12
          = replacement_msg t('companies.search_no_results')