diff options
| author | Xinhui | 2016-11-30 10:56:28 +0100 |
|---|---|---|
| committer | Xinhui | 2016-11-30 10:56:28 +0100 |
| commit | e9c749fdf773c14f9a06679e7ee88368755b93fc (patch) | |
| tree | d3517d9ff6a9badc05ca2db6d4563df00e7cd600 | |
| parent | b5bf612f5359bfeaa5fb8d63a787c416ae457240 (diff) | |
| download | chouette-core-e9c749fdf773c14f9a06679e7ee88368755b93fc.tar.bz2 | |
Fix area_types form options
| -rw-r--r-- | app/views/referential_stop_areas/_form.html.slim | 8 | ||||
| -rw-r--r-- | app/views/referential_stop_areas/index.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.slim | 14 | ||||
| -rw-r--r-- | app/views/stop_areas/_stop_area.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/index.html.slim | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/app/views/referential_stop_areas/_form.html.slim b/app/views/referential_stop_areas/_form.html.slim index 5a27abcb5..50f5d4aaf 100644 --- a/app/views/referential_stop_areas/_form.html.slim +++ b/app/views/referential_stop_areas/_form.html.slim @@ -7,8 +7,8 @@ = form.inputs do = form.input :id, as: :hidden = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} - = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } - + = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.area_type.options, :include_blank => false } + .location_info h3 = t("stop_areas.stop_area.localisation") #prefetch @@ -26,7 +26,7 @@ .stop_areas.stop_area.general_info h3 = t("stop_areas.stop_area.general") - + = form.inputs do = form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} = form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} @@ -149,4 +149,4 @@ javascript: $('input[name="stop_area[city_name]"]').val(datum.city); }) - });
\ No newline at end of file + }); diff --git a/app/views/referential_stop_areas/index.html.slim b/app/views/referential_stop_areas/index.html.slim index 42ac267aa..967d91c48 100644 --- a/app/views/referential_stop_areas/index.html.slim +++ b/app/views/referential_stop_areas/index.html.slim @@ -22,7 +22,7 @@ .col-sm-3 = f.text_field :zip_code_cont, placeholder: "#{t('.zip_code')}", class: 'form-control typeahead', style: 'width: 100%' .col-sm-3 - = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t(".area_type") }) + = f.select(:area_type_cont, Chouette::StopArea.area_type.options, { include_blank: '' }, { class: 'form-control', style: 'width: 100%', 'data-select2ed': 'true', 'data-select2ed-placeholder': t(".area_type") }) #stop_areas = render 'stop_areas' diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim index 355f4dc83..546143393 100644 --- a/app/views/stop_areas/_form.html.slim +++ b/app/views/stop_areas/_form.html.slim @@ -7,18 +7,18 @@ = form.inputs do = form.input :id, as: :hidden = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} - = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } - + = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.area_type.options, :include_blank => false + .location_info h3 = t("stop_areas.stop_area.localisation") - + #prefetch label = t('.geolocalize') input.typeahead.form-control.input-lg maxlength="255" type="text" placeholder="#{t('.address')}" - unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? = form.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} - + = form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} = form.input :street_name = form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' @@ -27,7 +27,7 @@ .stop_areas.stop_area.general_info h3 = t("stop_areas.stop_area.general") - + = form.inputs do = form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} = form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} @@ -44,7 +44,7 @@ = form.input :mobility_restricted_suitability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true = form.input :stairs_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true = form.input :lift_availability, as: :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true - + = form.actions do = form.action :submit, as: :button = form.action :cancel, as: :link @@ -150,4 +150,4 @@ javascript: $('input[name="stop_area[city_name]"]').val(datum.city); <% end %> }) - });
\ No newline at end of file + }); diff --git a/app/views/stop_areas/_stop_area.html.slim b/app/views/stop_areas/_stop_area.html.slim index 39cb09660..2d381dd10 100644 --- a/app/views/stop_areas/_stop_area.html.slim +++ b/app/views/stop_areas/_stop_area.html.slim @@ -11,7 +11,7 @@ span.fa.fa-trash-o h5 - = link_to([@stop_area_referential, stop_area], class: 'preview', :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do + = link_to([@stop_area_referential, stop_area], class: 'preview', :title => "#{stop_area.area_type} #{stop_area.name}") do span.name = image_tag "map/" + stop_area.stop_area_type + ".png" = truncate(stop_area.name, :length => 20) diff --git a/app/views/stop_areas/index.html.slim b/app/views/stop_areas/index.html.slim index b234274fa..0e8d9281d 100644 --- a/app/views/stop_areas/index.html.slim +++ b/app/views/stop_areas/index.html.slim @@ -23,7 +23,7 @@ .col-sm-3 = f.text_field :zip_code_cont, placeholder: "#{t('.zip_code')}", class: 'form-control typeahead' .col-md-5.col-sm-5 - = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { include_blank: t('.area_type') }, { class: 'form-control' }) + = f.select(:area_type_cont, Chouette::StopArea.area_type.options, { include_blank: t('.area_type') }, { class: 'form-control' }) #stop_areas = render 'stop_areas' |
