diff options
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/compliance_check_tasks/new.js.coffee | 2 | ||||
| -rw-r--r-- | app/views/connection_links/select_areas.html.erb | 22 | ||||
| -rw-r--r-- | app/views/exports/new.js.coffee | 2 | ||||
| -rw-r--r-- | app/views/group_of_lines/_form.erb | 15 | ||||
| -rw-r--r-- | app/views/stop_areas/add_children.html.erb | 15 | ||||
| -rw-r--r-- | app/views/stop_areas/add_routing_lines.html.erb | 15 | ||||
| -rw-r--r-- | app/views/stop_areas/add_routing_stops.html.erb | 15 | ||||
| -rw-r--r-- | app/views/stop_areas/select_parent.html.erb | 15 | ||||
| -rw-r--r-- | app/views/stop_points/new.html.erb | 15 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/_form.html.erb | 27 |
10 files changed, 85 insertions, 58 deletions
diff --git a/app/views/compliance_check_tasks/new.js.coffee b/app/views/compliance_check_tasks/new.js.coffee index f8f60ac79..32cfa851a 100644 --- a/app/views/compliance_check_tasks/new.js.coffee +++ b/app/views/compliance_check_tasks/new.js.coffee @@ -1,4 +1,4 @@ jQuery -> <% ComplianceCheckTask.references_types.map { |type| type_ids_model_references_type( ComplianceCheckTask, type)}.each do |rt| %> - $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1 }); + $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1, hintText: '<%= t('search_hint') %>', noResultsText: '<%= t('no_result_text') %>', searchingText: '<%= t('searching_term') %>'}); <% end %> diff --git a/app/views/connection_links/select_areas.html.erb b/app/views/connection_links/select_areas.html.erb index 6c6f4dedf..ac1a95dab 100644 --- a/app/views/connection_links/select_areas.html.erb +++ b/app/views/connection_links/select_areas.html.erb @@ -2,11 +2,11 @@ <%= semantic_form_for [@referential, @connection_link] do |form| %> <div> - <%= form.inputs do %> + <%= 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 } %> - <% end %> - + <% end %> + <%= form.actions do %> <%= form.action :submit, :as => :button %> <%= form.action :cancel, :as => :link %> @@ -16,24 +16,30 @@ <script> $(function() { - $( "#connection_link_departure_id" ).tokenInput('<%= referential_connection_link_connection_link_areas_path(@referential, @connection_link, :format => :json) %>', { - crossDomain: false, + $( "#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, + $( "#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> diff --git a/app/views/exports/new.js.coffee b/app/views/exports/new.js.coffee index 01835f404..0886f53c9 100644 --- a/app/views/exports/new.js.coffee +++ b/app/views/exports/new.js.coffee @@ -1,4 +1,4 @@ jQuery -> <% Export.references_types.map { |type| type_ids_model_references_type( Export, type)}.each do |rt| %> - $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1 }); + $("textarea.<%= rt.input_class %>").tokenInput('<%= references_referential_compliance_check_tasks_path(@referential, :type => rt.relation_name, :format => :json) %>', { prePopulate: $('#').data('pre'), minChars: 1, hintText: '<%= t('search_hint') %>', noResultsText: '<%= t('no_result_text') %>', searchingText: '<%= t('searching_term') %>'}); <% end %> diff --git a/app/views/group_of_lines/_form.erb b/app/views/group_of_lines/_form.erb index 087d90a9f..329d3c619 100644 --- a/app/views/group_of_lines/_form.erb +++ b/app/views/group_of_lines/_form.erb @@ -1,11 +1,11 @@ <%= semantic_form_for [@referential, @group_of_line] do |form| %> - <%= form.inputs do %> - <%= form.input :name %> + <%= form.inputs do %> + <%= form.input :name %> <%= form.input :comment %> - <%= form.input :objectid, :required => !@group_of_line.new_record?, :input_html => { :disabled => !@group_of_line.new_record? } %> + <%= form.input :objectid, :required => !@group_of_line.new_record?, :input_html => { :disabled => !@group_of_line.new_record? } %> <% end %> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :line_tokens, :label => t('.lines'), :as => :text, :input_html => { :"data-pre" => ( @group_of_line.lines.map { |line| { :id => line.id, :name => line.published_name } } ).to_json } %> <% end %> @@ -17,11 +17,14 @@ <script> $(function() { - $( "#group_of_line_line_tokens" ).tokenInput('<%= name_filter_referential_lines_path(@referential, :format => :json) %>', { - crossDomain: false, + $( "#group_of_line_line_tokens" ).tokenInput('<%= name_filter_referential_lines_path(@referential, :format => :json) %>', { + crossDomain: false, prePopulate: $('#line_tokens').data('pre'), minChars: 1, preventDuplicates: true, + hintText: '<%= t('search_hint') %>', + noResultsText: '<%= t('no_result_text') %>', + searchingText: '<%= t('searching_term') %>' }); }); </script> diff --git a/app/views/stop_areas/add_children.html.erb b/app/views/stop_areas/add_children.html.erb index 6f637086c..acf4ff603 100644 --- a/app/views/stop_areas/add_children.html.erb +++ b/app/views/stop_areas/add_children.html.erb @@ -2,10 +2,10 @@ <%= semantic_form_for [@referential, @stop_area] do |form| %> <div> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :children_ids, :as => :text, :input_html => { :"data-pre" => ( @children.map { |child| { :id => child.id.to_s, :name => "#{child.name} #{child.country_code}" } } ).to_json } %> - <% end %> - + <% end %> + <%= form.actions do %> <%= form.action :submit, :as => :button %> <%= form.action :cancel, :as => :link %> @@ -15,14 +15,17 @@ <script> $(function() { - $( "#stop_area_children_ids" ).tokenInput('<%= referential_stop_area_stop_area_children_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, + $( "#stop_area_children_ids" ).tokenInput('<%= referential_stop_area_stop_area_children_path(@referential, @stop_area, :format => :json) %>', { + crossDomain: false, prePopulate: $('#stop_area_children_id').data('pre'), minChars: 3, + hintText: '<%= t('search_hint') %>', + noResultsText: '<%= t('no_result_text') %>', + searchingText: '<%= t('searching_term') %>' }); }); </script> - + <% content_for :sidebar do %> <ul class="actions"> </ul> diff --git a/app/views/stop_areas/add_routing_lines.html.erb b/app/views/stop_areas/add_routing_lines.html.erb index e0750a758..84d03f8b2 100644 --- a/app/views/stop_areas/add_routing_lines.html.erb +++ b/app/views/stop_areas/add_routing_lines.html.erb @@ -2,10 +2,10 @@ <%= semantic_form_for [@referential, @stop_area] do |form| %> <div> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :routing_line_ids, :as => :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json } %> - <% end %> - + <% end %> + <%= form.actions do %> <%= form.action :submit, :as => :button %> <%= form.action :cancel, :as => :link %> @@ -15,14 +15,17 @@ <script> $(function() { - $( "#stop_area_routing_line_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, + $( "#stop_area_routing_line_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, :format => :json) %>', { + crossDomain: false, prePopulate: $('#stop_area_routing_line_id').data('pre'), minChars: 1, + hintText: '<%= t('search_hint') %>', + noResultsText: '<%= t('no_result_text') %>', + searchingText: '<%= t('searching_term') %>' }); }); </script> - + <% content_for :sidebar do %> <ul class="actions"> </ul> diff --git a/app/views/stop_areas/add_routing_stops.html.erb b/app/views/stop_areas/add_routing_stops.html.erb index 5fc2326f0..06a96d575 100644 --- a/app/views/stop_areas/add_routing_stops.html.erb +++ b/app/views/stop_areas/add_routing_stops.html.erb @@ -2,10 +2,10 @@ <%= semantic_form_for [@referential, @stop_area] do |form| %> <div> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :routing_stop_ids, :as => :text, :input_html => { :"data-pre" => ( @stops.map { |stop| { :id => stop.id.to_s, :name => "#{stop.name} #{stop.country_code}" } } ).to_json } %> - <% end %> - + <% end %> + <%= form.actions do %> <%= form.action :submit, :as => :button %> <%= form.action :cancel, :as => :link %> @@ -15,14 +15,17 @@ <script> $(function() { - $( "#stop_area_routing_stop_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_stops_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, + $( "#stop_area_routing_stop_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_stops_path(@referential, @stop_area, :format => :json) %>', { + crossDomain: false, prePopulate: $('#stop_area_routing_stop_id').data('pre'), minChars: 3, + hintText: '<%= t('search_hint') %>', + noResultsText: '<%= t('no_result_text') %>', + searchingText: '<%= t('searching_term') %>' }); }); </script> - + <% content_for :sidebar do %> <ul class="actions"> </ul> diff --git a/app/views/stop_areas/select_parent.html.erb b/app/views/stop_areas/select_parent.html.erb index fedd83446..2e5f4ca94 100644 --- a/app/views/stop_areas/select_parent.html.erb +++ b/app/views/stop_areas/select_parent.html.erb @@ -2,10 +2,10 @@ <%= semantic_form_for [@referential, @stop_area] do |form| %> <div> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :parent_id, :as => :text, :input_html => { :"data-pre" => ( @parent.present? ? [ { :id => @parent.id.to_s, :name => "#{@parent.name} #{@parent.country_code}" } ]: [] ).to_json } %> - <% end %> - + <% end %> + <%= form.actions do %> <%= form.action :submit, :as => :button %> <%= form.action :cancel, :as => :link %> @@ -15,15 +15,18 @@ <script> $(function() { - $( "#stop_area_parent_id" ).tokenInput('<%= referential_stop_area_stop_area_parents_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, + $( "#stop_area_parent_id" ).tokenInput('<%= referential_stop_area_stop_area_parents_path(@referential, @stop_area, :format => :json) %>', { + crossDomain: false, prePopulate: $('#stop_area_parent_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> diff --git a/app/views/stop_points/new.html.erb b/app/views/stop_points/new.html.erb index e7f460c8c..14eba5bcc 100644 --- a/app/views/stop_points/new.html.erb +++ b/app/views/stop_points/new.html.erb @@ -2,10 +2,10 @@ <%= semantic_form_for [@referential, @line, @route, @stop_point] do |form| %> <div> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :stop_area_id, :label => t('.select_area'),:input_html => { :"data-pre" => [].to_json } %> - <% end %> - + <% end %> + <%= form.actions do %> <%= form.action :submit, :as => :button %> <%= form.action :cancel, :as => :link %> @@ -15,15 +15,18 @@ <script> $(function() { - $( "#stop_point_stop_area_id" ).tokenInput('<%= referential_stop_point_areas_path(@referential, :format => :json) %>', { - crossDomain: false, + $( "#stop_point_stop_area_id" ).tokenInput('<%= referential_stop_point_areas_path(@referential, :format => :json) %>', { + crossDomain: false, prePopulate: $('#stop_area_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> diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb index b16de29f4..277d72467 100644 --- a/app/views/vehicle_journeys/_form.html.erb +++ b/app/views/vehicle_journeys/_form.html.erb @@ -1,15 +1,15 @@ <%= semantic_form_for [@referential, @line, @route, @vehicle_journey] do |form| %> - <%= form.inputs do %> + <%= form.inputs do %> <%= form.input :journey_pattern, :as => :select, :collection => @route.journey_patterns, :member_label => Proc.new { |jp| journey_name(jp) } %> <%= form.input :published_journey_name %> <%= form.input :published_journey_identifier %> - <%= form.input :comment %> + <%= form.input :comment %> <%= form.input :transport_mode_name, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => true, :member_label => Proc.new { |mode| t("transport_mode_names.label.#{mode}") } %> - <%= form.input :status_value %> - <%= form.input :facility %> - <%= form.input :vehicle_type_identifier%> - <%= form.input :objectid, :required => !@vehicle_journey.new_record?, :input_html => { :disabled => !@vehicle_journey.new_record? } %> - + <%= form.input :status_value %> + <%= form.input :facility %> + <%= form.input :vehicle_type_identifier%> + <%= form.input :objectid, :required => !@vehicle_journey.new_record?, :input_html => { :disabled => !@vehicle_journey.new_record? } %> + <%= form.inputs :class => "stop_times", :name => @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) do %> <table border="0" class="vehicle_journey_at_stops"> <thead> @@ -31,17 +31,17 @@ <= vjas.object.stop_point.stop_area.name > <= vjas.input :_destroy, :as => :hidden > <= vjas.input :departure_time, :as => :time > - + < end > --> <tbody class="journey_pattern_dependent_list"> <%= render :partial => "vehicle_journeys/vehicle_journey_at_stop_fields", - :collection => @vehicle_journey.vehicle_journey_at_stops, :as => :vehicle_journey_at_stop %> + :collection => @vehicle_journey.vehicle_journey_at_stops, :as => :vehicle_journey_at_stop %> </tbody> </table> <% end %> <%= form.input :time_table_tokens, :label => t('.time_tables'), :as => :text, :input_html => { :"data-pre" => ( @vehicle_journey.time_tables.map { |time_table| { :id => time_table.id, :name => time_table.comment } } ).to_json } %> - + <% end %> <%= form.actions do %> @@ -58,11 +58,14 @@ <script> $(function() { - $( "#vehicle_journey_time_table_tokens" ).tokenInput('<%= comment_filter_referential_time_tables_path(@referential, :format => :json) %>', { - crossDomain: false, + $( "#vehicle_journey_time_table_tokens" ).tokenInput('<%= comment_filter_referential_time_tables_path(@referential, :format => :json) %>', { + crossDomain: false, prePopulate: $('#time_table_tokens').data('pre'), minChars: 3, preventDuplicates: true, + hintText: '<%= t('search_hint') %>', + noResultsText: '<%= t('no_result_text') %>', + searchingText: '<%= t('searching_term') %>' }); }); </script> |
