af83/chouette-core

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

Summary

Maintainability
Test Coverage
= simple_block_for import, title: t('metadatas') do |b|
      - if import.is_a?(Import::Workbench)
        = b.attribute :filename, label: t('filename', scope: import.i18n_attribute_scope), value_method: :file_identifier
      = b.attribute :status, value: operation_status(import.status, verbose: true)
      - if import.referential
        = b.attribute :referential, value: link_to(import.referential.name, [@workbench, import.referential])
      - unless @workbench
        = b.attribute :workbench, label: Workbench.ts.capitalize, value: import.workbench.name
      - import.visible_options.map do |k, v|
        - if resource_policy.option?(k)
          - if k == 'line_provider_id'
            = b.attribute k, label: t(k, scope: import.i18n_attribute_scope), value_method: :line_provider, as: :association
          - elsif k == 'stop_area_provider_id'
            = b.attribute k, label: t(k, scope: import.i18n_attribute_scope), value_method: :stop_area_provider, as: :association
          - else
            = b.attribute k, label: t(k, scope: import.i18n_attribute_scope), value: display_option_value(import, k)