af83/chouette-core

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

Summary

Maintainability
Test Coverage
- breadcrumb :sources, @workbench

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

    - if @sources.any?
      .row
        .col-lg-12
          = table_builder_2 @sources,
            [ \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: :name, \
                sortable: false, \
                link_to: lambda do |source| \
                workbench_source_path( \
                    @workbench, \
                    source \
                  ) \
                end \
              ), \
              TableBuilderHelper::Column.new( \
                key: :url, \
                attribute: Proc.new { |n| n.displayed_url }, \
                sortable: false \
              ), \
              TableBuilderHelper::Column.new( \
                key: :updated_at, \
                attribute: Proc.new { |n| l(n.updated_at, format: :short_with_time) if n.updated_at }, \
                sortable: false,\
              ) \
              \
            ].compact,
            cls: 'table has-filter has-search'

          = new_pagination @sources, 'pull-right'

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