app/views/entrances/_form.html.slim
= simple_form_for [@workbench, :stop_area_referential, @entrance], html: {class: 'form-horizontal', id: 'entrance_form'}, wrapper: :horizontal_form do |f|
.row
.col-lg-12
h2.mb-lg= t("entrances.form.sections.identification")
= f.input :stop_area_provider_id, as: :hidden
= f.input :name
= f.input :short_name
= f.association :stop_area, as: :select, collection: [f.object.stop_area_id], input_html: { data: { select2_ajax: 'true', url: autocomplete_workbench_stop_area_referential_stop_areas_path(@workbench), initvalue: {id: f.object.stop_area_id, text: f.object.stop_area.try(:formatted_selection_details)}}}
= f.association :stop_area_provider, as: :select, collection: @workbench.stop_area_providers, include_blank: false, label: StopAreaProvider.model_name.human
= f.input :entry_flag, as: :switchable_checkbox
= f.input :exit_flag, as: :switchable_checkbox
= f.input :entrance_type, as: :select
= f.input :description, as: :text
.separator.section_separator
.row
.col-lg-12
h2.mb-lg= t("entrances.form.sections.localization")
= f.input :position_input, as: :string
= f.input :address_line_1
= f.input :zip_code
= f.input :city_name
= f.input :postal_region
= f.input :country
.separator.section_separator
= render 'codes/form', form: f
= cancel_button
= f.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'entrance_form'