aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/purchase_windows/index.html.slim
blob: 0dba8693532a32e4a856371189187d5c0a894b73 (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
- breadcrumb :purchase_windows, @referential

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

    - if @purchase_windows.any?
      .row
        .col-lg-12
          = table_builder_2 @purchase_windows,
            [ \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: 'name', \
                link_to: lambda do |purchase_window| \
                  referential_purchase_window_path(purchase_window.referential, purchase_window) \
                end \
              ), \
              TableBuilderHelper::Column.new( \
                key: :color, \
                attribute: Proc.new { |tt| tt.color ? content_tag(:span, '', class: 'fa fa-circle', style: "color:#{tt.color}") : '-' }\
              ), \
              TableBuilderHelper::Column.new( \
                key: :bounding_dates, \
                attribute: Proc.new {|w| w.bounding_dates.nil? ? '-' : t('validity_range', debut: l(w.bounding_dates.begin, format: :short), end: l(w.bounding_dates.end, format: :short))},  \
                sortable: false \
              ) \
            ],
            cls: 'table has-filter'

          = new_pagination @purchase_windows, 'pull-right'

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

= javascript_pack_tag 'date_filters'