af83/chouette-core

View on GitHub
app/views/workgroups/show.html.slim

Summary

Maintainability
Test Coverage
- breadcrumb @workgroup, true
- page_header_content_for @workgroup

.page_content
  .container-fluid
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = definition_list t('metadatas'),
          { Workgroup.tmf(:owner) => @workgroup.owner.name,
            Workgroup.tmf(:description) => @workgroup.description || "-",
            Workgroup.tmf(:workbenches) => @workgroup.workbenches.count,
            Workgroup.tmf(:created_at) => l(@workgroup.created_at, format: :short_with_time),
            Workgroup.tmf(:updated_at) => l(@workgroup.updated_at, format: :short_with_time)}
    .row
      .col-lg-12
        - if @workbenches.empty?
          = replacement_msg t('workbenches.search_no_results')
        - else
          .definition-list
            .dl-head
              = Workbench.t.capitalize
          = table_builder_2 @workbenches,
            [ \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: 'name', \
                link_to: ->(workbench){ [@workgroup, workbench] } \
                ), \
              TableBuilderHelper::Column.new( \
                key: :organisation, \
                attribute: Proc.new { |workbench| workbench&.organisation&.name || '-' }, \
              ), \
              TableBuilderHelper::Column.new( \
                key: :last_merged_data, \
                attribute: Proc.new { |workbench| workbench.last_merged_data.presence ? l(workbench.last_merged_data, format: :short_with_time) : '-' }, \
              ), \
            ],
            cls: 'table',
            action: :index
          = new_pagination @workbenches, 'pull-right'