aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/stop_areas/_form.html.slim11
1 files changed, 9 insertions, 2 deletions
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|