diff options
| author | Robert | 2017-04-24 14:16:52 +0200 |
|---|---|---|
| committer | Robert | 2017-04-24 14:16:52 +0200 |
| commit | 2d19e65fa8d8ac037c7f00a638111788b7ee002c (patch) | |
| tree | 830fe41ac13743f75f2c16f41dfd1ff399b99a9b /config | |
| parent | 5003acfc533baa824fed11cf6f82f86393b3a0f6 (diff) | |
| parent | 1cbed80c913420c76ac7d3716b9d8c4bf4e14278 (diff) | |
| download | chouette-core-2d19e65fa8d8ac037c7f00a638111788b7ee002c.tar.bz2 | |
conflict resolution and asset recompilation
Diffstat (limited to 'config')
| -rw-r--r-- | config/application.rb | 1 | ||||
| -rw-r--r-- | config/environment.rb | 2 | ||||
| -rw-r--r-- | config/environments/development.rb | 3 | ||||
| -rw-r--r-- | config/environments/production.rb | 2 | ||||
| -rw-r--r-- | config/environments/test.rb | 2 | ||||
| -rw-r--r-- | config/initializers/active_record.rb | 3 | ||||
| -rw-r--r-- | config/initializers/apartment.rb | 4 | ||||
| -rw-r--r-- | config/initializers/formtastic.rb | 6 | ||||
| -rw-r--r-- | config/initializers/postgresql_adapter_patch.rb | 54 | ||||
| -rw-r--r-- | config/initializers/ransack.rb | 13 | ||||
| -rw-r--r-- | config/initializers/squeel.rb | 6 | ||||
| -rw-r--r-- | config/locales/actions.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/actions.fr.yml | 2 | ||||
| -rw-r--r-- | config/locales/calendars.en.yml | 8 | ||||
| -rw-r--r-- | config/locales/calendars.fr.yml | 21 | ||||
| -rw-r--r-- | config/locales/en.yml | 1 | ||||
| -rw-r--r-- | config/locales/fr.yml | 1 | ||||
| -rw-r--r-- | config/locales/routing_constraint_zones.en.yml | 12 | ||||
| -rw-r--r-- | config/locales/routing_constraint_zones.fr.yml | 11 | ||||
| -rw-r--r-- | config/locales/time_tables.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/time_tables.fr.yml | 2 | ||||
| -rw-r--r-- | config/routes.rb | 11 |
22 files changed, 105 insertions, 64 deletions
diff --git a/config/application.rb b/config/application.rb index 70b927855..06f931765 100644 --- a/config/application.rb +++ b/config/application.rb @@ -31,6 +31,7 @@ module ChouetteIhm config.browserify_rails.commandline_options = "-t [ babelify --presets [ react es2015 ] ]" config.active_record.observers = :route_observer + config.active_record.raise_in_transactional_callbacks = true unless Rails.env.production? # Work around sprockets+teaspoon mismatch: diff --git a/config/environment.rb b/config/environment.rb index 592eda45a..4d27bfaec 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -6,4 +6,4 @@ require File.expand_path('../application', __FILE__) Rails.application.initialize! # Fix version -APP_VERSION = 'Itération 7' +APP_VERSION = 'Itération 9' diff --git a/config/environments/development.rb b/config/environments/development.rb index 61a0b97e9..0b4eab7d2 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -78,6 +78,9 @@ Rails.application.configure do config.codifligne_url = "https://pprod.codifligne.stif.info" config.portal_url = "http://stif-boiv-staging.af83.priv" + # IEV url + config.iev_url = "localhost:8080" + # file to data for demo config.demo_data = "tmp/demo.zip" diff --git a/config/environments/production.rb b/config/environments/production.rb index 71fe99fe8..41b31b1e8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -19,7 +19,7 @@ Rails.application.configure do # config.action_dispatch.rack_cache = true # Disable Rails's static asset server (Apache or nginx will already do this). - config.serve_static_assets = false + config.serve_static_files = false # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier diff --git a/config/environments/test.rb b/config/environments/test.rb index b77a26273..d83b4fd85 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -15,7 +15,7 @@ Rails.application.configure do config.eager_load = false # Configure static asset server for tests with Cache-Control for performance. - config.serve_static_assets = true + config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' # Show full error reports and disable caching. diff --git a/config/initializers/active_record.rb b/config/initializers/active_record.rb index cb4bf65b4..bdf9e0b4b 100644 --- a/config/initializers/active_record.rb +++ b/config/initializers/active_record.rb @@ -1,2 +1,5 @@ +require_relative '../../lib/af83/stored_procedures' + ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:primary_key] = "bigserial primary key" +StoredProcedures.create_stored_procedure(:clone_schema) diff --git a/config/initializers/apartment.rb b/config/initializers/apartment.rb index 602c4b51d..2c2632f40 100644 --- a/config/initializers/apartment.rb +++ b/config/initializers/apartment.rb @@ -41,7 +41,9 @@ Apartment.configure do |config| "CleanUpResult", "Calendar", "Import", - "NetexImport" + "NetexImport", + "ImportMessage", + "ImportResource" ] # use postgres schemas? diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb index 2cdc37243..e2341f037 100644 --- a/config/initializers/formtastic.rb +++ b/config/initializers/formtastic.rb @@ -74,3 +74,9 @@ Formtastic::FormBuilder.default_text_area_width = 50 # this to false. Doing so will add a `novalidate` attribute to the `<form>` tag. # See http://diveintohtml5.org/forms.html#validation for more info. # Formtastic::FormBuilder.perform_browser_validations = true + + +# ------------------------------------------------------------------------------------ +# Preparing Formtastic 4.0 +Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder +Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder diff --git a/config/initializers/postgresql_adapter_patch.rb b/config/initializers/postgresql_adapter_patch.rb deleted file mode 100644 index 2e4d73f85..000000000 --- a/config/initializers/postgresql_adapter_patch.rb +++ /dev/null @@ -1,54 +0,0 @@ -# module ::ArJdbc -# module PostgreSQL -# def quote_column_name(name) -# if name.is_a?(Array) -# name.collect { |n| %("#{n.to_s.gsub("\"", "\"\"")}") }.join(',') -# else -# %("#{name.to_s.gsub("\"", "\"\"")}") -# end -# end -# end -# end -# ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES[:primary_key] = "bigserial primary key" - -# Add missing double-quote to write array of daterange in SQL query -# See #1782 - -class ActiveRecord::ConnectionAdapters::PostgreSQLColumn - - def self.array_to_string(value, column, adapter) - casted_values = value.map do |val| - if String === val - if val == "NULL" - "\"#{val}\"" - else - quote_and_escape(adapter.type_cast(val, column, true)) - end - elsif Range === val - casted_value = adapter.type_cast(val, column, true) - "\"#{casted_value}\"" - else - adapter.type_cast(val, column, true) - end - end - "{#{casted_values.join(',')}}" - end - -end - -module ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID - class DateRange < Range - # Unnormalize daterange - # [2016-11-19,2016-12-26) -> 2016-11-19..2016-12-25 - def type_cast(value) - result = super value - - if result.respond_to?(:exclude_end?) && result.exclude_end? - ::Range.new(result.begin, result.end - 1, false) - else - result - end - end - end - register_type 'daterange', DateRange.new(:date) -end diff --git a/config/initializers/ransack.rb b/config/initializers/ransack.rb new file mode 100644 index 000000000..659ee4a79 --- /dev/null +++ b/config/initializers/ransack.rb @@ -0,0 +1,13 @@ +Ransack.configure do |config| + config.add_predicate 'between', + arel_predicate: 'between', + formatter: proc { |v| v.split(' to ') }, + type: :string +end +module Arel + module Predications + def between other + gteq(other[0]).and(lt(other[1])) + end + end +end diff --git a/config/initializers/squeel.rb b/config/initializers/squeel.rb index 821e72952..9fb8b24b2 100644 --- a/config/initializers/squeel.rb +++ b/config/initializers/squeel.rb @@ -1,8 +1,8 @@ -Squeel.configure do |config| +# Squeel.configure do |config| # To load hash extensions (to allow for AND (&), OR (|), and NOT (-) against # hashes of conditions): # - config.load_core_extensions :hash + # config.load_core_extensions :hash # To load symbol extensions (for a subset of the old MetaWhere functionality, # via Arel predicate methods on Symbols: :name.matches, etc): @@ -21,4 +21,4 @@ Squeel.configure do |config| # "less_than_any" and "less_than_all" as well: # # config.alias_predicate :less_than, :lt -end +# end diff --git a/config/locales/actions.en.yml b/config/locales/actions.en.yml index e4b0bcb28..5bfd9d9fb 100644 --- a/config/locales/actions.en.yml +++ b/config/locales/actions.en.yml @@ -9,8 +9,10 @@ en: archive: "Archive" unarchive: "Unarchive" clone: 'Clone' + duplicate: 'Clone' clean_up: 'Clean up' sync: 'Synchronize' + combine: 'Combine' or: "or" cancel: "Cancel" search_hint: "Type in a search term" diff --git a/config/locales/actions.fr.yml b/config/locales/actions.fr.yml index 0cd3de8e5..94afc1393 100644 --- a/config/locales/actions.fr.yml +++ b/config/locales/actions.fr.yml @@ -10,8 +10,10 @@ fr: archive: 'Conserver' unarchive: 'Déconserver' clone: 'Dupliquer' + duplicate: 'Dupliquer' clean_up: 'Purger' sync: 'Synchroniser' + combine: 'Combiner' or: "ou" cancel: "Annuler" search_hint: "Entrez un texte à rechercher" diff --git a/config/locales/calendars.en.yml b/config/locales/calendars.en.yml index cb63afde5..17dc8baf1 100644 --- a/config/locales/calendars.en.yml +++ b/config/locales/calendars.en.yml @@ -1,5 +1,13 @@ en: calendars: + days: + monday: M + tuesday: Tu + wednesday: W + thursday: Th + friday: F + saturday: Sa + sunday: Su standard_calendars: Standard calendars standard_calendar: Standard calendar actions: diff --git a/config/locales/calendars.fr.yml b/config/locales/calendars.fr.yml index 81254c81e..32e3c66d2 100644 --- a/config/locales/calendars.fr.yml +++ b/config/locales/calendars.fr.yml @@ -1,5 +1,26 @@ fr: calendars: + days: + monday: L + tuesday: Ma + wednesday: Me + thursday: J + friday: V + saturday: S + sunday: D + months: + 1: Janvier + 2: Février + 3: Mars + 4: Avril + 5: Mai + 6: Juin + 7: Juillet + 8: Août + 9: Septembre + 10: Octobre + 11: Novembre + 12: Décembre standard_calendars: Calendriers standards standard_calendar: Calendrier standard actions: diff --git a/config/locales/en.yml b/config/locales/en.yml index 77ad82605..5ed0b9ec5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -16,4 +16,5 @@ en: last_update: 'Last update on<br>%{time}' last_sync: 'Last sync on %{time}' validity_range: '%{debut} > %{end}' + bounding_dates: '%{debut} > %{end}' metadatas: 'Informations' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5ac6bb8b1..db8a3608d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -16,4 +16,5 @@ fr: last_update: 'Dernière mise à jour<br>le %{time}' last_sync: 'Dernière mise à jour le %{time}' validity_range: '%{debut} > %{end}' + bounding_dates: '%{debut} > %{end}' metadatas: 'Informations' diff --git a/config/locales/routing_constraint_zones.en.yml b/config/locales/routing_constraint_zones.en.yml index 7012a1493..2d4412dba 100644 --- a/config/locales/routing_constraint_zones.en.yml +++ b/config/locales/routing_constraint_zones.en.yml @@ -9,6 +9,17 @@ en: line: Line created_at: Created at updated_at: Updated at + objectid: Object ID + stop_points_count: Number of stop points + route: Route + errors: + models: + routing_constraint_zone: + attributes: + stop_points: + not_enough_stop_points: 'You should specify at least 2 stop points.' + stop_points_not_from_route: 'Stop point does not belong to the Route of this Routing constraint zone.' + all_stop_points_selected: 'All stop points from route cannot be selected.' routing_constraint_zones: actions: new: New routing constraint zone @@ -21,3 +32,4 @@ en: title: "Update routing constraint zone %{routing_constraint_zone}" show: title: "Routing constraint zone %{routing_constraint_zone}" + diff --git a/config/locales/routing_constraint_zones.fr.yml b/config/locales/routing_constraint_zones.fr.yml index bb4d8bcd2..36dcf9301 100644 --- a/config/locales/routing_constraint_zones.fr.yml +++ b/config/locales/routing_constraint_zones.fr.yml @@ -9,6 +9,17 @@ fr: line: Ligne created_at: "Créé le" updated_at: "Edité le" + objectid: Object ID + stop_points_count: Nombre d'arrêts + route: Itinéraire + errors: + models: + routing_constraint_zone: + attributes: + stop_points: + not_enough_stop_points: "Il faut mettre au moins deux arrêts sur séquence d'arrêts." + stop_points_not_from_route: "Arrêt sur séquence d'arrêts n'appartient pas à la Route de cette Zone de contrainte." + all_stop_points_selected: "Une zone de contrainte ne peut pas couvrir tous les arrêts d'une ligne." routing_constraint_zones: actions: new: Ajouter une zone de contrainte diff --git a/config/locales/time_tables.en.yml b/config/locales/time_tables.en.yml index e783f5b18..5127675e8 100644 --- a/config/locales/time_tables.en.yml +++ b/config/locales/time_tables.en.yml @@ -64,6 +64,8 @@ en: attributes: time_table: comment: "Name" + color: "Associated color" + bounding_dates: 'Global validity period' version: "Short name" day_types: "Period day types" none: "none" diff --git a/config/locales/time_tables.fr.yml b/config/locales/time_tables.fr.yml index d67227c26..dc4d4572f 100644 --- a/config/locales/time_tables.fr.yml +++ b/config/locales/time_tables.fr.yml @@ -64,6 +64,8 @@ fr: attributes: time_table: comment: "Nom" + color: "Couleur associée" + bounding_dates: 'Période de validité englobante' version: "Abréviation" day_types: "Jours d'application des périodes" none: "aucun" diff --git a/config/routes.rb b/config/routes.rb index 33f3961b1..538c069ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -123,6 +123,7 @@ ChouetteIhm::Application.routes.draw do end resources :vehicle_journey_imports resources :vehicle_journey_exports + resources :stop_points, only: :index, controller: 'route_stop_points' end resources :routing_constraint_zones end @@ -165,6 +166,7 @@ ChouetteIhm::Application.routes.draw do end member do get 'duplicate' + get 'month', defaults: { format: :json } end resources :time_table_dates resources :time_table_periods @@ -211,8 +213,11 @@ ChouetteIhm::Application.routes.draw do get '/help/(*slug)' => 'help#show' - get '/404', :to => 'errors#not_found' - get '/422', :to => 'errors#server_error' - get '/500', :to => 'errors#server_error' + if Rails.env.production? + get '404', to: 'errors#not_found' + get '403', to: 'errors#not_allowed' + get '422', to: 'errors#server_error' + get '500', to: 'errors#server_error' + end end |
