diff options
| author | Zog | 2018-05-02 12:12:18 +0200 |
|---|---|---|
| committer | Zog | 2018-05-07 15:03:07 +0200 |
| commit | fac03f56f2e84705cd30fc31d8007cc64f77d500 (patch) | |
| tree | 6a66c78b39081d1e5e95467fdc28c23e4dceef77 | |
| parent | d041b6b07cc2b9c2b48e6da929c8d7f1e0ec8bca (diff) | |
| download | chouette-core-fac03f56f2e84705cd30fc31d8007cc64f77d500.tar.bz2 | |
Add GTFS views
| -rw-r--r-- | app/views/imports/import/_gtf.html.slim | 42 | ||||
| -rw-r--r-- | app/views/imports/import/_workbench.html.slim | 6 | ||||
| -rw-r--r-- | config/locales/import_messages.fr.yml | 2 |
3 files changed, 46 insertions, 4 deletions
diff --git a/app/views/imports/import/_gtf.html.slim b/app/views/imports/import/_gtf.html.slim new file mode 100644 index 000000000..8b92f2e92 --- /dev/null +++ b/app/views/imports/import/_gtf.html.slim @@ -0,0 +1,42 @@ +.row + .col-lg-6.col-md-6.col-sm-12.col-xs-12 + - metadata = { t('.parent') => link_to(@import.parent.name, [@import.parent.workbench, @import.parent]) } + - metadata = metadata.update({t('.status') => import_status(@import.status, verbose: true) }) + - metadata = metadata.update({t('.referential') => @import.referential ? link_to(@import.referential.name, [@import.referential]) : "-" }) + = definition_list t('metadatas'), metadata + +.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('.referential_name'), \ + attribute: 'name', \ + sortable: false, \ + link_to: lambda do |item| \ + referential_path(item.referential) if item.referential.present? \ + end \ + ), \ + TableBuilderHelper::Column.new( \ + key: :status, \ + attribute: Proc.new { |n| import_status(n.status, verbose: true, default_status: :pending) }, \ + sortable: false, \ + link_to: lambda do |item| \ + item.netex_import.present? ? [@import.workbench, item.netex_import] : [@import.workbench, @import, item] \ + end \ + )\ + ], + cls: 'table', + overhead: [ \ + {}, \ + {}, \ + { \ + title: I18n.t('imports.show.summary').html_safe, \ + width: controls.size, \ + cls: 'overheaded-default colspan="2"' \ + } \ + ] diff --git a/app/views/imports/import/_workbench.html.slim b/app/views/imports/import/_workbench.html.slim index 4dcf949b0..17341913c 100644 --- a/app/views/imports/import/_workbench.html.slim +++ b/app/views/imports/import/_workbench.html.slim @@ -54,9 +54,9 @@ ruby: overhead: [ \ {}, \ {}, \ - { \ + controls.present? ? { \ title: I18n.t('imports.show.summary').html_safe, \ width: controls.size, \ cls: 'overheaded-default colspan="2"' \ - } \ - ] + } : nil \ + ].compact diff --git a/config/locales/import_messages.fr.yml b/config/locales/import_messages.fr.yml index e76ad7381..e61980e36 100644 --- a/config/locales/import_messages.fr.yml +++ b/config/locales/import_messages.fr.yml @@ -16,7 +16,7 @@ fr: routes: imported: "%{count} itinéraire(s) importé(s)" trips: - imported: "%{count} course(s) importé(s)" + imported: "%{count} course(s) importée(s)" calendars: imported: "%{count} calendrier(s) importé(s)" 1_netexstif_2: "Le fichier %{source_filename} ne respecte pas la syntaxe XML ou la XSD NeTEx : erreur '%{error_value}' rencontré" |
