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 @@
-

Bienvenue sur Chouette

-

- 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(".welcome") %>

+

<%= t(".introduction1") %>

+

<%= t(".introduction2") %>

- <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label" ) do |form| %> + <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :wrapper => "form_without_label" ) do |form| %> <%= form.input :email, :label => false, :placeholder => t("helpers.label.user.email"), input_html: { :class => "form-control" } %>
@@ -42,24 +38,24 @@ <% if Rails.application.config.accept_user_creation %>
<%= t("devise.registrations.new.title") %>
-
+
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :wrapper => "form_without_label" ) do |form| %> <%= form.simple_fields_for :organisation, Organisation.new do |organisation| %> <%= organisation.input :name, :label => false, :placeholder => t("helpers.label.user.organisation_name"), input_html: { :class => "form-control" } %> <% end %> <% if resource.respond_to?( :name) %> - <%= form.input :name, :label => false, :placeholder => t("helpers.label.user.name"), input_html: { :class => "form-control" } %> - <% end %> - <%= form.input :email, :label => false, :placeholder => t("helpers.label.user.email"), input_html: { :class => "form-control" } %> - <%= form.input :password, :as => :password, :label => false, :placeholder => t("helpers.label.user.password"), input_html: { :class => "form-control" } %> - <%= form.input :password_confirmation, :as => :password, :label => false, :placeholder => t("helpers.label.user.password_confirmation"), input_html: { :class => "form-control" } %> - + <%= form.input :name, :label => false, :placeholder => t("helpers.label.user.name"), input_html: { :class => "form-control" } %> + <% end %> + <%= form.input :email, :label => false, :placeholder => t("helpers.label.user.email"), input_html: { :class => "form-control" } %> + <%= form.input :password, :as => :password, :label => false, :placeholder => t("helpers.label.user.password"), input_html: { :class => "form-control" } %> + <%= form.input :password_confirmation, :as => :password, :label => false, :placeholder => t("helpers.label.user.password_confirmation"), input_html: { :class => "form-control" } %> + <%= form.button :submit, t("devise.registrations.new.commit"), :class => "btn-info" %> <% end %>
<% end %> - +
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index 933eca4a3..017e167bd 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -6,6 +6,11 @@ en: new: title: Sign in commit: Sign in + welcome: "Welcome on Chouette" + introduction1: "Chouette is an Open Source software that can read and edit whole public transport service for passengers." + introduction2: "The software is delivered in Saas way and gives you :" + introduction_item1: "map view of lines, routes, journeys, stops, connections..." + introduction_item2: "data exchange functions in different formats like NEPTUNE, GTFS" confirmations: new: title: Resend confirmation instructions @@ -42,4 +47,4 @@ en: password: Password password_confirmation: Password confirmation current_password: Current password - remember_me: Remember me \ No newline at end of file + remember_me: Remember me diff --git a/config/locales/devise.fr.yml b/config/locales/devise.fr.yml index cb45578e5..c5885effc 100644 --- a/config/locales/devise.fr.yml +++ b/config/locales/devise.fr.yml @@ -10,6 +10,11 @@ fr: new: title: Se connecter commit: Se connecter + welcome: "Bienvenue sur Chouette" + introduction1: "Chouette est un logiciel Open Source d'édition et d'échange d'offre de transport public planifiée." + introduction2: "Le logiciel est mis à disposition en mode Saas et se veut ouvert :" + introduction_item1: "visualisation cartographique des lignes, des arrêts, des parcours..." + introduction_item2: "échange de données selon différents formats (Neptune, GTFS)" confirmations: new: title: Renvoyer le mail de confirmation -- cgit v1.2.3 From ab4abb00d0a8b1fdee6bf1cf635c856f49f0707c Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 17 Nov 2014 13:29:45 +0100 Subject: Update new password design page --- app/assets/stylesheets/modules/devise.css.scss | 6 ++++++ app/views/devise/passwords/new.html.erb | 20 ++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/modules/devise.css.scss b/app/assets/stylesheets/modules/devise.css.scss index 8236366ce..2b6c67a5e 100644 --- a/app/assets/stylesheets/modules/devise.css.scss +++ b/app/assets/stylesheets/modules/devise.css.scss @@ -1,6 +1,12 @@ #devise{ background-color: $gray-light; + .passwords.new{ + imput{ + width: initial !important; + } + } + .front_bg{ background: url(image-path('welcome.jpg')) no-repeat center center; background-size: cover; diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 68fd8c22a..865805319 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,12 +1,16 @@ -
-
<%= t('.title') %>
-
- <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |form| %> - <%= form.input :email %> +
+
+
<%= t('.title') %>
+
+ <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |form| %> + <%= form.input :email, :as => :email, placeholder: 'user@domain.com' %> - <%= link_to t("cancel"), root_path, :class => "btn btn-default" %> - <%= form.button :submit, :value => t("devise.passwords.new.commit") %> - <% end %> +
+ <%= link_to t("cancel"), root_path, :class => "btn btn-default" %> + <%= form.button :submit, :value => t("devise.passwords.new.commit"), :class => "btn-info" %> +
+ <% end %> +
-- cgit v1.2.3 From f16134f373c120e4b95c46b7532eeba19702a9f2 Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 17 Nov 2014 13:46:53 +0100 Subject: Update new password design page and input size --- app/assets/stylesheets/modules/devise.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/modules/devise.css.scss b/app/assets/stylesheets/modules/devise.css.scss index 2b6c67a5e..b4a1d2076 100644 --- a/app/assets/stylesheets/modules/devise.css.scss +++ b/app/assets/stylesheets/modules/devise.css.scss @@ -2,7 +2,7 @@ background-color: $gray-light; .passwords.new{ - imput{ + input{ width: initial !important; } } -- cgit v1.2.3 From a3999c76b97fa576293a41332a92a14b0d8e210c Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Mon, 17 Nov 2014 14:02:59 +0100 Subject: Fix journey pattern name in chouette Refs #0029646 --- app/helpers/journey_patterns_helper.rb | 6 ++++-- app/helpers/vehicle_journeys_helper.rb | 9 --------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/helpers/journey_patterns_helper.rb b/app/helpers/journey_patterns_helper.rb index 6897b88c9..4bbefbc1a 100644 --- a/app/helpers/journey_patterns_helper.rb +++ b/app/helpers/journey_patterns_helper.rb @@ -1,13 +1,15 @@ module JourneyPatternsHelper + def journey_name( journey_pattern) if journey_pattern.name.blank? - t('journey_patterns.journey_pattern.from_to', + truncate( t('journey_patterns.journey_pattern.from_to', :departure => journey_pattern.stop_points.first.stop_area.name, - :arrival => journey_pattern.stop_points.last.stop_area.name) + :arrival => journey_pattern.stop_points.last.stop_area.name), :length => 30) else truncate(journey_pattern.name, :length => 30) end end + def stop_point_ids_label(journey_pattern) return journey_pattern.human_attribute_name(:stop_point_ids) if journey_pattern.vehicle_journeys.empty? diff --git a/app/helpers/vehicle_journeys_helper.rb b/app/helpers/vehicle_journeys_helper.rb index 2ee8123b5..95741f441 100644 --- a/app/helpers/vehicle_journeys_helper.rb +++ b/app/helpers/vehicle_journeys_helper.rb @@ -1,13 +1,4 @@ module VehicleJourneysHelper - def journey_name( journey_pattern) - if !journey_pattern.published_name.blank? - journey_pattern.published_name.first(8) - elsif !journey_pattern.name.blank? - journey_pattern.name.first(8) - else - journey_pattern.id - end - end def vehicle_name( vehicle) if !vehicle.published_journey_name.blank? -- cgit v1.2.3 From 368f6b6c8b92f89c11b704f6914796d3d424f7ae Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Mon, 17 Nov 2014 14:23:40 +0100 Subject: manage line color with helper --- app/helpers/lines_helper.rb | 9 +++++++++ app/views/lines/_line.erb | 9 +-------- app/views/lines/show.html.erb | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/helpers/lines_helper.rb b/app/helpers/lines_helper.rb index 623d091ca..80073af62 100644 --- a/app/helpers/lines_helper.rb +++ b/app/helpers/lines_helper.rb @@ -16,4 +16,13 @@ module LinesHelper def background_color(line) line.color.blank? ? "white" : "#"+line.color end + + def number_style(line) + if colors?(line) + number_style = "color: #{text_color(line)}; background-color: #{background_color(line)};" + else + number_style = "" + end + + end end diff --git a/app/views/lines/_line.erb b/app/views/lines/_line.erb index 24450fa20..5962cd64f 100644 --- a/app/views/lines/_line.erb +++ b/app/views/lines/_line.erb @@ -12,14 +12,7 @@
<%= check_box_tag "ids[]", line.id, false, :class => "multiple_selection", :style => "display: none;" %> <% if line.number and line.number.length <= 3 %> - <% if !line.text_color.blank? || !line.color.blank? %> - <% text_color = line.text_color.blank? ? "black" : "##{line.text_color}" %> - <% bg_color = line.color.blank? ? "white" : "##{line.color}" %> - <% number_style = "color: #{text_color}; background-color: #{bg_color};" %> - <% else %> - <% number_style = "" %> - <% end %> - <%= line.number %> + <%= line.number %> <% end %> <%= link_to([@referential, line], :class => "preview", :title => "#{Chouette::Line.model_name.human.capitalize} #{line.name}") do %> diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index 12af00ff7..5983aaca0 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -12,7 +12,7 @@ <% if colors?(@line) %>

- +

<% 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 '

  • ' + item_name( item) + '
    ' + item.area_type + '
    ' + info + '
  • ' + }; $('##{dom_id}').tokenInput('#{options[:json]}', { crossDomain: false, tokenLimit: #{tokenLimit}, @@ -13,21 +32,21 @@ class SearchStopAreaInput < Formtastic::Inputs::SearchInput hintText: '#{options[:hint_text]}', noResultsText: '#{options[:no_result_text]}', searchingText: '#{options[:searching_text]}', - resultsFormatter: function(item){ return '
  • ' + item.name + '
    ' + item.area_type + '
    ' + item.zip_code + ' ' + item.city_name + '
  • ' }, - tokenFormatter: function(item){ return '
  • ' + item.name + '
    ' + item.area_type + '
    ' + item.zip_code + ' ' + item.city_name + '
  • ' }, + resultsFormatter: item_format, + tokenFormatter: item_format }); });").html_safe) end end - + def to_html - input_wrapping do + input_wrapping do label_html << builder.search_field(method, input_html_options) << search end end - + def input_html_options super.merge({ :required => nil, @@ -35,6 +54,6 @@ class SearchStopAreaInput < Formtastic::Inputs::SearchInput :class => 'token-input', 'data-model-name' => object.class.model_name.human }) - end - + end + end diff --git a/app/views/stop_areas/index.rabl b/app/views/stop_areas/index.rabl index 72b736858..d7f2365bb 100644 --- a/app/views/stop_areas/index.rabl +++ b/app/views/stop_areas/index.rabl @@ -1,9 +1,9 @@ collection @stop_areas node do |stop_area| - { :id => stop_area.id, :name => stop_area.name || "", :zip_code => stop_area.zip_code || "", :city_name => stop_area.city_name || "" } + { :id => stop_area.id, :registration_number => stop_area.registration_number || "", :name => stop_area.name || "", :zip_code => stop_area.zip_code || "", :city_name => stop_area.city_name || "" } end node :area_type do |area| I18n.t("area_types.label.#{area.area_type.underscore}") || "" -end \ No newline at end of file +end diff --git a/app/views/stop_areas/show.rabl b/app/views/stop_areas/show.rabl index a03a3511d..f406c4eff 100644 --- a/app/views/stop_areas/show.rabl +++ b/app/views/stop_areas/show.rabl @@ -1,7 +1,7 @@ object @stop_area node do |stop_area| - { :id => stop_area.id, :name => stop_area.name || "", :zip_code => stop_area.zip_code || "", :city_name => stop_area.city_name || "" } + { :id => stop_area.id, :registration_number => stop_area.registration_number || "", :name => stop_area.name || "", :zip_code => stop_area.zip_code || "", :city_name => stop_area.city_name || "" } end node :area_type do |area| -- cgit v1.2.3 From c7b7ba19222701461cfb58b3bf325a9a5d3e3fe8 Mon Sep 17 00:00:00 2001 From: Zakaria BOUZIANE Date: Wed, 19 Nov 2014 10:57:49 +0100 Subject: Add from_proj and to_proj objects to RGeo transform_coords method. Mantis 30153 --- app/exporters/chouette/hub/commercial_stop_area_exporter.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/exporters/chouette/hub/commercial_stop_area_exporter.rb b/app/exporters/chouette/hub/commercial_stop_area_exporter.rb index da134a08f..be4b667e5 100644 --- a/app/exporters/chouette/hub/commercial_stop_area_exporter.rb +++ b/app/exporters/chouette/hub/commercial_stop_area_exporter.rb @@ -7,6 +7,14 @@ class Chouette::Hub::CommercialStopAreaExporter @directory = directory @template = File.open('app/views/api/hub/arrets_generiques.hub.erb' ){ |f| f.read } @type = "ONNNNNNNNNNNNNNNNN" + + @stop_area.referential.projection_type = "27562" + + wgs84 = '+proj=lonlat +datum=WGS84 +ellps=WGS84' + @from_projection = RGeo::CoordSys::Proj4.new(wgs84) + + lambert2_extended = '+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs' + @to_projection = RGeo::CoordSys::Proj4.new(lambert2_extended) end def render() -- cgit v1.2.3 From f4020351027dea179270a60ef75e85fd7b905917 Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 21 Nov 2014 08:48:49 +0100 Subject: set filter on zip code instead of country code , Mantis 30115 --- app/controllers/stop_areas_controller.rb | 6 +++--- app/views/stop_areas/index.html.erb | 2 +- config/locales/stop_areas.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/stop_areas_controller.rb b/app/controllers/stop_areas_controller.rb index b164f4bc8..53a7575b9 100644 --- a/app/controllers/stop_areas_controller.rb +++ b/app/controllers/stop_areas_controller.rb @@ -49,7 +49,7 @@ class StopAreasController < ChouetteController def index request.format.kml? ? @per_page = nil : @per_page = 12 - @country_codes = referential.stop_areas.collect(&:country_code).compact.uniq + @zip_codes = referential.stop_areas.collect(&:zip_code).compact.uniq index! do |format| format.html { if collection.out_of_bounds? @@ -110,9 +110,9 @@ class StopAreasController < ChouetteController redirect_to referential_stop_areas_path(@referential) end - def country_codes + def zip_codes respond_to do |format| - format.json { render :json => referential.stop_areas.collect(&:country_code).compact.uniq.to_json } + format.json { render :json => referential.stop_areas.collect(&:zip_code).compact.uniq.to_json } end end diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb index 93406dc81..8486af7ad 100644 --- a/app/views/stop_areas/index.html.erb +++ b/app/views/stop_areas/index.html.erb @@ -20,7 +20,7 @@ diff --git a/config/locales/stop_areas.yml b/config/locales/stop_areas.yml index 379838f6e..1974c5cb1 100644 --- a/config/locales/stop_areas.yml +++ b/config/locales/stop_areas.yml @@ -48,7 +48,7 @@ en: index: title: "Stop areas" name: "Search by name" - country_code: "Postal Code : 78000" + zip_code: "Zip Code" selection: "Filter on" selection_all: "All" area_type: "Area Type" @@ -170,7 +170,7 @@ fr: access_link_legend_2: "cliquer sur les flêches pour créer/éditer un lien" index: name: "Recherche par nom" - country_code: "Code Postal : 78000" + zip_code: "Code Postal" title: "Arrêts" selection: "Filtrer sur" selection_all: "Tous" -- cgit v1.2.3 From b49f65edd92e52ec630d936af1d4927f42a75862 Mon Sep 17 00:00:00 2001 From: Zakaria BOUZIANE Date: Fri, 21 Nov 2014 08:49:34 +0100 Subject: Timetables int_day_types set to 0 if undefined --- app/exporters/chouette/hub/vehicle_journey_exporter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/exporters/chouette/hub/vehicle_journey_exporter.rb b/app/exporters/chouette/hub/vehicle_journey_exporter.rb index e1d7fce58..fb854566b 100644 --- a/app/exporters/chouette/hub/vehicle_journey_exporter.rb +++ b/app/exporters/chouette/hub/vehicle_journey_exporter.rb @@ -24,7 +24,8 @@ class Chouette::Hub::VehicleJourneyExporter @departure_time_sec = departure_time.sec + ( departure_time.min + departure_time.hour * 60 ) * 60 @arrival_time_sec = arrival_time.sec + ( arrival_time.min + arrival_time.hour * 60 ) * 60 @validity = 0 - @vehicle_journey.time_tables.map(&:int_day_types).each { |v| @validity |= v } + #@vehicle_journey.time_tables.map(&:int_day_types).each { |v| @validity |= v } + @vehicle_journey.time_tables.each { |t| @validity |= t.int_day_types if t.int_day_types } periods = Chouette::TimeTable.where( :id => @vehicle_journey.time_tables.map(&:id) ).map(&:objectid) @periods = "" -- cgit v1.2.3 From e93186fe5d2344dbb03064fd414256b08f2240fc Mon Sep 17 00:00:00 2001 From: Michel Etienne Date: Fri, 21 Nov 2014 08:49:44 +0100 Subject: correct date picker on export form, Mantis 30140 --- app/views/exports/new.html.erb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/app/views/exports/new.html.erb b/app/views/exports/new.html.erb index 8405e2c4d..fe5961ce9 100644 --- a/app/views/exports/new.html.erb +++ b/app/views/exports/new.html.erb @@ -7,26 +7,26 @@ <% end %> <% @available_exports.each do |export| %> -<%= semantic_form_for [@referential, export], :as => :export, :url => referential_exports_path(@referential), :html => { :id => "#{export.type}_new", :style => ('display: none' unless @export == export)} do |form| %> + <%= semantic_form_for [@referential, export], :as => :export, :url => referential_exports_path(@referential), :namespace => export.type.underscore ,:html => { :id => "#{export.type}_new", :style => ('display: none' unless @export == export)} do |form| %> <%= form.inputs do %> <%= fields_for_export_type form %> <% end %> - <%= form.inputs do %> - <%= form.input :type, :as => :hidden %> + <%= form.inputs do %> + <%= form.input :type, :as => :hidden %> -

    <%= 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 %>