diff options
| author | Alban Peignier | 2018-01-02 10:44:39 +0100 | 
|---|---|---|
| committer | GitHub | 2018-01-02 10:44:39 +0100 | 
| commit | 6f95f17f3927a3ba997dfe7196dd4c2eaf9894e8 (patch) | |
| tree | 3c432dfac7917039d6c013185686a30fcbf049f5 | |
| parent | 2d904d7394854ec2cdf1320c06364dbb3e1c6394 (diff) | |
| parent | 2a6f499c0d47428d9bfddfc5375beb10d4385da3 (diff) | |
| download | chouette-core-6f95f17f3927a3ba997dfe7196dd4c2eaf9894e8.tar.bz2 | |
Merge pull request #190 from af83/5427_stop_area_country_select
Add StopArea country select. Refs #5427 
| -rw-r--r-- | Gemfile | 1 | ||||
| -rw-r--r-- | Gemfile.lock | 16 | ||||
| -rw-r--r-- | app/views/stop_areas/_form.html.slim | 2 | ||||
| -rw-r--r-- | app/views/stop_areas/show.html.slim | 1 | ||||
| -rw-r--r-- | config/locales/stop_areas.en.yml | 2 | ||||
| -rw-r--r-- | config/locales/stop_areas.fr.yml | 2 | 
6 files changed, 21 insertions, 3 deletions
| @@ -100,6 +100,7 @@ gem 'simple_form', '~> 3.1.0'  gem 'font-awesome-sass', '~> 4.7'  gem 'will_paginate-bootstrap'  gem 'gretel' +gem 'country_select'  # Format Output  gem 'json' diff --git a/Gemfile.lock b/Gemfile.lock index 9c59016e6..ade052d8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -146,6 +146,14 @@ GEM      coffee-script-source (1.12.2)      concurrent-ruby (1.0.5)      connection_pool (2.2.1) +    countries (2.1.3) +      i18n_data (~> 0.8.0) +      money (~> 6.9) +      sixarm_ruby_unaccent (~> 1.1) +      unicode_utils (~> 1.4) +    country_select (3.1.1) +      countries (~> 2.0) +      sort_alphabetical (~> 1.0)      crack (0.4.3)        safe_yaml (~> 1.0.0)      cucumber (2.4.0) @@ -269,6 +277,7 @@ GEM        parser (>= 2.2.3.0)        rainbow (~> 2.2)        terminal-table (>= 1.5.1) +    i18n_data (0.8.0)      inherited_resources (1.7.1)        actionpack (>= 3.2, < 5.1)        has_scope (~> 0.6) @@ -305,6 +314,8 @@ GEM      mimemagic (0.3.2)      mini_portile2 (2.3.0)      minitest (5.10.3) +    money (6.10.1) +      i18n (>= 0.6.4, < 1.0)      multi_json (1.12.1)      multi_test (0.1.2)      multi_xml (0.6.0) @@ -487,6 +498,7 @@ GEM        rack (~> 1.5)        rack-protection (~> 1.4)        tilt (>= 1.3, < 3) +    sixarm_ruby_unaccent (1.2.0)      slim (3.0.7)        temple (~> 0.7.6)        tilt (>= 1.3.3, < 2.1) @@ -495,6 +507,8 @@ GEM        railties (>= 3.1)        slim (~> 3.0)      slop (3.6.0) +    sort_alphabetical (1.1.0) +      unicode_utils (>= 1.2.2)      spring (2.0.1)        activesupport (>= 4.2)      spring-commands-rspec (1.0.4) @@ -537,6 +551,7 @@ GEM        execjs (>= 0.3.0)        json (>= 1.8.0)      unicode-display_width (1.3.0) +    unicode_utils (1.4.0)      warden (1.2.7)        rack (>= 1.0)      webmock (3.0.1) @@ -584,6 +599,7 @@ DEPENDENCIES    cocoon    codifligne!    coffee-rails (~> 4.0.0) +  country_select    cucumber-rails    daemons    database_cleaner diff --git a/app/views/stop_areas/_form.html.slim b/app/views/stop_areas/_form.html.slim index ef19d248a..af8b9d889 100644 --- a/app/views/stop_areas/_form.html.slim +++ b/app/views/stop_areas/_form.html.slim @@ -22,9 +22,9 @@            = f.input :coordinates, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")}, required: true            = f.input :street_name -          /= f.input :country_code, required: format_restriction_for_locales(@referential) == '.hub'            = f.input :zip_code, :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")}            = f.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => {:title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} +          = f.input :country_code, as: :country, priority: ['FR', 'GB', 'DE', 'ES'], :include_blank => true          .stop_areas.stop_area.general_info            h3 = t("stop_areas.stop_area.general") diff --git a/app/views/stop_areas/show.html.slim b/app/views/stop_areas/show.html.slim index 238a45b6b..f9de34a98 100644 --- a/app/views/stop_areas/show.html.slim +++ b/app/views/stop_areas/show.html.slim @@ -24,6 +24,7 @@          - attributes.merge!({ "Coordonnées" => geo_data(@stop_area, @stop_area_referential),              @stop_area.human_attribute_name(:zip_code) => @stop_area.zip_code,              @stop_area.human_attribute_name(:city_name) => @stop_area.city_name, +            @stop_area.human_attribute_name(:country_code) => @stop_area.country_code.presence || '-',              'Etat' => (@stop_area.deleted_at ? 'Supprimé' : 'Actif'),              @stop_area.human_attribute_name(:comment) => @stop_area.try(:comment),              }) diff --git a/config/locales/stop_areas.en.yml b/config/locales/stop_areas.en.yml index f6fe97c9a..69f7c7e99 100644 --- a/config/locales/stop_areas.en.yml +++ b/config/locales/stop_areas.en.yml @@ -104,7 +104,7 @@ en:          area_type: "Area type"          nearest_topic_name: "Nearest point of interest"          street_name: "Street name" -        country_code: "INSEE code" +        country_code: "Country"          fare_code: "Fare code"          mobility_restricted_suitability: "Mobility reduced passenger suitable"          stairs_availability: "Escalator" diff --git a/config/locales/stop_areas.fr.yml b/config/locales/stop_areas.fr.yml index 9dd7e0264..f6664afa8 100644 --- a/config/locales/stop_areas.fr.yml +++ b/config/locales/stop_areas.fr.yml @@ -104,7 +104,7 @@ fr:          area_type: "Type d'arrêt"          nearest_topic_name: "Point d'intérêt le plus proche"          street_name: "Nom de la rue" -        country_code: "Code INSEE" +        country_code: "Pays"          fare_code: "Zone tarifaire"          mobility_restricted_suitability: "Accès pour voyageur à mobilité réduite"          stairs_availability: "Escalator" | 
