diff options
| -rw-r--r-- | Gemfile.lock | 3 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/index.html.erb | 16 | ||||
| -rw-r--r-- | config/locales/vehicle_journeys.yml | 4 | ||||
| -rw-r--r-- | spec/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb_spec.rb | 18 |
4 files changed, 27 insertions, 14 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index 515816731..68889cf74 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: git://chouette.dryade.priv/ninoxe - revision: b873a0f2de6ec4358148dc6c1400a34baf2343a3 + revision: d9c03d4ae42f1bc229949504f0002954b3f6caee specs: ninoxe (0.0.8) GeoRuby @@ -190,7 +190,6 @@ GEM jruby-rack (1.1.6) jruby-rack-worker (0.3-java) jruby-rack (>= 1.0.1) - json (1.7.3) json (1.7.3-java) json_pure (1.7.3) launchy (2.1.0) diff --git a/app/views/vehicle_journeys/index.html.erb b/app/views/vehicle_journeys/index.html.erb index 6e126e64c..c71b82824 100644 --- a/app/views/vehicle_journeys/index.html.erb +++ b/app/views/vehicle_journeys/index.html.erb @@ -10,8 +10,8 @@ <label><%= Chouette::Route.model_name.human %>: </label> <%= link_to @route.name, [@referential, @line, @route] %> </p> - <div> -<div> + </div> +</div> <h3 class="vehicle_journeys"><%= t('.vehicle_journeys') %></h3> <div class="pagination"> <div class="page_info"> @@ -59,8 +59,18 @@ <% content_for :sidebar do %> <ul class="actions"> <li> - <%= link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), :class => "link" %> + <%= link_to t('vehicle_journeys.actions.new'), new_referential_line_route_vehicle_journey_path(@referential, @line, @route), :class => "add" %> </li> </ul> +<h3><%= t(".selection") %></h3> + +<h4><%= Chouette::JourneyPattern.model_name.human.pluralize %></h4> + +<ul class="selection"> +<% @route.journey_patterns.each do |journey_pattern| %> +<li><%= link_with_search journey_pattern.name, "journey_pattern_id_eq" => journey_pattern.id %></li> <% end %> +<li><%= link_with_search t(".selection_all"), {"journey_pattern_id_eq" => nil}, :class => "all" %></li> +</ul> + diff --git a/config/locales/vehicle_journeys.yml b/config/locales/vehicle_journeys.yml index 8ed746e3d..12f94a191 100644 --- a/config/locales/vehicle_journeys.yml +++ b/config/locales/vehicle_journeys.yml @@ -29,6 +29,8 @@ en: index: title: Vehicle journeys on route %{route} vehicle_journeys: "Departure's times" + selection: Filter on + selection_all: All activerecord: models: vehicle_journey: @@ -87,6 +89,8 @@ fr: index: title: "Courses de la séquence d'arrêts %{route}" vehicle_journeys: "Horaires de départ aux arrêts" + selection: Filtrer sur + selection_all: Tous activerecord: models: vehicle_journey: diff --git a/spec/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb_spec.rb b/spec/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb_spec.rb index d7c307c1d..70b0fc4ef 100644 --- a/spec/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb_spec.rb +++ b/spec/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb_spec.rb @@ -17,45 +17,45 @@ describe "/vehicle_journeys/_vehicle_journey_at_stop_fields" do end it "should render vehicle_journey_at_stop's departure time" do render_collection - rendered.should have_selector("li select", :name => "#{field_name}[departure_time(5i)]") + rendered.should have_selector("td select", :name => "#{field_name}[departure_time(5i)]") end it "should render vehicle_journey_at_stop's stop_point_id" do render_collection - rendered.should have_selector("li input", :name => "#{field_name}[stop_point_id]", + rendered.should have_selector("td input", :name => "#{field_name}[stop_point_id]", :value => vehicle_journey_at_stop.stop_point_id) end it "should render vehicle_journey_at_stop's id" do render_collection - rendered.should have_selector("li input", :name => "#{field_name}[id]", + rendered.should have_selector("td input", :name => "#{field_name}[id]", :value => vehicle_journey_at_stop.id) end it "should render vehicle_journey_at_stop's _destroy" do render_collection - rendered.should have_selector("li input", :name => "#{field_name}[_destroy]", + rendered.should have_selector("td input", :name => "#{field_name}[_destroy]", :value => (vehicle_journey_at_stop._destroy ? "1" : "0")) end it "should render vehicle_journey_at_stop's stop name" do render_collection - rendered.should have_selector("li label", :text => vehicle_journey_at_stop.stop_point.stop_area.name ) + rendered.should have_selector("td label", :text => vehicle_journey_at_stop.stop_point.stop_area.name ) end context "for a destroyed vehicle_journey_at_stop" do before(:each) do vehicle_journey_at_stop.stub!(:_destroy => true) end - it "should render li.no_stop" do + it "should render tr.no_stop" do pending render_collection - rendered.should have_selector("li.no_stop") + rendered.should have_selector("tr.no_stop") end end context "for a destroyed vehicle_journey_at_stop" do before(:each) do vehicle_journey_at_stop.stub!(:_destroy => true) end - it "should not render li.no_stop" do + it "should not render tr.no_stop" do render_collection - rendered.should_not have_selector("li.no_stop") + rendered.should_not have_selector("tr.no_stop") end end end |
