af83/chouette-core

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

Summary

Maintainability
Test Coverage
- breadcrumb :shapes, @workbench
- content_for(:page_header_title) { 'shapes.index.title'.t }
- javascript_additional_packs 'shapes/index'

.page_content
  .container-fluid
    .row
      .col-md-6.col-sm-12
        .row
          h4.underline= t('activerecord.models.shape.other').capitalize
        .row
          = render 'filters'
        - if @shapes.any?
          .row
            = table_builder_2 @shapes,
              [ \
                TableBuilderHelper::Column.new( \
                  name: 'ID', \
                  attribute: 'uuid', \
                  sortable: false \
                ), \
                TableBuilderHelper::Column.new( \
                  key: :name, \
                  attribute: Proc.new {|item| item.name.presence || I18n.t('none') }, \
                  link_to: lambda do |shape| \
                    workbench_shape_referential_shape_path(@workbench, shape) \
                  end \
                ) \
              ],
              cls: 'table has-search',
              action: :index

            = new_pagination @shapes, 'pull-right'

        - else
          .row.mt-xs
            = replacement_msg t('shapes.filters.no_results')

      .col-md-6.col-sm-12
        h4.underline= t('lines.show.map')
        #route_map.large_map.mb-lg