diff options
| author | Marc Florisson | 2012-06-01 12:20:36 +0200 | 
|---|---|---|
| committer | Marc Florisson | 2012-06-01 12:20:36 +0200 | 
| commit | 7fd20ad1409398e06fb1167332c57b4ac4c9aadc (patch) | |
| tree | 51089499a5a24e4c9eb52f8f8f5176f0bb0b1d97 /app | |
| parent | 204460c78933c6d7ae12d4436d9ee8d7e50c8e38 (diff) | |
| download | chouette-core-7fd20ad1409398e06fb1167332c57b4ac4c9aadc.tar.bz2 | |
refactor table and column names
Diffstat (limited to 'app')
29 files changed, 509 insertions, 23 deletions
| diff --git a/app/assets/stylesheets/journey_patterns.css.scss b/app/assets/stylesheets/journey_patterns.css.scss new file mode 100644 index 000000000..afba352bd --- /dev/null +++ b/app/assets/stylesheets/journey_patterns.css.scss @@ -0,0 +1,91 @@ +// Place all the styles related to the routes controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ +@import "common"; + +#workspace.routes.show +{ +    .jouerney_pattern:after {  +        @include after_div_for_object;   +    } + +    .journey_patterns { +        margin-top: 20px; +    } + +    .journey_patterns:after { +        @include content_to_clear; +    } +     +    .journey_pattern { +        @include div_for_object; + +        /* to create multi-column index */ +        width: 350px; +        padding-right: 10px; + +        .name { +            line-height: 16px; +            float: left; +        } +         +    } +} + +#workspace.journey_patterns.edit, #workspace.journey_patterns.new +{ +    #route_color{ width: 100px; +                 color: white; +                 font-weight: bold;} +} + +#workspace.journey_patterns.show +{ +    .journey_pattern_color{ color: white; +                  font-weight: bold; +                  padding: 0 5px 0 5px;} + +    .summary p label { +        font-weight: bold; +    } +     +    .stop_point:after {  +        @include after_div_for_object;   +    } + +    .stop_points { +        margin-top: 20px; +    } + +    .stop_points:after { +        @include content_to_clear; +    } +     +    .journey_pattern_stop_points { +        clear: both; +        margin: 0px; +        padding: 0px; +    } + +    .stop_point { +        @include div_for_object; +        /* to create multi-column index */ +        width: 350px; +        float: left; +        padding-right: 10px; + +        .position { +            width: 25px; +            height: 20px; +            float: left; +            background-color: #61970B; +            font-weight: bold; +            color: white; +            margin-right: 10px; +            padding-left: 4px; +        } +    } +     +}         + + diff --git a/app/controllers/journey_pattern_stop_points_controller.rb b/app/controllers/journey_pattern_stop_points_controller.rb new file mode 100644 index 000000000..c4fc9b08f --- /dev/null +++ b/app/controllers/journey_pattern_stop_points_controller.rb @@ -0,0 +1,18 @@ +class JourneyPatternStopPointsController < ChouetteController +  defaults :resource_class => Chouette::JourneyPattern + +  respond_to :html + +  belongs_to :referential do +    belongs_to :line, :parent_class => Chouette::Line do +      belongs_to :route, :parent_class => Chouette::Route do +        belongs_to :journey_pattern, :parent_class => Chouette::JourneyPattern +      end +    end +  end + +  def stops_selection +    redirect_to referential_line_route_journey_pattern_path( @referential, @line, @route, @journey_pattern) +  end +end + diff --git a/app/controllers/journey_patterns_controller.rb b/app/controllers/journey_patterns_controller.rb new file mode 100644 index 000000000..1ec15f7e8 --- /dev/null +++ b/app/controllers/journey_patterns_controller.rb @@ -0,0 +1,19 @@ +class JourneyPatternsController < ChouetteController +  defaults :resource_class => Chouette::JourneyPattern + +  respond_to :html + +  belongs_to :referential do +    belongs_to :line, :parent_class => Chouette::Line do +      belongs_to :route, :parent_class => Chouette::Route +    end +  end + +  alias_method :route, :parent + +  def show +    #@map = RouteMap.new referential, route +    @stop_points = resource.stop_points.paginate(:page => params[:page], :per_page => 10) +    show! +  end +end diff --git a/app/controllers/vehicle_journeys_controller.rb b/app/controllers/vehicle_journeys_controller.rb new file mode 100644 index 000000000..3a99d531b --- /dev/null +++ b/app/controllers/vehicle_journeys_controller.rb @@ -0,0 +1,27 @@ +class VehicleJourneysController < ChouetteController +  defaults :resource_class => Chouette::VehicleJourney + +  belongs_to :referential do +    belongs_to :line, :parent_class => Chouette::Line do +      belongs_to :route, :parent_class => Chouette::Route +    end +  end + +  protected + +  def collection +    @q = parent.vehicle_journeys.search(params[:q]) +    @vehicle_journeys ||= @q.result(:distinct => true).paginate(:page => params[:page], :per_page => 10) +    @matrix ||= matrix  +  end + +  def matrix +    {}.tap do |hash| +      @vehicle_journeys.each do |vj| +        vj.vehicle_journey_at_stops.each do |vjas| +          hash[ "#{vj.id}-#{vjas.stop_point_id}"] = vjas  +        end +      end +    end +  end +end diff --git a/app/helpers/journey_patterns_helper.rb b/app/helpers/journey_patterns_helper.rb new file mode 100644 index 000000000..d7b66db06 --- /dev/null +++ b/app/helpers/journey_patterns_helper.rb @@ -0,0 +1,12 @@ +module JourneyPatternsHelper +  def journey_name( journey_pattern) +    if journey_pattern.name.blank? +      t('journey_patterns.journey_pattern.from_to',  +        :departure => journey_pattern.stop_points.first.stop_area.name,  +        :arrival => journey_pattern.stop_points.last.stop_area.name) +    else +      truncate(journey_pattern.name, :length => 30) +    end +  end +end + diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb index 72915fd2f..ab91800ae 100644 --- a/app/helpers/routes_helper.rb +++ b/app/helpers/routes_helper.rb @@ -1,7 +1,7 @@  module RoutesHelper    def line_formatted_name( line) -    return line.publishedname if line.number.blank? -    "#{line.publishedname} [#{line.number}]" +    return line.published_name if line.number.blank? +    "#{line.published_name} [#{line.number}]"    end  end diff --git a/app/views/companies/_form.erb b/app/views/companies/_form.erb index 63cb2661b..bea95b0b4 100644 --- a/app/views/companies/_form.erb +++ b/app/views/companies/_form.erb @@ -8,7 +8,7 @@      <%= form.input :phone, :as => :phone %>      <%= form.input :fax, :as => :phone %>      <%= form.input :email, :as => :email %>               -    <%= form.input :registrationnumber %> +    <%= form.input :registration_number %>      <% if @company.new_record? %>        <%= form.input :objectid %>        <% else %> diff --git a/app/views/companies/show.html.erb b/app/views/companies/show.html.erb index b5c64b691..bf4a0bdc3 100644 --- a/app/views/companies/show.html.erb +++ b/app/views/companies/show.html.erb @@ -36,7 +36,7 @@        <%= @company.email %>      </p>      <p> -      <label><%= Chouette::Company.human_attribute_name("registrationnumber") %>: </label> +      <label><%= Chouette::Company.human_attribute_name("registration_number") %>: </label>        <%= @company.registration_number %>      </p>      <p> diff --git a/app/views/journey_patterns/_form.html.erb b/app/views/journey_patterns/_form.html.erb new file mode 100644 index 000000000..ef2bcc9d2 --- /dev/null +++ b/app/views/journey_patterns/_form.html.erb @@ -0,0 +1,24 @@ +<%= semantic_form_for [@referential, @line, @route, @journey_pattern] do |form| %> +  <%= form.inputs do %>  +    <%= form.input :name %> +    <%= form.input :published_name %> +    <%= form.input :registration_number %>               +    <%= form.input :comment %>               +    <%= form.input :stop_point_ids, :as => :check_boxes, :collection => @route.stop_points.map { |s| [s.stop_area.name, s.id.to_s]} %>               +    <% if @route.new_record? %> +      <%= form.input :objectid %>   +    <% else %> +      <li> +      <label><%= @journey_pattern.human_attribute_name("objectid") %>: </label> +      <%= @journey_pattern.objectid %> +      </li> +    <% end %> +  <% end %> + +  <%= form.buttons do %> +    <%= form.commit_button true %> +    <li><%= t('or') %></li> +    <li><%= link_to t('cancel'), :back %></li> +  <% end %> +<% end %> + diff --git a/app/views/journey_patterns/_journey_pattern.html.erb b/app/views/journey_patterns/_journey_pattern.html.erb new file mode 100644 index 000000000..1d4130f07 --- /dev/null +++ b/app/views/journey_patterns/_journey_pattern.html.erb @@ -0,0 +1,14 @@ +<%= div_for(journey_pattern) do %> +  <%= link_to journey_name(journey_pattern), [@referential, @line, @route, journey_pattern] %> +  <div class="info"> +    <% unless journey_pattern.name.blank? %> +      <%= 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) %> - +    <%= t('.vehicle_journeys_count', :count => journey_pattern.vehicle_journeys.count) %> +    <div class="actions">   +      <%= link_to t("actions.destroy"), referential_line_route_journey_pattern_path(@referential, @line, @route, journey_pattern), :method => :delete, :confirm =>  t('journey_patterns.actions.destroy_confirm'), :class => "remove" %> +    </div> +  </div> +<% end %> + diff --git a/app/views/journey_patterns/edit.html.erb b/app/views/journey_patterns/edit.html.erb new file mode 100644 index 000000000..33fac2a6c --- /dev/null +++ b/app/views/journey_patterns/edit.html.erb @@ -0,0 +1,4 @@ +<%= title_tag t('journey_patterns.edit.title', :journey_pattern => @journey_pattern.name ) %> + +<%= render "form" %> + diff --git a/app/views/journey_patterns/new.html.erb b/app/views/journey_patterns/new.html.erb new file mode 100644 index 000000000..fb6ecbd64 --- /dev/null +++ b/app/views/journey_patterns/new.html.erb @@ -0,0 +1,4 @@ +<%= title_tag  t('journey_patterns.new.title') %> + +<%= render "form" %> + diff --git a/app/views/journey_patterns/show.html.erb b/app/views/journey_patterns/show.html.erb new file mode 100644 index 000000000..eed065f2f --- /dev/null +++ b/app/views/journey_patterns/show.html.erb @@ -0,0 +1,62 @@ +<%= title_tag t('journey_patterns.show.title', :journey_pattern => journey_name( @journey_pattern), :route => @route.name ) %> + +<div class="route_show"> + +  <div class="summary"> +    <p> +      <label><%= @journey_pattern.human_attribute_name(:route) %>: </label> +      <%= link_to @route.name, [@referential, @line, @route] %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name(:name) %>: </label> +      <%= @journey_pattern.name %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name(:published_name) %>: </label> +      <%= @journey_pattern.published_name %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name(:registration_number) %>: </label> +      <%= @journey_pattern.registration_number %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name(:comment) %>: </label> +      <%= @journey_pattern.comment %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name("objectid") %>: </label> +      <%= @journey_pattern.objectid %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name("creation_time") %>: </label> +      <%= l @journey_pattern.creation_time %> +    </p> +    <p> +      <label><%= @journey_pattern.human_attribute_name("creator_id") %>: </label> +      <%= @journey_pattern.creator_id %> +    </p> +  </div> + +</div> + +<h3 class="journey_pattern_stop_points"><%= t('.stop_points') %></h3> +<div class="pagination"> +  <div class="page_info"> +    <%= page_entries_info @stop_points %> +  </div> +  <%= will_paginate @stop_points, :container => false %> +</div> +<div class="stop_points paginated_content"> +  <%= render :partial => "stop_points/stop_point", :collection => @stop_points %> +</div> +<div class="pagination"> +  <%= will_paginate @stop_points, :container => false %> +</div> + +<% 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> +</ul> +<% end %> + diff --git a/app/views/journey_patterns/show.kml.erb b/app/views/journey_patterns/show.kml.erb new file mode 100644 index 000000000..6fd8900b6 --- /dev/null +++ b/app/views/journey_patterns/show.kml.erb @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kml xmlns="http://www.opengis.net/kml/2.2"> +  <Document> +    <Placemark id="route_<%= @journey_pattenr.id %>" > +      <name><%= @journey_pattenr.name %></name> +      <%= @journey_pattenr.geometry.kml_representation.html_safe %> +    </Placemark> +    <% @journey_pattenr.stop_areas.where("latitude is not null and longitude is not null").each_with_index do |stop_area, index| %> +      <Placemark id="<%= stop_area.id %>" > +        <name><%= "#{stop_area.name} (#{index+1})" %></name> +        <% if stop_area.id==@journey_pattenr.stop_areas.first.id %> +        <departure>true</departure> +        <% elsif stop_area.id==@journey_pattenr.stop_areas.last.id %> +        <arrival>true</arrival> +        <% end %> +        <%= stop_area.geometry.kml_representation.html_safe %> +      </Placemark> +    <% end %> +  </Document> +</kml> + diff --git a/app/views/lines/_form.erb b/app/views/lines/_form.erb index 1a7107e7e..ed0e4f9a2 100644 --- a/app/views/lines/_form.erb +++ b/app/views/lines/_form.erb @@ -5,7 +5,7 @@      <%= form.input :company, :as => :select, :collection => Chouette::Company.all, :include_blank => false%>      <%= form.input :name %>      <%= form.input :published_name %> -    <%= form.input :registrationnumber %>   +    <%= form.input :registration_number %>        <%= form.input :number %>      <%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") }  %>      <%= form.input :comment %>               diff --git a/app/views/lines/show.html.erb b/app/views/lines/show.html.erb index 4e7217384..8d6157cc7 100644 --- a/app/views/lines/show.html.erb +++ b/app/views/lines/show.html.erb @@ -18,10 +18,10 @@      </p>      <p>        <label><%= @line.human_attribute_name("published_name") %>: </label> -      <%= @line.publishedname %> +      <%= @line.published_name %>      </p>      <p> -      <label><%= @line.human_attribute_name("registrationnumber") %>: </label> +      <label><%= @line.human_attribute_name("registration_number") %>: </label>        <%= @line.registration_number %>      </p>      <p> diff --git a/app/views/networks/_form.erb b/app/views/networks/_form.erb index 29e62b9ec..32c131ca3 100644 --- a/app/views/networks/_form.erb +++ b/app/views/networks/_form.erb @@ -1,7 +1,7 @@  <%= semantic_form_for [@referential, @network] do |form| %>    <%= form.inputs do %>       <%= form.input :name %>  -    <%= form.input :registrationnumber %>   +    <%= form.input :registration_number %>        <%= form.input :comment %>      <%= form.input :versiondate, :as => :date , :label => @network.human_attribute_name("version_date")%>       <%= form.input :description %>               diff --git a/app/views/networks/show.html.erb b/app/views/networks/show.html.erb index b03347ccf..b11cde17d 100644 --- a/app/views/networks/show.html.erb +++ b/app/views/networks/show.html.erb @@ -8,8 +8,8 @@        <%= @network.name %>      </p>      <p> -      <label><%= Chouette::Network.human_attribute_name("registrationnumber") %>: </label> -      <%= @network.registrationnumber %> +      <label><%= Chouette::Network.human_attribute_name("registration_number") %>: </label> +      <%= @network.registration_number %>      </p>      <p>        <label><%= Chouette::Network.human_attribute_name("comment") %>: </label> diff --git a/app/views/routes/show.html.erb b/app/views/routes/show.html.erb index f248ba595..2ecbd0ada 100644 --- a/app/views/routes/show.html.erb +++ b/app/views/routes/show.html.erb @@ -78,6 +78,11 @@    <%= will_paginate @stop_points, :container => false %>  </div> +<h3 class="route_journey_patterns"><%= t('.journey_patterns') %></h3> +<div class="journey_patterns"> +  <%= render :partial => "journey_patterns/journey_pattern", :collection => @route.journey_patterns %> +</div> +  <% content_for :sidebar do %>  <ul class="actions">    <li><%= link_to t('routes.actions.edit'), edit_referential_line_route_path(@referential, @line, @route), :class => "edit" %></li> @@ -85,6 +90,9 @@    <li>      <%= link_to  t('stop_points.actions.sort'), referential_line_route_stop_points_path(@referential, @line, @route), :class => "edit" %>    </li> +  <li> +    <%= link_to  t('journey_patterns.actions.new'), new_referential_line_route_journey_pattern_path(@referential, @line, @route), :class => "add" %> +  </li>  </ul>  <% end %> diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb index 208345523..81878101a 100644 --- a/app/views/stop_areas/_form.html.erb +++ b/app/views/stop_areas/_form.html.erb @@ -6,7 +6,7 @@      <%= form.input :street_name %>                    <%= form.input :country_code %>                    <%= form.input :fare_code %>               -    <%= form.input :registrationnumber %> +    <%= form.input :registration_number %>      <% if @stop_area.new_record? %>        <%= form.input :stop_area_type, :as => :select, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") }  %>        <%= form.input :objectid %>   diff --git a/app/views/stop_areas/index.html.erb b/app/views/stop_areas/index.html.erb index cf7dafac0..d40f0d646 100644 --- a/app/views/stop_areas/index.html.erb +++ b/app/views/stop_areas/index.html.erb @@ -2,7 +2,7 @@  <%= search_form_for @q, :url => referential_stop_areas_path(@referential), :html => {:method => :get} do |f| %>    <%= f.label :name_or_country_code_cont, "#{t('.name_or_country_code')} :" %> -  <%= f.text_field :name_or_countrycode_cont %> +  <%= f.text_field :name_or_country_code_cont %>    <%= f.submit t('actions.search') %> <%= t("or") %>    <%= link_to t("cancel"), referential_stop_areas_path(@referential) %> @@ -32,9 +32,9 @@  <ul class="selection">  <% Chouette::StopArea.stop_area_types.each do |area_type| %> -<li><%= link_with_search (image_tag("map/" + area_type + ".png")+t("area_types.label.#{area_type.to_s}")), "areatype_eq" => area_type.name %></li> +<li><%= link_with_search (image_tag("map/" + area_type + ".png")+t("area_types.label.#{area_type.to_s}")), "area_type_eq" => area_type.name %></li>  <% end %> -<li><%= link_with_search (image_tag("map/all.png")+t(".selection_all")), {"areatype_eq" => nil}, :class => "all" %></li> +<li><%= link_with_search (image_tag("map/all.png")+t(".selection_all")), {"area_type_eq" => nil}, :class => "all" %></li>  </ul>  <% end %> diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb index afaa5830a..992a4050b 100644 --- a/app/views/stop_areas/show.html.erb +++ b/app/views/stop_areas/show.html.erb @@ -28,7 +28,7 @@        <%= @stop_area.fare_code %>      </p>      <p> -      <label><%= @stop_area.human_attribute_name("registrationnumber") %>: </label> +      <label><%= @stop_area.human_attribute_name("registration_number") %>: </label>        <%= @stop_area.registration_number %>      </p>      <p> @@ -36,13 +36,13 @@        <%= t("area_types.label.#{@stop_area.stop_area_type}") %>      </p>      <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p> -    <% if @stop_area.projectiontype == nil && @stop_area.longlattype == nil %> +    <% if @stop_area.projection_type == nil && @stop_area.long_lat_type == nil %>  	    <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span>      <% else %> -	    <% if @stop_area.projectiontype != nil %> +	    <% if @stop_area.projection_type != nil %>  	    <p> -	      <span class='geo_data'><%= @stop_area.human_attribute_name("projectiontype") %>: </span> -	      <%= @stop_area.projectiontype %> +	      <span class='geo_data'><%= @stop_area.human_attribute_name("projection_type") %>: </span> +	      <%= @stop_area.projection_type %>  	    </p>  	    <p>  	      <span class='geo_data'><%= @stop_area.human_attribute_name("x") %>: </span> @@ -53,10 +53,10 @@  	      <%= @stop_area.y %>  	    </p>  	    <% end %> -	    <% if @stop_area.longlattype != nil %> +	    <% if @stop_area.long_lat_type != nil %>  	    <p> -	      <span class='geo_data'><%= @stop_area.human_attribute_name("longlattype") %>: </span> -	      <%= @stop_area.longlattype %> +	      <span class='geo_data'><%= @stop_area.human_attribute_name("long_lat_type") %>: </span> +	      <%= @stop_area.long_lat_type %>  	    </p>  	    <p>  	      <span class='geo_data'><%= @stop_area.human_attribute_name("longitude") %>: </span> diff --git a/app/views/time_tables/show.html.erb b/app/views/time_tables/show.html.erb index 0ddd49338..f3e0bbce3 100644 --- a/app/views/time_tables/show.html.erb +++ b/app/views/time_tables/show.html.erb @@ -13,7 +13,7 @@      </p>      <p>        <label><%= @time_table.human_attribute_name("day_types") %>:  </label> -      <% if @time_table.intdaytypes == 0 %> +      <% if @time_table.int_day_types == 0 %>          <label><%= @time_table.human_attribute_name("none") %></label>        <% else %>    	      <% if @time_table.monday %>  diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb new file mode 100644 index 000000000..9a7d84ed8 --- /dev/null +++ b/app/views/vehicle_journeys/_form.html.erb @@ -0,0 +1,29 @@ +<%= semantic_form_for [@referential, @line, @route, @vehicle_journey] do |form| %> +  <%= form.inputs do %>  +    <%= form.input :published_journey_name %> +    <%= form.input :published_journey_identifier %> +    <%= form.input :comment %>               +    <%= form.input :transport_mode, :as => :select, :collection => Chouette::Line.transport_modes, :include_blank => false, :member_label => Proc.new { |mode| t("transport_modes.label.#{mode}") }  %> +    <%= form.input :status_value %>               +    <%= form.input :facility %>               +    <%= form.input :vehicle_type_identifier%>               +    <% if @vehicle_journey.new_record? %> +      <%= form.input :objectid %>   +    <% else %> +      <li> +      <label><%= @vehicle_journey.human_attribute_name("objectid") %>: </label> +      <%= @vehicle_journey.objectid %> +      </li> +    <% end %> +     +    <%= render :partial => "vehicle_journeys/vehicle_journey_at_stop_fields" %> +     +  <% end %> + +  <%= form.buttons do %> +    <%= form.commit_button true %> +    <li><%= t('or') %></li> +    <li><%= link_to t('cancel'), :back %></li> +  <% end %> +<% 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 new file mode 100644 index 000000000..9ef3b509b --- /dev/null +++ b/app/views/vehicle_journeys/_vehicle_journey_at_stop_fields.html.erb @@ -0,0 +1,11 @@ + <% @vehicle_journey.vehicle_journey_at_stops.each_with_index do |vjas, index| %> +   <li class="time input optional"> +     <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{index}][departure_time(3i)]" %> type="hidden" value="1"> +     <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{index}][departure_time(2i)]" %> type="hidden" value="1"> +     <input name=<%= "vehicle_journey[vehicle_journey_at_stops_attributes][#{index}][departure_time(1i)]" %> type="hidden" value="2000"> +     <label for=<%= "date_vehicle_journey_vehicle_journey_at_stops_attributes_#{index}_departure_time_5i" %>><%= vjas.stop_point.stop_area.name %></label> +     <%= select_hour(vjas.departure_time.hour, :field_name => "vehicle_journey[vehicle_journey_at_stops_attributes][#{index}][departure_time(4i)]") %> +     <%= select_minute(vjas.departure_time.min, :field_name => "vehicle_journey[vehicle_journey_at_stops_attributes][#{index}][departure_time(5i)]") %> +   </li> + <% end %> + diff --git a/app/views/vehicle_journeys/edit.html.erb b/app/views/vehicle_journeys/edit.html.erb new file mode 100644 index 000000000..c1079a16d --- /dev/null +++ b/app/views/vehicle_journeys/edit.html.erb @@ -0,0 +1,21 @@ +<%= title_tag t('vehicle_journeys.edit.title' ) %> + +<div class="vehicle_journey"> +  <div class="summary"> +    <p> +      <label><%= @route.human_attribute_name(:line) %>: </label> +      <%= link_to line_formatted_name( @line), [@referential, @line] %> +    </p> +    <p> +      <label><%= Chouette::Route.model_name.human %>: </label> +      <%= link_to @route.name, [@referential, @line, @route] %> +    </p> +    <p> +      <label><%= Chouette::JourneyPattern.model_name.human %>: </label> +      <%= link_to journey_name(@vehicle_journey.journey_pattern), [@referential, @line, @route, @vehicle_journey.journey_pattern] %> +    </p> +  <div> +<div> + +<%= render "form" %> + diff --git a/app/views/vehicle_journeys/index.html.erb b/app/views/vehicle_journeys/index.html.erb new file mode 100644 index 000000000..cbb43408c --- /dev/null +++ b/app/views/vehicle_journeys/index.html.erb @@ -0,0 +1,44 @@ +<%= title_tag t('vehicle_journeys.index.title', :route => @route.name ) %> + +<div class="vehicle_journey_index"> +  <div class="summary"> +    <p> +      <label><%= @route.human_attribute_name(:line) %>: </label> +      <%= link_to line_formatted_name( @line), [@referential, @line] %> +    </p> +    <p> +      <label><%= Chouette::Route.model_name.human %>: </label> +      <%= link_to @route.name, [@referential, @line, @route] %> +    </p> +  <div> +<div> +<h3 class="vehicle_journeys"><%= t('.vehicle_journeys') %></h3> +<div class="pagination"> +  <div class="page_info"> +    <%= page_entries_info @vehicle_journeys %> +  </div> +  <%= will_paginate @vehicle_journeys, :container => false %> +</div> +<div class="vehicle_journeys paginated_content"> +  <table border="1"> +  <tr> +  <th> "vide"</th> +  <% @vehicle_journeys.each do |vj| %> +    <th> <%= link_to "c", [@referential, @line, @route, vj]%></th> +  <% end %> +  </tr> +  <% @route.stop_points.each_with_index do |sp, index| %> +  <tr> +    <td><%= sp.stop_area.name %></td> +    <% @vehicle_journeys.each do |vj| %> +      <td><%= @matrix["#{vj.id}-#{sp.id}"] ? l( @matrix["#{vj.id}-#{sp.id}"].departure_time, :format => :hour) : "" %></td> +    <% end %> +  </tr> +  <% end %> +  </table> +</div> +<% content_for :sidebar do %> +<ul class="actions"> +</ul> +<% end %> + diff --git a/app/views/vehicle_journeys/new.html.erb b/app/views/vehicle_journeys/new.html.erb new file mode 100644 index 000000000..fd7bb34ac --- /dev/null +++ b/app/views/vehicle_journeys/new.html.erb @@ -0,0 +1,17 @@ +<%= title_tag  t('vehicle_journeys.new.title') %> + +<div class="vehicle_journey"> +  <div class="summary"> +    <p> +      <label><%= @route.human_attribute_name(:line) %>: </label> +      <%= link_to line_formatted_name( @line), [@referential, @line] %> +    </p> +    <p> +      <label><%= Chouette::Route.model_name.human %>: </label> +      <%= link_to @route.name, [@referential, @line, @route] %> +    </p> +  <div> +<div> + +<%= render "form" %> + diff --git a/app/views/vehicle_journeys/show.html.erb b/app/views/vehicle_journeys/show.html.erb new file mode 100644 index 000000000..a89d2261b --- /dev/null +++ b/app/views/vehicle_journeys/show.html.erb @@ -0,0 +1,60 @@ +<%= title_tag t('vehicle_journeys.edit.title' ) %> + +<div class="vehicle_journey"> +  <div class="summary"> +    <p> +      <label><%= @route.human_attribute_name(:line) %>: </label> +      <%= link_to line_formatted_name( @line), [@referential, @line] %> +    </p> +    <p> +      <label><%= Chouette::Route.model_name.human %>: </label> +      <%= link_to @route.name, [@referential, @line, @route] %> +    </p> +    <p> +      <label><%= Chouette::JourneyPattern.model_name.human %>: </label> +      <%= link_to journey_name(@vehicle_journey.journey_pattern), [@referential, @line, @route, @vehicle_journey.journey_pattern] %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("published_journey_name") %>: </label> +      <%= @vehicle_journey.published_journey_name %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("published_journey_identifier") %>: </label> +      <%= @vehicle_journey.published_journey_identifier %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("comment") %>: </label> +      <%= @vehicle_journey.comment %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("status_value") %>: </label> +      <%= @vehicle_journey.status_value %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("facility") %>: </label> +      <%= @vehicle_journey.facility %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("vehicle_type_identifier") %>: </label> +      <%= @vehicle_journey.vehicle_type_identifier %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("objectid") %>: </label> +      <%= @vehicle_journey.objectid %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("creation_time") %>: </label> +      <%= l @vehicle_journey.creation_time %> +    </p> +    <p> +      <label><%= @vehicle_journey.human_attribute_name("creator_id") %>: </label> +      <%= @vehicle_journey.creator_id %> +    </p> +  </div> +</div> +<% content_for :sidebar do %> +<ul class="actions"> +  <li><%= link_to t('vehicle_journeys.actions.edit'), edit_referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :class => "edit" %></li> +  <li><%= link_to  t('vehicle_journeys.actions.destroy'), referential_line_route_vehicle_journey_path(@referential, @line, @route, @vehicle_journey), :method => :delete, :confirm =>  t('vehicle_journeys.actions.destroy_confirm'), :class => "remove" %></li> +</ul> +<% end %> | 
