From 0df2ab4ef16ade6547db4f707472cc9506c12892 Mon Sep 17 00:00:00 2001 From: Marc Florisson Date: Mon, 17 Nov 2014 12:26:54 +0100 Subject: fix translations for login page --- app/views/devise/sessions/new.html.erb | 32 ++++++++++++++------------------ config/locales/devise.en.yml | 7 ++++++- config/locales/devise.fr.yml | 5 +++++ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index dc06a3ea2..9334bab35 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,21 +1,17 @@
- Chouette est un logiciel Open Source de saisie, de visualisation et d'échange d'offre de transport public planifiée. -
-- Ce logiciel est déployé en mode Saas et se veut ouvert : -
+<%= t(".introduction1") %>
+<%= t(".introduction2") %>
- +
<% end %>-- cgit v1.2.3 From a7bd193b698c76e2507b136c15ab339256fe6cab Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Mon, 17 Nov 2014 14:44:04 +0100 Subject: update help index --- app/views/help/index.textile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/views/help/index.textile b/app/views/help/index.textile index 1ac92d989..79d3b02e9 100644 --- a/app/views/help/index.textile +++ b/app/views/help/index.textile @@ -3,7 +3,7 @@ layout: default title: Chouette v2 --- -Version 2.5.0 +Version 2.5.1 h3. Logiciel libre propriété de : @@ -24,6 +24,14 @@ A cet égard l'attention de l'utilisateur est attirée sur les risques associé h3. Notes de version +h4. Version 2.5.1 + +* Nouvelles foctionnalités : +** refonte de l'import/export GTFS +** ajout des couleurs de lignes +** ajout de l'URL d'une page web pour les transporteurs, lignes et les arrêts +** ajout du fuseau horaire pour les transporteurs et les arrêts. + h4. Version 2.5.0 * Nouvelles foctionnalités : -- cgit v1.2.3 From d3dbdbbc532eacb11d77e1912f822fed92e30547 Mon Sep 17 00:00:00 2001 From: Marc Florisson Date: Tue, 18 Nov 2014 22:23:09 +0100 Subject: add registration_number in stop area auto complete. Mantis 30118 --- app/controllers/stop_area_children_controller.rb | 20 ++++---------- app/controllers/stop_area_parents_controller.rb | 20 ++++---------- app/inputs/search_stop_area_input.rb | 35 ++++++++++++++++++------ app/views/stop_areas/index.rabl | 4 +-- app/views/stop_areas/show.rabl | 2 +- 5 files changed, 42 insertions(+), 39 deletions(-) diff --git a/app/controllers/stop_area_children_controller.rb b/app/controllers/stop_area_children_controller.rb index f115ff35a..773f6e1b8 100644 --- a/app/controllers/stop_area_children_controller.rb +++ b/app/controllers/stop_area_children_controller.rb @@ -3,27 +3,19 @@ class StopAreaChildrenController < ChouetteController respond_to :json, :only => :index def index - respond_to do |format| - format.json { render :json => children_maps } - end + respond_to do |format| + format.json { render :json => children_maps } + end end protected def children_maps - children.collect do |area| - { :id => area.id.to_s, - :name => area.name, - :country_code => area.country_code, - :zip_code => area.zip_code || "", - :city_name => area.city_name || "", - :area_type => t("area_types.label.#{area.area_type.underscore}") - } - end + children.map { |c| c.attributes} end - def children - referential.stop_areas.find(params[:stop_area_id]).possible_children.select{ |p| p.name =~ /#{params[:q]}/i } + def children + referential.stop_areas.find(params[:stop_area_id]).possible_children.select{ |p| p.name =~ /#{params[:q]}/i } end end diff --git a/app/controllers/stop_area_parents_controller.rb b/app/controllers/stop_area_parents_controller.rb index 1dbb0796c..06b462075 100644 --- a/app/controllers/stop_area_parents_controller.rb +++ b/app/controllers/stop_area_parents_controller.rb @@ -3,25 +3,17 @@ class StopAreaParentsController < ChouetteController respond_to :json, :only => :index def index - respond_to do |format| - format.json { render :json => parents_maps } - end + respond_to do |format| + format.json { render :json => parents_maps } + end end def parents_maps - parents.collect do |area| - { :id => area.id.to_s, - :name => area.name, - :country_code => area.country_code, - :zip_code => area.zip_code || "", - :city_name => area.city_name || "", - :area_type => t("area_types.label.#{area.area_type.underscore}") - } - end + parents.map { |p| p.attributes} end - def parents - referential.stop_areas.find(params[:stop_area_id]).possible_parents.select{ |p| p.name =~ /#{params[:q]}/i } + def parents + referential.stop_areas.find(params[:stop_area_id]).possible_parents.select{ |p| p.name =~ /#{params[:q]}/i } end end diff --git a/app/inputs/search_stop_area_input.rb b/app/inputs/search_stop_area_input.rb index 1feb58d00..901715dc1 100644 --- a/app/inputs/search_stop_area_input.rb +++ b/app/inputs/search_stop_area_input.rb @@ -2,9 +2,28 @@ class SearchStopAreaInput < Formtastic::Inputs::SearchInput def search if options[:json] - tokenLimit = options[:tokenLimit].present? ? options[:tokenLimit] : "null" + tokenLimit = options[:tokenLimit].present? ? options[:tokenLimit] : "null" template.content_tag( :script, ("$(document).ready(function() { + var item_name = function( item){ + var result = item.name; + console.log( item ); + console.log( item.registration_number ); + if ( item.registration_number !=null && item.registration_number.length > 0) { + result += ' (' + item.registration_number + ')'; + } + return result; + }; + var item_format = function( item ){ + var info = ''; + if ( item.zip_code != null ) { + info += item.zip_code + ' '; + } + if ( item.city_name != null ) { + info += item.city_name; + } + return '
<%= t('.'+export_partial_name(form)+'.warning',:default => "")%>
- <%= form.input :references_type, :as => :select, :collection => export.references_types.map { |c| [ c.model_name.human.capitalize.pluralize, c.name ] }, :include_blank => t(".all") %> +<%= t('.'+export_partial_name(form)+'.warning',:default => "")%>
+ <%= form.input :references_type, :as => :select, :collection => export.references_types.map { |c| [ c.model_name.human.capitalize.pluralize, c.name ] }, :include_blank => t(".all") %> - <% export.references_types.each do |type| %> - <%= type_ids_model_references_input(form, @export, Export, type).input %> + <% export.references_types.each do |type| %> + <%= type_ids_model_references_input(form, @export, Export, type).input %> + <% end %> <% end %> - <% end %> - <%= form.actions do %> - <%= form.action :submit, :as => :button , :label => t( 'formtastic.export' ) %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> + <%= form.actions do %> + <%= form.action :submit, :as => :button , :label => t( 'formtastic.export' ) %> + <%= form.action :cancel, :as => :link %> + <% end %> + <% end %> <% end %> <%= javascript_include_tag new_referential_export_path(@referential, :format => :js) %> -- cgit v1.2.3 From 705bbe7e92fa7d83c5cdf11e5486ab40d868583b Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 21 Nov 2014 08:50:59 +0100 Subject: invalid message when no timetable combination operation is selected, Mantis 30106 --- app/models/time_table_combination.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/time_table_combination.rb b/app/models/time_table_combination.rb index 1fa497d73..783ef53ef 100644 --- a/app/models/time_table_combination.rb +++ b/app/models/time_table_combination.rb @@ -6,7 +6,7 @@ class TimeTableCombination attr_accessor :source_id, :combined_id, :operation validates_presence_of :source_id, :combined_id, :operation - validates_inclusion_of :operation, :in => %w( union intersection disjunction) + validates_inclusion_of :operation, :in => %w( union intersection disjunction), :allow_nil => true def clean self.source_id = nil -- cgit v1.2.3 From 3d61c788b87c8a4017dc86c4f2bc211fc784af14 Mon Sep 17 00:00:00 2001 From: Marc Florisson Date: Fri, 21 Nov 2014 18:11:35 +0100 Subject: display more info on stop area auto complete. Mantis 30118 --- app/controllers/stop_area_children_controller.rb | 2 +- app/controllers/stop_area_parents_controller.rb | 2 +- app/controllers/stop_point_areas_controller.rb | 20 ++--- app/views/routes/_form.html.erb | 96 ++++++++++++++---------- 4 files changed, 65 insertions(+), 55 deletions(-) diff --git a/app/controllers/stop_area_children_controller.rb b/app/controllers/stop_area_children_controller.rb index 773f6e1b8..d60fcb1a6 100644 --- a/app/controllers/stop_area_children_controller.rb +++ b/app/controllers/stop_area_children_controller.rb @@ -11,7 +11,7 @@ class StopAreaChildrenController < ChouetteController protected def children_maps - children.map { |c| c.attributes} + children.map {|area| area.attributes.merge( :area_type => t("area_types.label.#{area.area_type.underscore}"))} end def children diff --git a/app/controllers/stop_area_parents_controller.rb b/app/controllers/stop_area_parents_controller.rb index 06b462075..c32e5df17 100644 --- a/app/controllers/stop_area_parents_controller.rb +++ b/app/controllers/stop_area_parents_controller.rb @@ -9,7 +9,7 @@ class StopAreaParentsController < ChouetteController end def parents_maps - parents.map { |p| p.attributes} + parents.map {|area| area.attributes.merge( :area_type => t("area_types.label.#{area.area_type.underscore}"))} end def parents diff --git a/app/controllers/stop_point_areas_controller.rb b/app/controllers/stop_point_areas_controller.rb index 9544d0fe6..1ece8641e 100644 --- a/app/controllers/stop_point_areas_controller.rb +++ b/app/controllers/stop_point_areas_controller.rb @@ -3,25 +3,17 @@ class StopPointAreasController < ChouetteController respond_to :json, :only => :index def index - respond_to do |format| - format.json { render :json => areas_maps } - end + respond_to do |format| + format.json { render :json => areas_maps } + end end def areas_maps - areas.collect do |area| - { :id => area.id.to_s, - :name => area.name, - :country_code => area.country_code, - :zip_code => area.zip_code || "", - :city_name => area.city_name || "", - :area_type => t("area_types.label.#{area.area_type.underscore}") - } - end + areas.map {|area| area.attributes.merge( :area_type => t("area_types.label.#{area.area_type.underscore}"))} end - def areas - Chouette::StopPoint.area_candidates.select{ |p| p.name =~ /#{params[:q]}/i } + def areas + Chouette::StopPoint.area_candidates.select{ |p| p.name =~ /#{params[:q]}/i } end end diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb index 658fda0ae..270c49911 100644 --- a/app/views/routes/_form.html.erb +++ b/app/views/routes/_form.html.erb @@ -26,55 +26,73 @@ <% end %> <% end %>