af83/chouette-core

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

Summary

Maintainability
Test Coverage
- breadcrumb :companies, @workbench

.page_content
  .container-fluid
    .row
      .col-lg-12
        = render 'filters'

    - if @companies.any?
      .row
        .col-lg-12
          = table_builder_2 @companies,
            [ \
              TableBuilderHelper::Column.new( \
                name: 'ID', \
                attribute: Proc.new { |n| n.try(:get_objectid).try(:short_id) }, \
                sortable: false \
              ), \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: 'name', \
                link_to: lambda do |company| \
                  workbench_line_referential_company_path(@workbench, company) \
                end \
              ), \
            ],
            cls: 'table has-search'

          = new_pagination @companies, 'pull-right'

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