diff options
| author | Marc Florisson | 2012-06-29 10:10:44 +0200 | 
|---|---|---|
| committer | Marc Florisson | 2012-06-29 10:10:44 +0200 | 
| commit | a46b9975c0b9257cb7749201a8bea520e0532a85 (patch) | |
| tree | df306b81979e28f955ba1c3dba431a2f7909051f | |
| parent | a96398d24c195c0224e985be9a12b8bd12f76143 (diff) | |
| download | chouette-core-a46b9975c0b9257cb7749201a8bea520e0532a85.tar.bz2 | |
fix journey_pattern views
| -rw-r--r-- | app/controllers/journey_patterns_controller.rb | 11 | ||||
| -rw-r--r-- | app/views/journey_patterns/_journey_pattern.html.erb | 2 | ||||
| -rw-r--r-- | app/views/journey_patterns/show.html.erb | 2 | 
3 files changed, 12 insertions, 3 deletions
| diff --git a/app/controllers/journey_patterns_controller.rb b/app/controllers/journey_patterns_controller.rb index d8611d6f9..07d1ac3d5 100644 --- a/app/controllers/journey_patterns_controller.rb +++ b/app/controllers/journey_patterns_controller.rb @@ -12,6 +12,16 @@ class JourneyPatternsController < ChouetteController    alias_method :route, :parent +  def index      +    index! do |format| +      format.html { redirect_to referential_line_route_path(@referential,@line,@route) } +    end +  end + +  def create_resource(object) +    object.special_update +  end +    def show      #@map = RouteMap.new referential, route      @stop_points = resource.stop_points.paginate(:page => params[:page], :per_page => 10) @@ -19,7 +29,6 @@ class JourneyPatternsController < ChouetteController    end    def new_vehicle_journey -    puts resource.inspect      @vehicle_journey = Chouette::VehicleJourney.new(:route_id => route.id)      @vehicle_journey.update_journey_pattern(resource)      render "vehicle_journeys/select_journey_pattern" diff --git a/app/views/journey_patterns/_journey_pattern.html.erb b/app/views/journey_patterns/_journey_pattern.html.erb index 1d4130f07..41a898888 100644 --- a/app/views/journey_patterns/_journey_pattern.html.erb +++ b/app/views/journey_patterns/_journey_pattern.html.erb @@ -1,7 +1,7 @@  <%= div_for(journey_pattern) do %>    <%= link_to journey_name(journey_pattern), [@referential, @line, @route, journey_pattern] %>    <div class="info"> -    <% unless journey_pattern.name.blank? %> +    <% unless journey_pattern.stop_points.empty? %>        <%= t('.from_to', :departure => journey_pattern.stop_points.first.stop_area.name, :arrival => journey_pattern.stop_points.last.stop_area.name) %> -      <% end %>      <%= t('.stop_count', :count => journey_pattern.stop_points.count, :route_count => @route.stop_points.count) %> - diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb index eed065f2f..0b9676350 100644 --- a/app/views/journey_patterns/show.html.erb +++ b/app/views/journey_patterns/show.html.erb @@ -56,7 +56,7 @@  <% content_for :sidebar do %>  <ul class="actions">    <li><%= link_to t('journey_patterns.actions.edit'), edit_referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :class => "edit" %></li> -  <li><%= link_to  t('journey_patterns.actions.destroy'), referential_line_route_path(@referential, @line, @route, @journey_pattern), :method => :delete, :confirm =>  t('journey_patterns.actions.destroy_confirm'), :class => "remove" %></li> +  <li><%= link_to  t('journey_patterns.actions.destroy'), referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern), :method => :delete, :confirm =>  t('journey_patterns.actions.destroy_confirm'), :class => "remove" %></li>  </ul>  <% end %> | 
