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 /app | |
| parent | 553810c8fc20d0650e5540393c13a762ebd08bb7 (diff) | |
| download | chouette-core-22bf3f20d2efbbcd86ecef48a1ae15fa48288577.tar.bz2 | |
add copy from departure to arrivals and reverse in vehiclejourney
Diffstat (limited to 'app')
| -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 |
3 files changed, 47 insertions, 2 deletions
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 > |
