aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/journey_patterns
diff options
context:
space:
mode:
authorMarc Florisson2012-06-01 12:20:36 +0200
committerMarc Florisson2012-06-01 12:20:36 +0200
commit7fd20ad1409398e06fb1167332c57b4ac4c9aadc (patch)
tree51089499a5a24e4c9eb52f8f8f5176f0bb0b1d97 /app/views/journey_patterns
parent204460c78933c6d7ae12d4436d9ee8d7e50c8e38 (diff)
downloadchouette-core-7fd20ad1409398e06fb1167332c57b4ac4c9aadc.tar.bz2
refactor table and column names
Diffstat (limited to 'app/views/journey_patterns')
-rw-r--r--app/views/journey_patterns/_form.html.erb24
-rw-r--r--app/views/journey_patterns/_journey_pattern.html.erb14
-rw-r--r--app/views/journey_patterns/edit.html.erb4
-rw-r--r--app/views/journey_patterns/new.html.erb4
-rw-r--r--app/views/journey_patterns/show.html.erb62
-rw-r--r--app/views/journey_patterns/show.kml.erb21
6 files changed, 129 insertions, 0 deletions
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>
+