diff options
| author | Michel Etienne | 2012-08-27 08:46:22 +0200 |
|---|---|---|
| committer | Michel Etienne | 2012-08-27 08:46:22 +0200 |
| commit | 22bf3f20d2efbbcd86ecef48a1ae15fa48288577 (patch) | |
| tree | 2060354d444f93b74b450a98d7ecc0e2636b9337 | |
| parent | 553810c8fc20d0650e5540393c13a762ebd08bb7 (diff) | |
| download | chouette-core-22bf3f20d2efbbcd86ecef48a1ae15fa48288577.tar.bz2 | |
add copy from departure to arrivals and reverse in vehiclejourney
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | app/assets/javascripts/vehicle_journey.js.coffee | 25 | ||||
| -rw-r--r-- | app/assets/stylesheets/vehicle_journeys.css.scss | 17 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/_form.html.erb | 7 | ||||
| -rw-r--r-- | config/locales/vehicle_journeys.yml | 4 |
5 files changed, 52 insertions, 3 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 5e512e990..510325b95 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://chouette.dryade.priv/ninoxe - revision: c00153cdca8d69ed747b383ebcb60585f3ae390f + revision: cc7981838537c5ffd277380de518eee42ee5bc86 specs: ninoxe (0.0.8) GeoRuby diff --git a/app/assets/javascripts/vehicle_journey.js.coffee b/app/assets/javascripts/vehicle_journey.js.coffee new file mode 100644 index 000000000..c049b0782 --- /dev/null +++ b/app/assets/javascripts/vehicle_journey.js.coffee @@ -0,0 +1,25 @@ +jQuery -> + copy_departures_to_arrivals = (event) -> + event.preventDefault() + rows = $('.vehicle_journeys.edit tbody.journey_pattern_dependent_list tr') + for row in rows + do (row) -> + arrival = row.children[0] + departure = row.children[2] + arrival.children[0].value = departure.children[0].value + arrival.children[1].value = departure.children[1].value + + $('.vehicle_journeys.edit a.to_arrivals').click(copy_departures_to_arrivals) + + copy_arrivals_to_departures = (event) -> + event.preventDefault() + rows = $('.vehicle_journeys.edit tbody.journey_pattern_dependent_list tr') + for row in rows + do (row) -> + arrival = row.children[0] + departure = row.children[2] + departure.children[0].value = arrivals.children[0].value + departure.children[1].value = arrivals.children[1].value + + $('.vehicle_journeys.edit a.to_departures').click(copy_arrivals_to_departures) + diff --git a/app/assets/stylesheets/vehicle_journeys.css.scss b/app/assets/stylesheets/vehicle_journeys.css.scss index 5df48efbc..3843f15d0 100644 --- a/app/assets/stylesheets/vehicle_journeys.css.scss +++ b/app/assets/stylesheets/vehicle_journeys.css.scss @@ -39,8 +39,8 @@ th.title { text-align: left; - } - + } + td{ padding: 5px 7px 5px 7px; text-align: center; @@ -83,6 +83,19 @@ tr.odd { } tr.even { background-color: #DEFFA8; } } + tfoot { + tr { + background-color: #95CB3E; + } + td { + text-align: center; + a { + + color: white; + } + } + } + } } diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb index dada2c6ff..d06241973 100644 --- a/app/views/vehicle_journeys/_form.html.erb +++ b/app/views/vehicle_journeys/_form.html.erb @@ -20,6 +20,13 @@ <th class="hour title"><%= t('.departure') %></th> </tr> </thead> + <tfoot> + <tr> + <td class="title"> <a class="to_departures"><%= t('.to_departures') %></a></td> + <td class="title" ></td> + <td class="title"><a class="to_arrivals"><%= t('.to_arrivals') %></a></td> + </tr> + </tfoot> <!-- <= form.semantic_fields_for :vehicle_journey_at_stops do |vjas| > <= vjas.object.stop_point.stop_area.name > diff --git a/config/locales/vehicle_journeys.yml b/config/locales/vehicle_journeys.yml index c52dbb62a..4c643134b 100644 --- a/config/locales/vehicle_journeys.yml +++ b/config/locales/vehicle_journeys.yml @@ -18,6 +18,8 @@ en: stop_title: Stop departure: Departure arrival: Arrival + to_arrivals: Copy departures to arrivals + to_departures: Copy arrivals to departures time_tables: Associated calendars to vehicle journey timeless: title: Timeless vehicle journeys @@ -92,6 +94,8 @@ fr: stop_title: Arrêt departure: Départ arrival: Arrivée + to_arrivals: Copie départs vers arrivées + to_departures: Copie arrivées vers départs time_tables: Calendriers associés à la course timeless: title: Courses sans horaire |
