aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorMichel Etienne2012-11-13 16:18:13 +0100
committerMichel Etienne2012-11-13 16:18:13 +0100
commiteeaf81e645de6f073b84b22b19e04ac63024399e (patch)
tree5c0664cc51d2ad7d42ec8ff3322d540ac2413972 /app/views
parent0c9781ac6c9927c4631826c2319c0c14436587d6 (diff)
downloadchouette-core-eeaf81e645de6f073b84b22b19e04ac63024399e.tar.bz2
add some features on maps
Diffstat (limited to 'app/views')
-rw-r--r--app/views/access_links/show.html.erb1
-rw-r--r--app/views/access_links/show.kml.erb20
-rw-r--r--app/views/access_points/show.html.erb4
-rw-r--r--app/views/stop_areas/_form.html.erb24
-rw-r--r--app/views/stop_areas/access_links.html.erb4
-rw-r--r--app/views/stop_areas/edit.html.erb5
-rw-r--r--app/views/stop_areas/show.html.erb66
-rw-r--r--app/views/stop_areas/show.kml.erb20
8 files changed, 90 insertions, 54 deletions
diff --git a/app/views/access_links/show.html.erb b/app/views/access_links/show.html.erb
index aa049899a..a318a84c6 100644
--- a/app/views/access_links/show.html.erb
+++ b/app/views/access_links/show.html.erb
@@ -1,6 +1,7 @@
<%= title_tag t('access_links.show.title', :access_link => @access_link.name ) %>
<div class="access_link_show">
+ <%= @map.to_html %>
<div class="summary">
<p>
diff --git a/app/views/access_links/show.kml.erb b/app/views/access_links/show.kml.erb
new file mode 100644
index 000000000..25e4351b8
--- /dev/null
+++ b/app/views/access_links/show.kml.erb
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kml xmlns="http://www.opengis.net/kml/2.2">
+ <Document>
+ <% if @access_link.geometry %>
+ <Placemark id="route_<%= @access_link.id %>" >
+ <name><%= @access_link.name %></name>
+ <%= @access_link.geometry.kml_representation.html_safe %>
+ </Placemark>
+ <Placemark id="<%= @access_link.access_point.id %>" >
+ <departure><%= @access_link.link_orientation_type == "access_point_to_stop_area" %></departure>
+ <%= @access_link.access_point.geometry.kml_representation.html_safe %>
+ </Placemark>
+ <Placemark id="<%= @access_link.stop_area.id %>" >
+ <arrival><%= @access_link.link_orientation_type == "access_point_to_stop_area" %></arrival>
+ <%= @access_link.stop_area.geometry.kml_representation.html_safe %>
+ </Placemark>
+ <% end %>
+ </Document>
+</kml>
+
diff --git a/app/views/access_points/show.html.erb b/app/views/access_points/show.html.erb
index 7b25d6b96..6361e2115 100644
--- a/app/views/access_points/show.html.erb
+++ b/app/views/access_points/show.html.erb
@@ -109,8 +109,6 @@
<%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@generic_access_links) %>
</table>
</div>
- <p><%= t('.access_link_legend_1') %></p>
- <p><%= t('.access_link_legend_2') %></p>
</div>
@@ -128,8 +126,6 @@
<%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@detail_access_links) %>
</table>
</div>
- <p><%= t('.access_link_legend_1') %></p>
- <p><%= t('.access_link_legend_2') %></p>
</div>
</div>
diff --git a/app/views/stop_areas/_form.html.erb b/app/views/stop_areas/_form.html.erb
index b5541cf20..5fca012f3 100644
--- a/app/views/stop_areas/_form.html.erb
+++ b/app/views/stop_areas/_form.html.erb
@@ -11,17 +11,19 @@
<%= form.input :nearest_topic_name %>
<%= form.input :comment %>
<%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :disabled => !@stop_area.new_record? } %>
- <%= form.inputs :name => t('stop_areas.show.geographic_data') do %>
- <% if ! @referential.projection_type_label.empty? %>
- <%= form.inputs :name => @referential.projection_type_label do %>
- <%= form.input :x %>
- <%= form.input :y %>
- <% end %>
- <% end %>
- <%= form.inputs :name => "WGS84" do %>
- <%= form.input :longitude %>
- <%= form.input :latitude %>
- <% end %>
+ <% if !manage_itl %>
+ <%= form.inputs :name => t('stop_areas.show.geographic_data') do %>
+ <% if ! @referential.projection_type_label.empty? %>
+ <%= form.inputs :name => @referential.projection_type_label do %>
+ <%= form.input :x %>
+ <%= form.input :y %>
+ <% end %>
+ <% end %>
+ <%= form.inputs :name => "WGS84" do %>
+ <%= form.input :longitude %>
+ <%= form.input :latitude %>
+ <% end %>
+ <% end %>
<% end %>
<% end %>
diff --git a/app/views/stop_areas/access_links.html.erb b/app/views/stop_areas/access_links.html.erb
index da648eef6..d4727d7db 100644
--- a/app/views/stop_areas/access_links.html.erb
+++ b/app/views/stop_areas/access_links.html.erb
@@ -14,8 +14,6 @@
<%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@generic_access_links) %>
</table>
</div>
- <p><%= t('.access_link_legend_1') %></p>
- <p><%= t('.access_link_legend_2') %></p>
</div>
<h3 class="stop_area_generics">
<a class="details"><%= t('.detail_access_links') %>
@@ -30,8 +28,6 @@
<%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@detail_access_links) %>
</table>
</div>
- <p><%= t('.access_link_legend_1') %></p>
- <p><%= t('.access_link_legend_2') %></p>
</div>
</div>
diff --git a/app/views/stop_areas/edit.html.erb b/app/views/stop_areas/edit.html.erb
index 1ec77056d..d08949104 100644
--- a/app/views/stop_areas/edit.html.erb
+++ b/app/views/stop_areas/edit.html.erb
@@ -1,5 +1,6 @@
<%= title_tag t('stop_areas.edit.title', :stop_area => @stop_area.name ) %>
-<%= @map.to_html %>
-
+<% if !manage_itl %>
+ <%= @map.to_html %>
+<% end %>
<%= render "form" %>
diff --git a/app/views/stop_areas/show.html.erb b/app/views/stop_areas/show.html.erb
index 310761a03..9d0db8af8 100644
--- a/app/views/stop_areas/show.html.erb
+++ b/app/views/stop_areas/show.html.erb
@@ -1,7 +1,7 @@
<%= title_tag t('stop_areas.show.title', :stop_area => @stop_area.name ) %>
<div class="stop_area_show">
- <% if @stop_area.projection_type != nil || @stop_area.long_lat_type != nil %>
+ <% if show_map? %>
<%= @map.to_html %>
<% end %>
<div class="summary">
@@ -37,37 +37,39 @@
<label><%= @stop_area.human_attribute_name("stop_area_type") %>: </label>
<%= t("area_types.label.#{@stop_area.stop_area_type}") %>
</p>
- <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p>
- <% 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.projection_type.nil? %>
- <p>
- <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>
- <%= @stop_area.x %>
- </p>
- <p>
- <span class='geo_data'><%= @stop_area.human_attribute_name("y") %>: </span>
- <%= @stop_area.y %>
- </p>
- <% end %>
- <% if !@stop_area.long_lat_type.nil? %>
- <p>
- <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>
- <%= @stop_area.longitude %>
- </p>
- <p>
- <span class='geo_data'><%= @stop_area.human_attribute_name("latitude") %>: </span>
- <%= @stop_area.latitude %>
- </p>
+ <% if !manage_itl %>
+ <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p>
+ <% 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.projection_type.nil? %>
+ <p>
+ <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>
+ <%= @stop_area.x %>
+ </p>
+ <p>
+ <span class='geo_data'><%= @stop_area.human_attribute_name("y") %>: </span>
+ <%= @stop_area.y %>
+ </p>
+ <% end %>
+ <% if !@stop_area.long_lat_type.nil? %>
+ <p>
+ <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>
+ <%= @stop_area.longitude %>
+ </p>
+ <p>
+ <span class='geo_data'><%= @stop_area.human_attribute_name("latitude") %>: </span>
+ <%= @stop_area.latitude %>
+ </p>
+ <% end %>
<% end %>
<% end %>
<p>
diff --git a/app/views/stop_areas/show.kml.erb b/app/views/stop_areas/show.kml.erb
index 16613b6bc..39a764bd6 100644
--- a/app/views/stop_areas/show.kml.erb
+++ b/app/views/stop_areas/show.kml.erb
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
+ <% if !params["children"].nil? %>
+ <% @stop_area.children.each do |child| %>
+ <Placemark id="<%= child.id %>" >
+ <name><%= child.name %></name>
+ <stop_area_type><%= child.stop_area_type %></stop_area_type>
+ <%= (child.position or child.default_position).kml_representation.html_safe %>
+ </Placemark>
+ <% end %>
+ <% elsif !params["routing"].nil? %>
+ <% @stop_area.routing_stops.each do |child| %>
+ <Placemark id="<%= child.id %>" >
+ <name><%= child.name %></name>
+ <stop_area_type><%= child.stop_area_type %></stop_area_type>
+ <%= (child.position or child.default_position).kml_representation.html_safe %>
+ </Placemark>
+ <% end %>
+ <% else %>
<Placemark id="<%= @stop_area.id %>" >
<name><%= @stop_area.name %></name>
- <stop_area_type><%= @stop_area.type %></stop_area_type>
+ <stop_area_type><%= @stop_area.stop_area_type %></stop_area_type>
<%= (@stop_area.position or @stop_area.default_position).kml_representation.html_safe %>
</Placemark>
+ <% end %>
</Document>
</kml>