aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/stop_areas_controller.rb6
-rw-r--r--app/models/time_table_combination.rb2
-rw-r--r--app/views/exports/new.html.erb26
-rw-r--r--app/views/stop_areas/index.html.erb2
-rw-r--r--config/locales/stop_areas.yml4
5 files changed, 20 insertions, 20 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/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
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 %>
- <p class="warning"><%= t('.'+export_partial_name(form)+'.warning',:default => "")%></p>
- <%= form.input :references_type, :as => :select, :collection => export.references_types.map { |c| [ c.model_name.human.capitalize.pluralize, c.name ] }, :include_blank => t(".all") %>
+ <p class="warning"><%= t('.'+export_partial_name(form)+'.warning',:default => "")%></p>
+ <%= 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) %>
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 @@
<div id="advanced_search" class="panel-collapse collapse">
<div class="panel-body">
- <%= f.text_field :country_code_cont, :placeholder => "#{t('.country_code')}", :class => 'form-control typeahead' %>
+ <%= f.text_field :zip_code_cont, :placeholder => "#{t('.zip_code')}", :class => 'form-control typeahead' %>
<%= 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' }) %>
</div>
</div>
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"