- breadcrumb @workbench - page_header_content_for @workbench - content_for :page_header_content do .row.mb-sm .col-lg-12.text-right - if policy(Workbench).update? = link_to t('workbenches.actions.configure'), edit_workbench_path(@workbench), class: 'btn btn-primary' - if policy(Referential).create? = link_to t('actions.import'), workbench_imports_path(@workbench), class: 'btn btn-primary' unless @workbench.workgroup.import_types.empty? = link_to t('actions.export'), workbench_exports_path(@workbench), class: 'btn btn-primary' unless @workbench.workgroup.export_types.empty? = link_to t('actions.add'), new_workbench_referential_path(@workbench), class: 'btn btn-primary' = link_to t('workbenches.actions.show_output'), workbench_output_path(@workbench), class: 'btn btn-primary' .page_content .container-fluid - if params[:q].present? or @wbench_refs.any? .row .col-lg-12 = render 'filters' - if @wbench_refs.any? .row .col-lg-12 .select_table = table_builder_2 @wbench_refs, [ \ TableBuilderHelper::Column.new( \ key: :name, \ attribute: 'name', \ link_to: lambda do |referential| \ referential_path(referential) \ end \ ), \ TableBuilderHelper::Column.new( \ key: :archived_at, \ name: Referential.tmf('status'), \ attribute: Proc.new {|w| "#{icon_for_referential_state(w.state)}".html_safe} \ ), \ TableBuilderHelper::Column.new( \ key: :organisation, \ attribute: Proc.new {|w| w.organisation.name} \ ), \ TableBuilderHelper::Column.new( \ key: :validity_period, \ attribute: Proc.new {|w| w.validity_period.nil? ? '-' : t('validity_range', debut: l(w.try(:validity_period).try(:begin), format: :short), end: l(w.try(:validity_period).try(:end), format: :short))} \ ), \ TableBuilderHelper::Column.new( \ key: :lines, \ name: Referential.tmf('number_of_lines'), \ attribute: Proc.new {|w| w.lines.count} \ ), \ TableBuilderHelper::Column.new( \ key: :created_at, \ attribute: Proc.new {|w| l(w.created_at, format: :short)} \ ), \ TableBuilderHelper::Column.new( \ key: :updated_at, \ attribute: Proc.new {|w| l(w.updated_at, format: :short)} \ ), \ TableBuilderHelper::Column.new( \ key: :merged_at, \ attribute: Proc.new {|w| w.merged_at ? l(w.merged_at, format: :short) : '-'} \ ) \ ], selectable: ->(ref) { \ @workbench.referentials.include?(ref) && \ !ref.pending? \ }, cls: 'table has-filter has-search', action: :index = multiple_selection_toolbox([:delete], collection_name: 'referentials') = new_pagination @wbench_refs, 'pull-right' - unless @wbench_refs.any? .row.mt-xs .col-lg-12 = replacement_msg t('referentials.search_no_results') = javascript_tag do // | window.I18n = #{(I18n.backend.send(:translations).to_json).html_safe}; = javascript_pack_tag 'date_filters'