From 24148be964f69140ea46a830cd0d07e43aa61bfc Mon Sep 17 00:00:00 2001 From: Marc Florisson Date: Tue, 24 Apr 2012 13:28:41 +0200 Subject: add route's views --- app/views/lines/show.html.erb | 8 ++++++++ app/views/routes/_form.html.erb | 4 ++-- app/views/routes/_list.html.erb | 21 --------------------- app/views/routes/index.html.erb | 20 -------------------- app/views/routes/show.html.erb | 39 ++++++++++++++++++++++++++++++++------- 5 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 app/views/routes/_list.html.erb delete mode 100644 app/views/routes/index.html.erb (limited to 'app/views') diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index cd0e6b2ac..23c65573f 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -51,10 +51,18 @@ +

<%= t('.itineraries') %>

+<%= will_paginate @routes %> +
+ <%= render :partial => "routes/route", :collection => @routes %> +
+<%= will_paginate @routes %> + <% content_for :sidebar do %> <% end %> diff --git a/app/views/routes/_form.html.erb b/app/views/routes/_form.html.erb index fb4604328..96a681b13 100644 --- a/app/views/routes/_form.html.erb +++ b/app/views/routes/_form.html.erb @@ -4,8 +4,8 @@ <%= form.input :published_name %> <%= form.input :number %> <%= form.input :comment %> - <%= form.input :oppositerouteid, :as => :select, :collection => Hash[@line.routes.map{|r| [r.name,r.id]}] %> - <%= form.input :direction, :as => :select, :collection => { "Aller" => 'A', "Retour" => "R"} %> + <%= form.input :opposite_route, :as => :select, :collection => Hash[@line.routes.map{|r| [r.name,r.id]}] %> + <%= form.input :direction_code, :as => :select, :collection => Chouette::Route.directions, :include_blank => false, :member_label => Proc.new { |mode| t("directions.label.#{mode}") } %> <%= form.input :wayback_code, :as => :select, :collection => Chouette::Route.waybacks, :include_blank => false, :member_label => Proc.new { |mode| t("waybacks.label.#{mode}") } %> <% if @route.new_record? %> <%= form.input :objectid %> diff --git a/app/views/routes/_list.html.erb b/app/views/routes/_list.html.erb deleted file mode 100644 index b253c3f75..000000000 --- a/app/views/routes/_list.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= title_tag t('routes.index.title') %> - -<%= search_form_for @q, :url => referential_line_routes_path(@referential, @line), :html => {:method => :get} do |f| %> - <%= f.text_field :name_cont %> - - <%= f.submit t('actions.search') %> <%= t("or") %> - <%= link_to t("cancel"), referential_line_path(@referential,@line) %> -<% end %> - -<%= will_paginate @line.routes %> -
- <%= render :partial => "route", :collection => @line.routes %> -
-<%= will_paginate @line.routes %> - -<% content_for :sidebar do %> - -<% end %> - diff --git a/app/views/routes/index.html.erb b/app/views/routes/index.html.erb deleted file mode 100644 index fba0ef859..000000000 --- a/app/views/routes/index.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<%= title_tag t('routes.index.title') %> - -<%= search_form_for @q, :url => referential_line_routes_path(@referential, @line), :html => {:method => :get} do |f| %> - <%= f.text_field :name_cont %> - - <%= f.submit t('actions.search') %> <%= t("or") %> - <%= link_to t("cancel"), referential_line_path(@referential,@line) %> -<% end %> - -<%= will_paginate @routes %> -
- <%= render :partial => "route", :collection => @routes %> -
-<%= will_paginate @routes %> - -<% content_for :sidebar do %> - -<% end %> diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb index 1d43c4284..aef155fec 100644 --- a/app/views/routes/show.html.erb +++ b/app/views/routes/show.html.erb @@ -1,11 +1,11 @@ -<%= title_tag t('routes.show.title', :route => @route.name ) %> +<%= title_tag t('routes.show.title', :route => @route.name, :line => @line.name ) %>

- <%= link_to @line.name, [@referential, @line] %> + <%= link_to line_formatted_name( @line), [@referential, @line] %>

@@ -24,12 +24,30 @@ <%= @route.comment %>

- - <%= @route.direction %> + + <% if @route.direction_code %> +

<%= @route.direction_code.inspect %>

+

<%= @route.direction.inspect %>

+ <%= t("directions.label.#{@route.direction_code}").capitalize %> + <% else %> + <%= t(".undefined") %> + <% end %>

- - <%= @route.wayback %> + + <% if @route.wayback_code %> + <%= t("waybacks.label.#{@route.wayback_code}").capitalize %> + <% else %> + <%= t(".undefined") %> + <% end %> +

+

+ + <% if @route.opposite_route %> + <%= link_to @route.opposite_route.name, [@referential, @line, @route] %> + <% else %> + <%= t(".no_opposite_route") %> + <% end %>

@@ -37,7 +55,7 @@

- <%= @route.creation_time %> + <%= l @route.creation_time %>

@@ -47,6 +65,13 @@

+

<%= t('.stop_areas') %>

+<%= will_paginate @stop_areas %> +
+ <%= render :partial => "stop_areas/stop_area", :collection => @stop_areas %> +
+<%= will_paginate @stop_areas %> + <% content_for :sidebar do %>