- breadcrumb :time_tables, @referential .page_content .container-fluid .row .col-lg-12 = render 'filter' - if @time_tables.any? .row .col-lg-12 = table_builder_2 @time_tables, [ \ TableBuilderHelper::Column.new( \ name: 'ID', \ attribute: Proc.new { |n| n.get_objectid.short_id}, \ sortable: false \ ), \ 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: :comment, \ attribute: 'comment', \ link_to: lambda do |time_table| \ referential_time_table_path(@referential, time_table) \ end \ ), \ TableBuilderHelper::Column.new( \ key: :bounding_dates, \ name: "Période englobante", \ attribute: Proc.new { |tt| tt.object.bounding_dates.empty? ? '-' : t('bounding_dates', debut: l(tt.object.bounding_dates.min), end: l(tt.object.bounding_dates.max)) }, \ ), \ TableBuilderHelper::Column.new( \ key: :vehicle_journeys_count, \ name: "Nombre de courses associées", \ attribute: Proc.new{ |tt| tt.vehicle_journeys.count }, \ ), \ TableBuilderHelper::Column.new( \ name: "Journées d'application", \ attribute: Proc.new { |tt| (%w(monday tuesday wednesday thursday friday saturday sunday).collect{|d| tt.send(d) ? t("calendars.days.#{d}") : '' }).reject{|a| a.empty?}.join(', ').html_safe }, \ sortable: false \ ), \ TableBuilderHelper::Column.new( \ key: :calendar, \ attribute: Proc.new { |tt| tt.calendar ? tt.calendar.try(:name) : '-' } \ ), \ TableBuilderHelper::Column.new( \ key: :updated_at, \ attribute: Proc.new { |tt| l(tt.updated_at, format: :short) } \ ) \ ], cls: 'table has-search' = new_pagination @time_tables, 'pull-right' - unless @time_tables.any? .row.mt-xs .col-lg-12 = replacement_msg t('time_tables.search_no_results') = javascript_tag do // | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe}; = javascript_pack_tag 'date_filters'