diff options
Diffstat (limited to 'app/views/connection_links')
| -rw-r--r-- | app/views/connection_links/select_areas.html.erb | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/app/views/connection_links/select_areas.html.erb b/app/views/connection_links/select_areas.html.erb index ac1a95dab..f2c9cc883 100644 --- a/app/views/connection_links/select_areas.html.erb +++ b/app/views/connection_links/select_areas.html.erb @@ -3,8 +3,8 @@ <%= semantic_form_for [@referential, @connection_link] do |form| %> <div> <%= form.inputs do %> - <%= form.input :departure_id, :as => :text, :input_html => { :"data-pre" => ( @departure.present? ? [ { :id => @departure.id.to_s, :name => "#{@departure.name} [#{@departure.country_code}]" } ]: [] ).to_json } %> - <%= form.input :arrival_id, :as => :text, :input_html => { :"data-pre" => ( @arrival.present? ? [ { :id => @arrival.id.to_s, :name => "#{@arrival.name} [#{@arrival.country_code}]" } ]: [] ).to_json } %> + <%= form.input :departure_id, :as => :search_stop_area, :json => referential_connection_link_connection_link_areas_path(@referential, @connection_link, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => ( @departure.present? ? [ { :id => @departure.id.to_s, :name => "#{@departure.name}" } ]: [] ).to_json } %> + <%= form.input :arrival_id, :as => :search_stop_area, :json => referential_connection_link_connection_link_areas_path(@referential, @connection_link, :format => :json), :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => ( @arrival.present? ? [ { :id => @arrival.id.to_s, :name => "#{@arrival.name}" } ]: [] ).to_json } %> <% end %> <%= form.actions do %> @@ -13,34 +13,3 @@ <% end %> </div> <% end %> - -<script> - $(function() { - $( "#connection_link_departure_id" ).tokenInput('<%= referential_connection_link_connection_link_areas_path(@referential, @connection_link, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#connection_link_departure_id').data('pre'), - tokenLimit: 1, - minChars: 3, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); - - $(function() { - $( "#connection_link_arrival_id" ).tokenInput('<%= referential_connection_link_connection_link_areas_path(@referential, @connection_link, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#connection_link_arrival_id').data('pre'), - tokenLimit: 1, - minChars: 3, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> |
