Skip to content

Commit

Permalink
CHOUETTE-3200 Use display period to display from and to in export sho…
Browse files Browse the repository at this point in the history
…w page
  • Loading branch information
Luc committed Dec 4, 2023
1 parent 27a440a commit de7cf3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/decorators/export_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class ExportDecorator < AF83::Decorator
end

define_instance_method :display_period do
return I18n.t('enumerize.period.static_day_period') if from.present? && to.present?

duration.present? ? "#{I18n.t('enumerize.period.only_next_days')} : #{duration}" : I18n.t('enumerize.period.all_periods')
return "#{I18n.l(from, format: :default)} - #{I18n.l(to, format: :default)}" if from.present? && to.present?
return "#{I18n.t('enumerize.period.only_next_days')} : #{duration}" if duration.present?
I18n.t('enumerize.period.all_periods')
end

define_instance_method :display_profile do
Expand Down
2 changes: 0 additions & 2 deletions app/views/exports/_show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
- if @export.type != "Export::Netex"
= d.attribute :exported_lines, value_method: :display_selected_lines_to_export
= d.attribute :period, value_method: :display_period
= d.attribute :from, as: :date
= d.attribute :to, as: :date
- if @export.type == "Export::NetexGeneric"
= d.attribute :profile, value_method: :display_profile
- if @export.type == "Export::Gtfs"
Expand Down

0 comments on commit de7cf3a

Please sign in to comment.