af83/chouette-core

View on GitHub
app/views/imports/_gtfs.html.slim

Summary

Maintainability
Test Coverage
- breadcrumb :gtfs_import, @parent, @import

.row
  .col-lg-6.col-md-6.col-sm-12.col-xs-12
    = render 'metadatas', import: @import
  = processing_helper(@import)

.col-lg-12
  .error_messages
    = render 'shared/iev_interfaces/messages', messages: @import.main_resource.messages

- if @import.resources.any?
  .col-lg-12
    = table_builder_2 @import.resources,
      [ \
        TableBuilderHelper::Column.new( \
          name: t('imports.show.gtfs.filename'), \
          attribute: :name ,\
          sortable: false \
        ), \
        TableBuilderHelper::Column.new( \
          key: :status, \
          attribute: Proc.new { |n| operation_status(n.status, verbose: true, default_status: :pending) }, \
          sortable: false \
        ),\
        TableBuilderHelper::Column.new( \
          name: t('imports.show.table.test_results') , \
          attribute: Proc.new { |n| I18n.t('import_resources.index.metrics', n.metrics.deep_symbolize_keys) }, \
          sortable: false, \
        ), \
        TableBuilderHelper::Column.new( \
          name: t('imports.show.table.download') , \
          attribute: Proc.new { |n| '<i class="fa fa-download" aria-hidden="true"></i>'.html_safe }, \
          sortable: false, \
          link_to: lambda do |import_resource| \
            url_for([@parent, import_resource.import, import_resource, :import_messages, format: 'csv']) \
          end \
        ), \
      ],
      cls: 'table'