diff options
| author | Marc Florisson | 2012-06-18 10:06:20 +0200 |
|---|---|---|
| committer | Marc Florisson | 2012-06-18 10:06:20 +0200 |
| commit | ed9f7d1fde2bdb1440d14aa80432a6ea7f06863f (patch) | |
| tree | 7c620c2283682c356e714fb693144157f6dadd08 | |
| parent | 47c36435bc3d3f485cde9a61731ce1d0980c603a (diff) | |
| download | chouette-core-ed9f7d1fde2bdb1440d14aa80432a6ea7f06863f.tar.bz2 | |
fix vehicle views
5 files changed, 15 insertions, 22 deletions
diff --git a/app/assets/stylesheets/vehicle_journeys.css.scss b/app/assets/stylesheets/vehicle_journeys.css.scss index 32d9e4d13..0bfabc38b 100644 --- a/app/assets/stylesheets/vehicle_journeys.css.scss +++ b/app/assets/stylesheets/vehicle_journeys.css.scss @@ -69,15 +69,15 @@ th { text-align: center; } th.hour { width: 130px; } tr { - background-color: #75B80D; + background-color: #95CB3E; color: white; } } tbody { td.hour { text-align: center; } tr label { width: 100% } - tr.odd { background-color: #BDF366; } - tr.even { background-color: #85CF10; } + tr.odd { } + tr.even { background-color: #DEFFA8; } } } } diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb index e551d6963..582253b0f 100644 --- a/app/views/vehicle_journeys/_form.html.erb +++ b/app/views/vehicle_journeys/_form.html.erb @@ -18,12 +18,12 @@ <% end %> <%= form.inputs :class => "stop_times", :name => @vehicle_journey.human_attribute_name(:vehicle_journey_at_stop_ids) do %> - <table border="1" class="vehicle_journey_at_stops"> + <table border="0" class="vehicle_journey_at_stops"> <thead> <tr> + <th class="hour title"><%= t('.arrival') %></th> <th class="stop title" ><%= t('.stop_title') %></th> <th class="hour title"><%= t('.departure') %></th> - <th class="hour title"><%= t('.arrival') %></th> </tr> </thead> <!-- diff --git a/app/views/vehicle_journeys/_vehicle_journey_at_stop.html.erb b/app/views/vehicle_journeys/_vehicle_journey_at_stop.html.erb deleted file mode 100644 index 5af8dfaf7..000000000 --- a/app/views/vehicle_journeys/_vehicle_journey_at_stop.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= div_for(vehicle_journey_at_stop, :class => "vehicle_journey_at_stop") do %> - <span class="stop_name"> - <%= link_to vehicle_journey_at_stop.stop_point.stop_area.name, [@referential, vehicle_journey_at_stop.stop_point.stop_area] %> - </span><%= l(vehicle_journey_at_stop.departure_time, :format => :hour) %> -<% end %> - diff --git a/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb b/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb index a8456bc22..f6feab945 100644 --- a/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb +++ b/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb @@ -1,7 +1,10 @@ <% vjas = vehicle_journey_at_stop %> <tr class="time input optional <%= vjas._destroy ? "no_stop" : "" %> <%= (vehicle_journey_at_stop_counter%2==0) ? "odd" : "even" %>"> <td> - <%= vehicle_journey_at_stop_counter %> + <%= select_hour(vjas.arrival_time ? vjas.arrival_time.hour : 0, :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(4i)]") %> + <%= select_minute(vjas.arrival_time ? vjas.arrival_time.min : 0, :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(5i)]") %> + </td> + <td> <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][id]" %> type="hidden" value="<%= vjas.id %>"> <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][_destroy]" %> type="hidden" value="<%= vjas._destroy ? "1" : "0" %>"> <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][stop_point_id]" %> type="hidden" value="<%= vjas.stop_point_id %>"> @@ -12,14 +15,10 @@ <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}]arrival_time(2i)]" %> type="hidden" value="1"> <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{vehicle_journey_at_stop_counter}][arrival_time(1i)]" %> type="hidden" value="2000"> <label for=<%= "vehicle_journey_vehicle_journey_at_stops_attributes_#{vehicle_journey_at_stop_counter}_departure_time_5i" %>><%= vjas.stop_point.stop_area.name %></label> - </td> - <td> + </td> + <td> <%= select_hour(vjas.departure_time ? vjas.departure_time.hour : 0, :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(4i)]") %> <%= select_minute(vjas.departure_time ? vjas.departure_time.min : 0, :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][departure_time(5i)]") %> - </td> - <td> - <%= select_hour(vjas.arrival_time ? vjas.arrival_time.hour : 0, :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(4i)]") %> - <%= select_minute(vjas.arrival_time ? vjas.arrival_time.min : 0, :prefix => "vehicle_journey", :field_name => "vehicle_journey_at_stops_attributes[#{vehicle_journey_at_stop_counter}][arrival_time(5i)]") %> - </td> - </tr> + </td> +</tr> diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb index 73c4cb6ae..06f6f0c9f 100644 --- a/app/views/vehicle_journeys/show.html.erb +++ b/app/views/vehicle_journeys/show.html.erb @@ -57,17 +57,17 @@ <table border="0" > <thead> <tr> + <th class="hour title"><%= t('.arrival') %></th> <th class="stop title" ><%= t('.stop_title') %></th> <th class="hour title"><%= t('.departure') %></th> - <th class="hour title"><%= t('.arrival') %></th> </tr> <thead> <tbody> <% @vehicle_journey.vehicle_journey_at_stops.each_with_index do |vjas, index| %> <tr class="<%= index%2==0 ? "odd" : "even" %>"> + <td class="hour"><%= vjas.arrival_time ? l( vjas.arrival_time, :format => :hour) : "" %></td> <td><%= link_to vjas.stop_point.stop_area.name, [@referential, vjas.stop_point.stop_area] %></td> <td class="hour"><%= vjas.departure_time ? l( vjas.departure_time, :format => :hour) : "" %></td> - <td class="hour"><%= vjas.arrival_time ? l( vjas.arrival_time, :format => :hour) : "" %></td> </tr> <% end %> </tbody> |
