diff options
| -rw-r--r-- | app/models/chouette/stop_area.rb | 4 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.slim | 11 | 
2 files changed, 9 insertions, 6 deletions
| diff --git a/app/models/chouette/stop_area.rb b/app/models/chouette/stop_area.rb index cf2afbc73..bb8747faa 100644 --- a/app/models/chouette/stop_area.rb +++ b/app/models/chouette/stop_area.rb @@ -47,10 +47,6 @@ module Chouette      validate :parent_area_type_must_be_greater      validate :area_type_of_right_kind -    after_initialize do -      self.kind ||= :commercial -    end -      def self.nullable_attributes        [:registration_number, :street_name, :country_code, :fare_code,        :nearest_topic_name, :comment, :long_lat_type, :zip_code, :city_name, :url, :time_zone] diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim index 9897a27ac..bb1fbe1e9 100644 --- a/app/views/stop_areas/_form.html.slim +++ b/app/views/stop_areas/_form.html.slim @@ -12,8 +12,15 @@              .col-sm-9.col-xs-7                - f.object.localized_names.each do |k, v|                  .col-md-6= f.input "localized_names[#{k}]", input_html: {value: v}, label: label_for_country(k) -                 -        = f.input :kind, as: :radio_buttons, checked: @stop_area.kind, :input_html => {:disabled => !@stop_area.new_record?}, :include_blank => false, item_wrapper_class: 'radio-inline', wrapper: :horizontal_form, disabled: !@stop_area.new_record? + +        = f.input :kind, +            as: :radio_buttons, +            checked: @stop_area.new_record? ? :commercial : @stop_area.kind, +            input_html: { disabled: !@stop_area.new_record? }, +            include_blank: false, +            item_wrapper_class: 'radio-inline', +            wrapper: :horizontal_form, +            disabled: !@stop_area.new_record?          .slave data-master="[name='stop_area[kind]']" data-value="commercial"            = f.input :parent_id, as: :select, :collection => [f.object.parent_id], input_html: { data: { select2_ajax: 'true', url: autocomplete_stop_area_referential_stop_areas_path(@stop_area_referential), initvalue: {id: f.object.parent_id, text: f.object.parent.try(:full_name)}}}          - %i(non_commercial commercial).each do |kind| | 
