aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/referential_lines/index.html.slim
blob: d9558b246abb2b15f18d97cb5c523485f53e623c (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
= title_tag t('lines.index.title')

= search_form_for @q, url: referential_lines_path(@referential), remote: true, html: { method: :get, class: 'form-inline', id: 'search', role: 'form' } do |f|
  .panel.panel-default
    .panel-heading
      .input-group.col-lg-9.col-md-9
        = f.search_field :name_or_number_cont, placeholder: "#{t('.name_or_number')}", class: 'form-control'
        .input-group-btn
          button.btn.btn-primary type="submit"
            i.fa.fa-search

      a data-toggle="collapse" data-parent="#search" href="#advanced_search"
        i.fa.fa-plus
        = " #{t('.advanced_search')}"

    #advanced_search.panel-collapse.collapse
      .panel-body
        .row
          - %w(networks companies group_of_lines).each do |filter|
            - if @referential.send(filter).any?
              .col-lg-4.col-md-4.col-sm-4.col-xs-4
                = f.select(:"#{filter.singularize unless filter == 'group_of_lines'}_id_eq", @referential.send(filter).collect { |f| [f.name, f.id] }.unshift([t(".no_#{filter}"), -1]), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t(".all_#{filter}") })

#lines
  = render 'lines'

- content_for :sidebar do
  ul.actions
    - if policy(Chouette::Line).create?
      li
        = link_to t('lines.actions.new'), new_referential_line_path(@referential), class: 'add'

  - if policy(Chouette::Line).destroy?
    #multiple_selection_menu
      h4> = t(".multi_selection")

      .disabled
        a.enable href="#"
          = t(".multi_selection_enable")

      .enabled style="display: none;"
        a.disable href="#"
          = t(".multi_selection_disable")

        ul.actions
          = link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove", "confirmation-text" => t("lines.actions.destroy_selection_confirm")

      a.select_all href="#"
        = t(".select_all")
      = " | "
      a.deselect_all href="#"
        = t(".deselect_all")