aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gemfile11
-rw-r--r--Gemfile.lock26
-rw-r--r--app/assets/javascripts/application.js3
-rw-r--r--app/assets/javascripts/jquery.ui.datepicker-i18n.js47
-rw-r--r--app/assets/stylesheets/application.css1
-rw-r--r--app/assets/stylesheets/formtastic.css145
-rw-r--r--app/assets/stylesheets/formtastic_changes.css14
-rw-r--r--app/assets/stylesheets/stop_points.css.scss8
-rw-r--r--app/views/companies/_form.erb9
-rw-r--r--app/views/connection_links/_form.erb9
-rw-r--r--app/views/connection_links/select_areas.html.erb9
-rw-r--r--app/views/journey_patterns/_form.html.erb9
-rw-r--r--app/views/layouts/application.html.erb2
-rw-r--r--app/views/lines/_form.erb9
-rw-r--r--app/views/networks/_form.erb9
-rw-r--r--app/views/referentials/_form.erb12
-rw-r--r--app/views/routes/_form.html.erb9
-rw-r--r--app/views/stop_areas/_form.html.erb8
-rw-r--r--app/views/stop_areas/add_children.html.erb9
-rw-r--r--app/views/stop_areas/select_parent.html.erb9
-rw-r--r--app/views/stop_points/index.html.erb7
-rw-r--r--app/views/time_table_dates/_form.html.erb10
-rw-r--r--app/views/time_table_periods/_form.html.erb9
-rw-r--r--app/views/time_tables/_form.erb9
-rw-r--r--app/views/vehicle_journeys/_form.html.erb9
-rw-r--r--config/locales/formtastic.yml10
-rw-r--r--config/locales/fr.yml4
27 files changed, 148 insertions, 268 deletions
diff --git a/Gemfile b/Gemfile
index a49bb494a..3363d1e4b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,7 +1,6 @@
source 'http://rubygems.org'
gem 'rails', '3.1.3'
-gem 'jquery-rails'
gem 'devise'
gem "ffi-proj4", :git => 'git://github.com/dryade/ffi-proj4.git'
@@ -10,6 +9,7 @@ platforms :jruby do
gem 'activerecord-jdbcpostgresql-adapter', :git => 'git://github.com/dryade/activerecord-jdbc-adapter.git'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'
+ gem "jruby-rack-worker"
gem 'warbler'
gem "jruby-rack-worker"
end
@@ -26,21 +26,22 @@ gem "georuby-ext", :git => 'git://github.com/dryade/georuby-ext.git'
gem 'user_interface', :git => 'git://sim.dryade.priv/user_interface'
gem 'json'
gem 'cocoon'
-gem 'formtastic', '2.0.2'
+gem 'formtastic'
gem 'inherited_resources'
gem 'will_paginate', '~> 3.0'
-# gem 'will-paginate-i18n','~> 0.1.5'
gem 'ransack'
gem 'squeel'
gem 'RedCloth'
+gem 'jquery-rails'
+gem 'modernizr'
gem "acts_as_tree", :git => "git://github.com/dryade/acts_as_tree.git"
-gem 'apartment', :git => 'git://github.com/dryade/apartment.git'
gem 'ninoxe', :git => 'git://chouette.dryade.priv/ninoxe' #, :path => '~/Projects/Ninoxe'
gem 'acts_as_list', '0.1.6'
-gem 'composite_primary_keys', '4.1.2'
+gem 'composite_primary_keys', '4.1.2'
gem 'delayed_job_active_record'
+gem 'apartment', :path => '~/projects/apartment' #,:git => 'git://github.com/dryade/apartment.git'
# Gems used only for assets and not required
# in production environments by default.
diff --git a/Gemfile.lock b/Gemfile.lock
index ea51bb146..9ce1d076b 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -35,12 +35,6 @@ GIT
activerecord (>= 3.0.0)
GIT
- remote: git://github.com/dryade/apartment.git
- revision: cd6185f55eb6d9df958599825e848af4e12a9eae
- specs:
- apartment (0.14.1)
-
-GIT
remote: git://github.com/dryade/ffi-proj4.git
revision: b3d868126f939030912dcf048c9fe1b54a2ad761
specs:
@@ -69,11 +63,18 @@ GIT
GIT
remote: git://sim.dryade.priv/user_interface
- revision: c75665070cace889923bea6a0fb1f7ff724d1368
+ revision: 864d4d6e566674af74d37fc507985b31b03e239e
specs:
user_interface (0.0.1)
rails (~> 3.1.0)
+PATH
+ remote: ~/projects/apartment
+ specs:
+ apartment (0.16.0)
+ activerecord (>= 3.1.2)
+ rack (>= 1.3.6)
+
GEM
remote: http://rubygems.org/
specs:
@@ -169,8 +170,8 @@ GEM
ffi (1.0.11-java)
ffi-geos (0.0.4)
ffi (~> 1.0.0)
- formtastic (2.0.2)
- rails (~> 3.0)
+ formtastic (2.2.1)
+ actionpack (>= 3.0)
geokit (1.6.5)
multi_json
georuby (1.9.7)
@@ -217,7 +218,9 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
map_layers (0.0.5)
- mime-types (1.18)
+ mime-types (1.19)
+ modernizr (2.5.3)
+ sprockets (~> 2.0)
multi_json (1.3.6)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
@@ -368,7 +371,7 @@ DEPENDENCIES
devise
factory_girl_rails (= 1.7)
ffi-proj4!
- formtastic (= 2.0.2)
+ formtastic
georuby-ext!
guard
guard-rspec
@@ -379,6 +382,7 @@ DEPENDENCIES
json
launchy
map_layers (~> 0.0.4)
+ modernizr
ninoxe!
pg (~> 0.11.0)
rails (= 3.1.3)
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
index ebe1bb0e4..86507b03e 100644
--- a/app/assets/javascripts/application.js
+++ b/app/assets/javascripts/application.js
@@ -7,5 +7,6 @@
//= require jquery
//= require jquery_ujs
//= require jquery-ui
+//= require modernizr
+//= require cocoon
//= require_tree .
-//= require cocoon \ No newline at end of file
diff --git a/app/assets/javascripts/jquery.ui.datepicker-i18n.js b/app/assets/javascripts/jquery.ui.datepicker-i18n.js
new file mode 100644
index 000000000..637c7b999
--- /dev/null
+++ b/app/assets/javascripts/jquery.ui.datepicker-i18n.js
@@ -0,0 +1,47 @@
+/* French initialisation for the jQuery UI date picker plugin. */
+/* Written by Keith Wood (kbwood{at}iinet.com.au) and Stéphane Nahmani (sholby@sholby.net). */
+jQuery(function($){
+
+ $.datepicker.regional['fr'] = {
+ closeText: 'Fermer',
+ prevText: '<Préc',
+ nextText: 'Suiv>',
+ currentText: 'Courant',
+ monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin',
+ 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
+ monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
+ 'Jul','Aoû','Sep','Oct','Nov','Déc'],
+ dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
+ dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
+ dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
+ weekHeader: 'Sm',
+ dateFormat: 'dd/mm/yy',
+ firstDay: 1,
+ isRTL: false,
+ showMonthAfterYear: false,
+ yearSuffix: ''};
+
+ $.datepicker.regional['en'] = {
+ closeText: 'Done',
+ prevText: 'Prev',
+ nextText: 'Next',
+ currentText: 'Today',
+ monthNames: ['January','February','March','April','May','June',
+ 'July','August','September','October','November','December'],
+ monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
+ dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'],
+ weekHeader: 'Wk',
+ dateFormat: 'dd/mm/yy',
+ firstDay: 1,
+ isRTL: false,
+ showMonthAfterYear: false,
+ yearSuffix: ''};
+
+ $.datepicker.setDefaults($.datepicker.regional[ "" ]);
+ $("input[type='date']").datepicker( $.datepicker.regional[ "fr" ] );
+ $("input[type='date']").datepicker( "option", $.datepicker.regional[ $('html').attr('lang') ] );
+
+});
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index b17893104..7a73fd3fe 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -3,6 +3,7 @@
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
+ *= require formtastic
*= require jquery-ui
*= require_tree .
*/ \ No newline at end of file
diff --git a/app/assets/stylesheets/formtastic.css b/app/assets/stylesheets/formtastic.css
deleted file mode 100644
index 91540c74b..000000000
--- a/app/assets/stylesheets/formtastic.css
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -------------------------------------------------------------------------------------------------
-
-It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
-this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
-This will allow you to update formtastic.css with new releases without clobbering your own changes.
-
-This stylesheet forms part of the Formtastic Rails Plugin
-(c) 2008 Justin French
-
---------------------------------------------------------------------------------------------------*/
-
-
-/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just form.formtastic
---------------------------------------------------------------------------------------------------*/
-form.formtastic, form.formtastic ul, form.formtastic ol, form.formtastic li, form.formtastic fieldset, form.formtastic legend, form.formtastic input, form.formtastic textarea, form.formtastic select, form.formtastic p { margin:0; padding:0; }
-form.formtastic fieldset { border:0; }
-form.formtastic em, form.formtastic strong { font-style:normal; font-weight:normal; }
-form.formtastic ol, form.formtastic ul { list-style:none; }
-form.formtastic abbr, form.formtastic acronym { border:0; font-variant:normal; }
-form.formtastic input, form.formtastic textarea, form.formtastic select { font-family:inherit; font-size:inherit; font-weight:inherit; }
-form.formtastic input, form.formtastic textarea, form.formtastic select { font-size:100%; }
-form.formtastic legend { white-space:normal; color:#000; }
-
-
-/* SEMANTIC ERRORS
---------------------------------------------------------------------------------------------------*/
-form.formtastic ul.errors { color:#cc0000; margin:0.5em 0 1.5em 25%; list-style:square; }
-form.formtastic ul.errors li { padding:0; border:none; display:list-item; }
-
-
-/* FIELDSETS & LISTS
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset { overflow:auto; } /* clearing contained floats */
-form.formtastic fieldset.inputs { }
-form.formtastic fieldset.buttons { padding-left:25%; }
-form.formtastic fieldset ol { }
-form.formtastic fieldset.buttons li { float:left; padding-right:0.5em; }
-
-/* INPUT LIs
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li { padding:0.5em 0; margin-top:-0.5em; margin-bottom:1em; } /* padding and negative margin juggling is for Firefox */
-form.formtastic fieldset > ol > li { overflow:auto; } /* clearing contained floats */
-
-form.formtastic fieldset > ol > li.required { }
-form.formtastic fieldset > ol > li.optional { }
-form.formtastic fieldset > ol > li.error { }
-
-
-/* LABELS
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li label { display:block; width:25%; float:left; padding-top:.2em; }
-form.formtastic fieldset > ol > li > li label { line-height:100%; padding-top:0; }
-form.formtastic fieldset > ol > li > li label input { line-height:100%; vertical-align:middle; margin-top:-0.1em;}
-
-
-/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li fieldset { position:relative; }
-form.formtastic fieldset > ol > li fieldset legend { position:absolute; width:95%; padding-top:0.1em; left: 0px; }
-form.formtastic fieldset > ol > li fieldset legend span { position:absolute; }
-form.formtastic fieldset > ol > li fieldset legend.label label { position:absolute; }
-form.formtastic fieldset > ol > li fieldset ol { float:left; width:74%; margin:0; padding:0 0 0 25%; }
-form.formtastic fieldset > ol > li fieldset ol li { padding:0; border:0; }
-
-
-/* INLINE HINTS
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li p.inline-hints { color:#666; margin:0.5em 0 0 25%; }
-
-
-/* INLINE ERRORS
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li p.inline-errors { color:#cc0000; margin:0.5em 0 0 25%; }
-form.formtastic fieldset > ol > li ul.errors { color:#cc0000; margin:0.5em 0 0 25%; list-style:square; }
-form.formtastic fieldset > ol > li ul.errors li { padding:0; border:none; display:list-item; }
-
-
-/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE & SEARCH OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li.string input,
-form.formtastic fieldset > ol > li.password input,
-form.formtastic fieldset > ol > li.numeric input,
-form.formtastic fieldset > ol > li.email input,
-form.formtastic fieldset > ol > li.url input,
-form.formtastic fieldset > ol > li.phone input,
-form.formtastic fieldset > ol > li.search input { width:72%; }
-
-form.formtastic fieldset > ol > li.string input[size],
-form.formtastic fieldset > ol > li.password input[size],
-form.formtastic fieldset > ol > li.numeric input[size],
-form.formtastic fieldset > ol > li.email input[size],
-form.formtastic fieldset > ol > li.url input[size],
-form.formtastic fieldset > ol > li.phone input[size],
-form.formtastic fieldset > ol > li.search input[size] { width:auto; max-width:72%; }
-
-
-/* TEXTAREA OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li.text textarea { width:72%; }
-form.formtastic fieldset > ol > li.text textarea[cols] { width:auto; max-width:72%; }
-
-
-/* HIDDEN OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset ol li.hidden { display:none; }
-
-/* BOOLEAN OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li.boolean label { padding-left:25%; width:auto; }
-form.formtastic fieldset > ol > li.boolean label input { margin:0 0.5em 0 0.2em; }
-
-
-/* RADIO OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li.radio { }
-form.formtastic fieldset > ol > li.radio fieldset { overflow:visible; }
-form.formtastic fieldset > ol > li.radio fieldset ol { margin-bottom:-0.5em; }
-form.formtastic fieldset > ol > li.radio fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
-form.formtastic fieldset > ol > li.radio fieldset ol li label { float:none; width:100%; }
-form.formtastic fieldset > ol > li.radio fieldset ol li label input { margin-right:0.2em; }
-
-
-/* CHECK BOXES (COLLECTION) OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li.check_boxes { }
-form.formtastic fieldset > ol > li.check_boxes fieldset { overflow:visible; }
-form.formtastic fieldset > ol > li.check_boxes fieldset ol { margin-bottom:-0.5em; }
-form.formtastic fieldset > ol > li.check_boxes fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
-form.formtastic fieldset > ol > li.check_boxes fieldset ol li label { float:none; width:100%; }
-form.formtastic fieldset > ol > li.check_boxes fieldset ol li label input { margin-right:0.2em; }
-
-
-/* DATE & TIME OVERRIDES
---------------------------------------------------------------------------------------------------*/
-form.formtastic fieldset > ol > li.date fieldset ol li,
-form.formtastic fieldset > ol > li.time fieldset ol li,
-form.formtastic fieldset > ol > li.datetime fieldset ol li { float:left; width:auto; margin:0 .3em 0 0; }
-
-form.formtastic fieldset > ol > li.date fieldset ol li label,
-form.formtastic fieldset > ol > li.time fieldset ol li label,
-form.formtastic fieldset > ol > li.datetime fieldset ol li label { display:none; }
-
-form.formtastic fieldset > ol > li.date fieldset ol li label input,
-form.formtastic fieldset > ol > li.time fieldset ol li label input,
-form.formtastic fieldset > ol > li.datetime fieldset ol li label input { display:inline; margin:0; padding:0; }
diff --git a/app/assets/stylesheets/formtastic_changes.css b/app/assets/stylesheets/formtastic_changes.css
deleted file mode 100644
index 8a044fab6..000000000
--- a/app/assets/stylesheets/formtastic_changes.css
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -------------------------------------------------------------------------------------------------
-
-Load this stylesheet after formtastic.css in your layouts to override the CSS to suit your needs.
-This will allow you to update formtastic.css with new releases without clobbering your own changes.
-
-For example, to make the inline hint paragraphs a little darker in color than the standard #666:
-
-form.formtastic fieldset > ol > li p.inline-hints { color:#333; }
-
-HINT:
-The following style may be *conditionally* included for improved support on older versions of IE(<8)
-form.formtastic fieldset ol li fieldset legend { margin-left: -6px;}
-
---------------------------------------------------------------------------------------------------*/
diff --git a/app/assets/stylesheets/stop_points.css.scss b/app/assets/stylesheets/stop_points.css.scss
index 73fc22aef..939ac1070 100644
--- a/app/assets/stylesheets/stop_points.css.scss
+++ b/app/assets/stylesheets/stop_points.css.scss
@@ -15,14 +15,8 @@
.stop_points:after {
@include content_to_clear;
}
-
- .formtastic .buttons {
- a {
- margin-top: 0px;
- }
- }
- .stop_point {
+ #sortable_stop_points .stop_point {
@include div_for_object;
/* to create multi-column index */
width: 350px;
diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb
index bea95b0b4..d7274cbd9 100644
--- a/app/views/companies/_form.erb
+++ b/app/views/companies/_form.erb
@@ -19,9 +19,8 @@
<% end %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/connection_links/_form.erb b/app/views/connection_links/_form.erb
index 31c3e3bde..50abadce7 100644
--- a/app/views/connection_links/_form.erb
+++ b/app/views/connection_links/_form.erb
@@ -23,9 +23,8 @@
<% end %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/connection_links/select_areas.html.erb b/app/views/connection_links/select_areas.html.erb
index 2df3831b4..6c6f4dedf 100644
--- a/app/views/connection_links/select_areas.html.erb
+++ b/app/views/connection_links/select_areas.html.erb
@@ -7,11 +7,10 @@
<%= form.input :arrival_id, :as => :text, :input_html => { :"data-pre" => ( @arrival.present? ? [ { :id => @arrival.id.to_s, :name => "#{@arrival.name} [#{@arrival.country_code}]" } ]: [] ).to_json } %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <%= t('or') %>
- <%= link_to t('cancel'), [@referential, @connection_link] %>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
</div>
<% end %>
diff --git a/app/views/journey_patterns/_form.html.erb b/app/views/journey_patterns/_form.html.erb
index b6c37ab1b..850998830 100644
--- a/app/views/journey_patterns/_form.html.erb
+++ b/app/views/journey_patterns/_form.html.erb
@@ -15,10 +15,9 @@
<% end %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 437aad3a7..4318d7484 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html>
+<html lang="<%= I18n.locale %>">
<head>
<title>Chouette V2 - <%= title %></title>
<%= stylesheet_link_tag :application %>
diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb
index ed0e4f9a2..400c68b7c 100644
--- a/app/views/lines/_form.erb
+++ b/app/views/lines/_form.erb
@@ -19,9 +19,8 @@
<% end %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/networks/_form.erb b/app/views/networks/_form.erb
index 32c131ca3..cf1764136 100644
--- a/app/views/networks/_form.erb
+++ b/app/views/networks/_form.erb
@@ -17,9 +17,8 @@
<% end %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/referentials/_form.erb b/app/views/referentials/_form.erb
index c82649909..d794d828c 100644
--- a/app/views/referentials/_form.erb
+++ b/app/views/referentials/_form.erb
@@ -16,12 +16,10 @@
<% if @referential.new_record? %>
<%= form.input :resources, :as => :file %>
<% end %>
- <% end %>
+ <% end %>
-
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('back'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb
index 96a681b13..5b383a9d9 100644
--- a/app/views/routes/_form.html.erb
+++ b/app/views/routes/_form.html.erb
@@ -17,10 +17,9 @@
<% end %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb
index 81878101a..c4d4c5797 100644
--- a/app/views/stop_areas/_form.html.erb
+++ b/app/views/stop_areas/_form.html.erb
@@ -27,8 +27,8 @@
<%= form.input :latitude %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- ou <%= link_to t('cancel'), [@referential, @stop_area] %>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/stop_areas/add_children.html.erb b/app/views/stop_areas/add_children.html.erb
index ff3323dab..6f637086c 100644
--- a/app/views/stop_areas/add_children.html.erb
+++ b/app/views/stop_areas/add_children.html.erb
@@ -6,11 +6,10 @@
<%= form.input :children_ids, :as => :text, :input_html => { :"data-pre" => ( @children.map { |child| { :id => child.id.to_s, :name => "#{child.name} #{child.country_code}" } } ).to_json } %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <%= t('or') %>
- <%= link_to t('cancel'), [@referential, @stop_area] %>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
</div>
<% end %>
diff --git a/app/views/stop_areas/select_parent.html.erb b/app/views/stop_areas/select_parent.html.erb
index 26baf984a..fedd83446 100644
--- a/app/views/stop_areas/select_parent.html.erb
+++ b/app/views/stop_areas/select_parent.html.erb
@@ -6,11 +6,10 @@
<%= form.input :parent_id, :as => :text, :input_html => { :"data-pre" => ( @parent.present? ? [ { :id => @parent.id.to_s, :name => "#{@parent.name} #{@parent.country_code}" } ]: [] ).to_json } %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <%= t('or') %>
- <%= link_to t('cancel'), [@referential, @stop_area] %>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
</div>
<% end %>
diff --git a/app/views/stop_points/index.html.erb b/app/views/stop_points/index.html.erb
index 6f3b69ae0..486aefb5f 100644
--- a/app/views/stop_points/index.html.erb
+++ b/app/views/stop_points/index.html.erb
@@ -26,10 +26,9 @@
<% @stop_points.each do |sp| %>
<input type="hidden" id="<%= "pos_#{sp.position}" %>" name="stop_point[]" value="<%= sp.id %>" />
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button t('.reorder_button') %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), referential_line_route_stop_points_path(@referential, @line, @route) %></li>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button, :label => t('.reorder_button') %>
+ <%= form.action :cancel, :as => :link , :url => referential_line_route_stop_points_path(@referential, @line, @route) %>
<% end %>
<% end %>
</div>
diff --git a/app/views/time_table_dates/_form.html.erb b/app/views/time_table_dates/_form.html.erb
index c0218eb64..decc0b3cc 100644
--- a/app/views/time_table_dates/_form.html.erb
+++ b/app/views/time_table_dates/_form.html.erb
@@ -1,11 +1,11 @@
<%= semantic_form_for [@referential, @time_table, @time_table_date] do |form| %>
<%= form.inputs do %>
<%= form.input :date, :as => :date, :label => @time_table_date.human_attribute_name("date") %>
+
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/time_table_periods/_form.html.erb b/app/views/time_table_periods/_form.html.erb
index 6f390c7d5..71f8f3fd1 100644
--- a/app/views/time_table_periods/_form.html.erb
+++ b/app/views/time_table_periods/_form.html.erb
@@ -3,10 +3,9 @@
<%= form.input :period_start, :as => :date, :label => @time_table_period.human_attribute_name("period_start") %>
<%= form.input :period_end, :as => :date, :label => @time_table_period.human_attribute_name("period_end") %>
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
diff --git a/app/views/time_tables/_form.erb b/app/views/time_tables/_form.erb
index 59cc30947..f72e081da 100644
--- a/app/views/time_tables/_form.erb
+++ b/app/views/time_tables/_form.erb
@@ -24,11 +24,10 @@
<% end %>
<% end %>
<p/>
- <%= form.buttons do %>
- <%= form.commit_button %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
<h3 class="dates"><%= t('.dates') %></h3>
<%= render "dates" %>
diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb
index 582253b0f..f314e0453 100644
--- a/app/views/vehicle_journeys/_form.html.erb
+++ b/app/views/vehicle_journeys/_form.html.erb
@@ -48,11 +48,10 @@
<% end %>
- <%= form.buttons do %>
- <%= form.commit_button true %>
- <li><%= t('or') %></li>
- <li><%= link_to t('cancel'), :back %></li>
- <% end %>
+ <%= form.actions do %>
+ <%= form.action :submit, :as => :button %>
+ <%= form.action :cancel, :as => :link %>
+ <% end %>
<% end %>
<% unless @vehicle_journey.new_record? %>
diff --git a/config/locales/formtastic.yml b/config/locales/formtastic.yml
new file mode 100644
index 000000000..539645241
--- /dev/null
+++ b/config/locales/formtastic.yml
@@ -0,0 +1,10 @@
+fr:
+ formtastic:
+ yes: 'Oui'
+ no: 'Non'
+ create: "Créer %{model}"
+ update: "Modifier %{model}"
+ submit: 'Valider %{model}'
+ cancel: 'Annuler %{model}'
+ reset: 'Réinitialiser %{model}'
+ required: 'required' \ No newline at end of file
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index bbfacc0df..79eb8a110 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -188,10 +188,6 @@ fr:
yesterday: "Hier"
edit_periods: "Editer Périodes"
delete_periods: "Supprimer Périodes"
- formtastic:
- actions:
- create: "Créer %{model}"
- update: "Modifier %{model}"
attributes:
author: "Modifié par"
created_at: "Créé le"