diff options
| -rw-r--r-- | app/helpers/stop_areas_helper.rb | 6 | ||||
| -rw-r--r-- | app/models/chouette/stop_area.rb | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.slim | 2 | ||||
| -rw-r--r-- | config/locales/stop_areas.en.yml | 3 | ||||
| -rw-r--r-- | config/locales/stop_areas.fr.yml | 5 | 
5 files changed, 14 insertions, 4 deletions
| diff --git a/app/helpers/stop_areas_helper.rb b/app/helpers/stop_areas_helper.rb index 1c9d974a1..032f68494 100644 --- a/app/helpers/stop_areas_helper.rb +++ b/app/helpers/stop_areas_helper.rb @@ -68,7 +68,11 @@ module StopAreasHelper    end    def stop_area_registration_number_value stop_area -    stop_area&.registration_number || stop_area&.stop_area_referential&.generate_registration_number +    stop_area&.registration_number +  end + +  def stop_area_registration_number_hint +    t "formtastic.hints.stop_area.registration_number"    end    def stop_area_status(stop_area) diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb index ccdff609f..5640c78b0 100644 --- a/app/models/chouette/stop_area.rb +++ b/app/models/chouette/stop_area.rb @@ -49,7 +49,7 @@ module Chouette      validate :registration_number_is_set      before_validation do -      self.registration_number ||= self.stop_area_referential.generate_registration_number +      self.registration_number = self.stop_area_referential.generate_registration_number unless self.registration_number.present?      end      def self.nullable_attributes diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim index 1cba88f94..20bdc289f 100644 --- a/app/views/stop_areas/_form.html.slim +++ b/app/views/stop_areas/_form.html.slim @@ -48,7 +48,7 @@            - if has_feature?(:stop_area_waiting_time)              = f.input :waiting_time, input_html: { min: 0 } -          = f.input :registration_number, required: stop_area_registration_number_is_required(f.object), :input_html => {title: stop_area_registration_number_title(f.object), value: stop_area_registration_number_value(f.object)} +          = f.input :registration_number, required: stop_area_registration_number_is_required(f.object), :input_html => {title: stop_area_registration_number_title(f.object), value: stop_area_registration_number_value(f.object)}, hint: stop_area_registration_number_hint            = f.input :fare_code            = f.input :nearest_topic_name, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")}            = f.input :comment, as: :text, :input_html => {:rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment")} diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index 37d39b76c..4dbeda6a9 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -205,6 +205,9 @@ en:            comment: "Maximum length = 255."            coordinates: "Coordinates are mandatory."            projection_xy: "x,y in secondary referential, dot for decimal separator" +    hints: +      stop_area: +        registration_number: Leave empty for automatic value.    referential_stop_areas:      <<: *en_stop_areas diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml index aee112be7..638011ad7 100644 --- a/config/locales/stop_areas.fr.yml +++ b/config/locales/stop_areas.fr.yml @@ -208,6 +208,9 @@ fr:            comment: "Longueur maximale = 255."            coordinates: "Les coordonnées sont obligatoires."            projection_xy: "x,y dans le référentiel secondaire, le séparateur de décimales est 'point'" - +    hints: +      stop_area: +        registration_number: Laisser blanc pour assigner une valeur automatiquement. +            referential_stop_areas:      <<: *fr_stop_areas | 
