af83/chouette-core

View on GitHub
app/views/document_providers/index.html.slim

Summary

Maintainability
Test Coverage
- breadcrumb :document_providers, @workbench

.page_content
  .container-fluid
    - if params[:q].present? or @document_providers.any?
      .row
        .col-lg-12

    - if @document_providers.any?
      .row
        .col-lg-12
          = table_builder_2 @document_providers,
            [ \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: :name, \
                sortable: false, \
                link_to: lambda do |document_provider| \
                workbench_document_provider_path( \
                    @workbench, \
                    document_provider \
                  ) \
                end \
              ), \
              TableBuilderHelper::Column.new( \
                key: :short_name, \
                attribute: :short_name, \
                sortable: false, \
              ), \
              TableBuilderHelper::Column.new( \
                key: :documents, \
                attribute: Proc.new { |document_provider| document_provider.documents.count }, \
                sortable: false \
              ), \
              TableBuilderHelper::Column.new( \
                key: :workbench, \
                attribute: Proc.new { |document_provider| document_provider.workbench.name }, \
              ), \
              \
            ].compact,
            cls: 'table has-filter has-search'

          = new_pagination @document_providers, 'pull-right'

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