af83/chouette-core

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

Summary

Maintainability
Test Coverage
- breadcrumb :publication_apis, @workgroup
- content_for :page_header_content do
  .row.mb-sm
    .col-lg-12.text-right
      - if parent_policy.create?(PublicationApi)
        = link_to t('publication_apis.actions.create'), new_workgroup_publication_api_path(@workgroup), class: 'btn btn-primary'

.page_content
  .container-fluid

    - if @publication_apis.any?
      .row
        .col-lg-12
          = table_builder_2 @publication_apis,
            [ \
              TableBuilderHelper::Column.new( \
                key: :name, \
                attribute: 'name', \
                link_to: lambda do |publication_api| \
                  [@workgroup, publication_api] \
                end \
              ), \
              TableBuilderHelper::Column.new( \
                key: :slug, \
                attribute: 'slug', \
                link_to: lambda do |publication_api| \
                  [@workgroup, publication_api] \
                end \
              ), \
            ],
            cls: 'table has-filter'

          = new_pagination @publication_apis, 'pull-right'

    - else
      .row.mt-xs
        .col-lg-12
          = replacement_msg t('publication_apis.search_no_results')