aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/views/access_link_pairs/_access_link_pair.html.erb56
-rw-r--r--app/views/access_link_pairs/_access_link_pair.html.slim40
-rw-r--r--app/views/access_links/_form.html.erb25
-rw-r--r--app/views/access_links/_form.html.slim24
-rw-r--r--app/views/access_links/edit.html.erb4
-rw-r--r--app/views/access_links/edit.html.slim2
-rw-r--r--app/views/access_links/new.html.erb3
-rw-r--r--app/views/access_links/new.html.slim2
-rw-r--r--app/views/access_links/show.html.erb84
-rw-r--r--app/views/access_links/show.html.slim74
-rw-r--r--app/views/access_links/show.kml.erb20
-rw-r--r--app/views/access_links/show.kml.slim16
12 files changed, 158 insertions, 192 deletions
diff --git a/app/views/access_link_pairs/_access_link_pair.html.erb b/app/views/access_link_pairs/_access_link_pair.html.erb
deleted file mode 100644
index 3e0d8a4fe..000000000
--- a/app/views/access_link_pairs/_access_link_pair.html.erb
+++ /dev/null
@@ -1,56 +0,0 @@
-<tr>
- <td>
- <div class="link">
- <div class="access_point">
- <%= link_to([@referential, @stop_area, access_link_pair.access_point]) do %>
- <%= image_tag "map/access_" + access_link_pair.access_point.access_point_type + ".png" %><span><%= access_link_pair.access_point.name %></span>
- <% end %>
- </div>
- <div class="info">
- <%= t("access_types.label.#{access_link_pair.access_point.access_point_type}") %>
- </div>
- </div>
- </td>
- <td>
- <% if access_link_pair.out_valid? %>
- <% if access_link_pair.out_exists? %>
- <%= link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point,:access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do %>
- <%= image_tag "icons/green_left_arrow.png" %>
- <% end %>
- <% else %>
- <%= link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do %>
- <%= image_tag "icons/gray_left_arrow.png" %>
- <% end %>
- <% end %>
- <% else %>
- <%= image_tag "icons/disabled_left_arrow.png" %>
- <% end %>
- </td>
- <td>
- <% if access_link_pair.in_valid? %>
- <% if access_link_pair.in_exists? %>
- <%= link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point, access_link_pair.from_access_point)) do %>
- <%= image_tag "icons/green_right_arrow.png" %>
- <% end %>
- <% else %>
- <%= link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'access_point_to_stop_area'})) do %>
- <%= image_tag "icons/gray_right_arrow.png" %>
- <% end %>
- <% end %>
- <% else %>
- <%= image_tag "icons/disabled_right_arrow.png" %>
- <% end %>
- </td>
- <td>
- <div class="link">
- <div class="stop_area">
- <%= link_to([@referential, access_link_pair.stop_area]) do %>
- <%= image_tag "map/" + access_link_pair.stop_area.stop_area_type + ".png" %><span><%= access_link_pair.stop_area.name %></span>
- <% end %>
- </div>
- <div class="info">
- <%= t("area_types.label.#{access_link_pair.stop_area.stop_area_type}") %>
- </div>
- </div>
- </td>
-</tr>
diff --git a/app/views/access_link_pairs/_access_link_pair.html.slim b/app/views/access_link_pairs/_access_link_pair.html.slim
new file mode 100644
index 000000000..05fdd3446
--- /dev/null
+++ b/app/views/access_link_pairs/_access_link_pair.html.slim
@@ -0,0 +1,40 @@
+tr
+ td
+ .link
+ .access_point
+ = link_to([@referential, @stop_area, access_link_pair.access_point]) do
+ = image_tag "map/access_#{access_link_pair.access_point.access_point_type}.png"
+ span = access_link_pair.access_point.name
+ .info
+ = t("access_types.label.#{access_link_pair.access_point.access_point_type}")
+ td
+ - if access_link_pair.out_valid?
+ - if access_link_pair.out_exists?
+ = link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do
+ = image_tag "icons/green_left_arrow.png"
+ - else
+ = link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'stop_area_to_access_point'})) do
+ = image_tag "icons/gray_left_arrow.png"
+
+ - else
+ = image_tag "icons/disabled_left_arrow.png"
+
+ td
+ - if access_link_pair.in_valid?
+ - if access_link_pair.in_exists?
+ = link_to(referential_access_point_access_link_path(@referential, access_link_pair.access_point, access_link_pair.from_access_point)) do
+ = image_tag "icons/green_right_arrow.png"
+ - else
+ = link_to(new_referential_access_point_access_link_path(@referential, access_link_pair.access_point, :access_link => {:stop_area_id => access_link_pair.stop_area.id, :link_orientation_type => 'access_point_to_stop_area'})) do
+ = image_tag "icons/gray_right_arrow.png"
+
+ - else
+ = image_tag "icons/disabled_right_arrow.png"
+ td
+ .link
+ .stop_area
+ = link_to([@referential, access_link_pair.stop_area]) do
+ = image_tag "map/#{access_link_pair.stop_area.stop_area_type}.png"
+ span = access_link_pair.stop_area.name
+ .info
+ = t("area_types.label.#{access_link_pair.stop_area.stop_area_type}") \ No newline at end of file
diff --git a/app/views/access_links/_form.html.erb b/app/views/access_links/_form.html.erb
deleted file mode 100644
index d6c0c603e..000000000
--- a/app/views/access_links/_form.html.erb
+++ /dev/null
@@ -1,25 +0,0 @@
-<%= semantic_form_for [@referential,@access_point,@access_link] do |form| %>
- <%= form.inputs do %>
- <%= form.input :access_point_id , :as => :hidden %>
- <%= form.input :stop_area_id , :as => :hidden %>
- <%= form.input :link_orientation_type , :as => :hidden%>
- <%= form.input :name %>
- <%= form.input :access_link_type, :as => :select, :collection => Chouette::AccessLink.access_link_types, :include_blank => true, :member_label => Proc.new { |type| t("connection_link_types.label.#{type}") } %>
- <%= form.input :comment %>
- <%= form.input :link_distance %>
- <%= form.input :mobility_restricted_suitability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %>
- <%= form.input :stairs_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %>
- <%= form.input :lift_availability, :as => :select, :collection => [[t("true"), true], [t("false"), false]], :include_blank => true %>
- <%= form.input :objectid, :required => !@access_link.new_record?, :input_html => { :title => t("formtastic.titles.access_link.objectid")} %>
- <%= form.inputs :name => t('access_links.show.durations') do %>
- <%= form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @access_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>
- <%= form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @access_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>
- <%= form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>
- <%= form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" } %>
- <% end %>
- <% end %>
- <%= form.actions do %>
- <%= form.action :submit, :as => :button %>
- <%= form.action :cancel, :as => :link %>
- <% end %>
-<% end %>
diff --git a/app/views/access_links/_form.html.slim b/app/views/access_links/_form.html.slim
new file mode 100644
index 000000000..463cdf9e3
--- /dev/null
+++ b/app/views/access_links/_form.html.slim
@@ -0,0 +1,24 @@
+= semantic_form_for [@referential,@access_point,@access_link] do |form|
+
+ = form.inputs do
+ = form.input :access_point_id , as: :hidden
+ = form.input :stop_area_id , as: :hidden
+ = form.input :link_orientation_type , as: :hidden
+ = form.input :name
+ = form.input :access_link_type, as: :select, collection: Chouette::AccessLink.access_link_types, include_blank: true, member_label: Proc.new { |type| t("connection_link_types.label.#{type}") }
+ = form.input :comment
+ = form.input :link_distance
+ = form.input :mobility_restricted_suitability, as: :select, collection: [[t("true"), true], [t("false"), false]], include_blank: true
+ = form.input :stairs_availability, as: :select, collection: [[t("true"), true], [t("false"), false]], include_blank: true
+ = form.input :lift_availability, as: :select, collection: [[t("true"), true], [t("false"), false]], include_blank: true
+ = form.input :objectid, required: !@access_link.new_record?, input_html: { :title => t("formtastic.titles.access_link.objectid")}
+
+ = form.inputs :name => t('access_links.show.durations') do
+ = form.input :default_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :label => @access_link.human_attribute_name("default_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" }
+ = form.input :frequent_traveller_duration, :as => :extended_time_picker, :size => 8, :step => :seconds, :include_seconds => true, :label => @access_link.human_attribute_name("frequent_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" }
+ = form.input :occasional_traveller_duration, :as => :extended_time_picker, :size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("occasional_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" }
+ = form.input :mobility_restricted_traveller_duration, :as => :extended_time_picker,:size => 8, :include_seconds => true, :label => @access_link.human_attribute_name("mobility_restricted_traveller_duration"), :input_html => { :class => "form-control input-sm timepicker_seconds", :step => 1}, :wrapper_html => { :class => "input-append bootstrap-timepicker" }
+
+ = form.actions do
+ = form.action :submit, as: :button
+ = form.action :cancel, as: :link \ No newline at end of file
diff --git a/app/views/access_links/edit.html.erb b/app/views/access_links/edit.html.erb
deleted file mode 100644
index c954989f1..000000000
--- a/app/views/access_links/edit.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<%= title_tag t("access_links.edit.title_#{@orientation}", :access_point => @access_point.name, :stop_area => @stop_area.name ) %>
-
-
-<%= render "form" %>
diff --git a/app/views/access_links/edit.html.slim b/app/views/access_links/edit.html.slim
new file mode 100644
index 000000000..ca9cfb47f
--- /dev/null
+++ b/app/views/access_links/edit.html.slim
@@ -0,0 +1,2 @@
+= title_tag t("access_links.edit.title_#{@orientation}", access_point: @access_point.name, stop_area: @stop_area.name )
+= render "form" \ No newline at end of file
diff --git a/app/views/access_links/new.html.erb b/app/views/access_links/new.html.erb
deleted file mode 100644
index db9a611a5..000000000
--- a/app/views/access_links/new.html.erb
+++ /dev/null
@@ -1,3 +0,0 @@
-<%= title_tag t("access_links.new.title_#{@orientation}", :access_point => @access_point.name, :stop_area => @stop_area.name ) %>
-
-<%= render "form" %>
diff --git a/app/views/access_links/new.html.slim b/app/views/access_links/new.html.slim
new file mode 100644
index 000000000..85b3c886f
--- /dev/null
+++ b/app/views/access_links/new.html.slim
@@ -0,0 +1,2 @@
+= title_tag t("access_links.new.title_#{@orientation}", access_point: @access_point.name, stop_area: @stop_area.name )
+= render "form" \ No newline at end of file
diff --git a/app/views/access_links/show.html.erb b/app/views/access_links/show.html.erb
deleted file mode 100644
index 54f89297e..000000000
--- a/app/views/access_links/show.html.erb
+++ /dev/null
@@ -1,84 +0,0 @@
-<%= title_tag t('access_links.show.title', :access_link => @access_link.name ) %>
-
-<div class="access_link_show">
- <%= @map.to_html %>
-
- <div class="summary">
- <p>
- <label><%= @access_link.human_attribute_name("access_link_type") %>: </label>
- <% if @access_link.access_link_type.present? %>
- <%= t("connection_link_types.label.#{@access_link.access_link_type}") %>
- <% else %>
- <%=t("unknown") %>
- <% end %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name("comment") %>: </label>
- <%= @access_link.comment %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name("link_distance") %>: </label>
- <%= @access_link.link_distance %>
- </p>
- <p>
- <label><%= t('access_links.show.durations') %> </label>
- </p>
- <p>
- <label class='duration'><%= @access_link.human_attribute_name("default_duration") %>: </label>
- <% if (@access_link.default_duration.present?) %>
- <%= @access_link.default_duration.strftime('%Hh %Mm %Ss') %>
- <% end %>
- </p>
- <p>
- <label class='duration'><%= @access_link.human_attribute_name("frequent_traveller_duration") %>: </label>
- <% if (@access_link.frequent_traveller_duration.present?) %>
- <%= @access_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss') %>
- <% end %>
- </p>
- <p>
- <label class='duration'><%= @access_link.human_attribute_name("occasional_traveller_duration") %>: </label>
- <% if (@access_link.occasional_traveller_duration.present?) %>
- <%= @access_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss') %>
- <% end %>
- </p>
- <p>
- <label class='duration'><%= @access_link.human_attribute_name("mobility_restricted_traveller_duration") %>: </label>
- <% if (!@access_link.mobility_restricted_traveller_duration.nil?) %>
- <%= @access_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss') %>
- <% end %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name("mobility_restricted_suitability") %>: </label>
- <% if (!@access_link.mobility_restricted_suitability.nil?) %>
- <%= t((@access_link.mobility_restricted_suitability == true).to_s) %>
- <% else %>
- <%=t("unknown") %>
- <% end %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name("stairs_availability") %>: </label>
- <% if (!@access_link.stairs_availability.nil?) %>
- <%= t((@access_link.stairs_availability == true).to_s) %>
- <% else %>
- <%=t("unknown") %>
- <% end %>
- </p>
- <p>
- <label><%= @access_link.human_attribute_name("lift_availability") %>: </label>
- <% if (!@access_link.lift_availability.nil?) %>
- <%= t((@access_link.lift_availability == true).to_s) %>
- <% else %>
- <%=t("unknown") %>
- <% end %>
- </p>
- </div>
-</div>
-
-<% content_for :sidebar do %>
-<ul class="actions">
- <li><%= link_to t('access_links.actions.edit'), edit_referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), :class => "edit" %></li>
- <li><%= link_to t('access_links.actions.destroy'), referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), :method => :delete, :data => {:confirm => t('access_links.actions.destroy_confirm')}, :class => "remove" %></li>
- <br>
-</ul>
- <%= creation_tag(@access_link) %>
-<% end %>
diff --git a/app/views/access_links/show.html.slim b/app/views/access_links/show.html.slim
new file mode 100644
index 000000000..a7e296dde
--- /dev/null
+++ b/app/views/access_links/show.html.slim
@@ -0,0 +1,74 @@
+= title_tag t('access_links.show.title', access_link: @access_link.name )
+
+.access_link_show
+ = @map.to_html
+
+ .summary
+ p
+ label = "#{@access_link.human_attribute_name('access_link_type')} : "
+ - if @access_link.access_link_type.present?
+ = t("connection_link_types.label.#{@access_link.access_link_type}")
+ - else
+ =t('unknown')
+
+ p
+ label = "#{@access_link.human_attribute_name('comment')} : "
+ = @access_link.comment
+
+ p
+ label = "#{@access_link.human_attribute_name('link_distance')} : "
+ = @access_link.link_distance
+
+ p
+ label = t('access_links.show.durations')
+
+ p
+ label.duration = "#{@access_link.human_attribute_name('default_duration')} : "
+ - if (@access_link.default_duration.present?)
+ = @access_link.default_duration.strftime('%Hh %Mm %Ss')
+
+ p
+ label.duration = "#{@access_link.human_attribute_name('frequent_traveller_duration')} : "
+ - if @access_link.frequent_traveller_duration.present?
+ = @access_link.frequent_traveller_duration.strftime('%Hh %Mm %Ss')
+
+ p
+ label.duration = "#{@access_link.human_attribute_name('occasional_traveller_duration')} : "
+ - if @access_link.occasional_traveller_duration.present?
+ = @access_link.occasional_traveller_duration.strftime('%Hh %Mm %Ss')
+
+ p
+ label.duration = "#{@access_link.human_attribute_name('mobility_restricted_traveller_duration')} : "
+ - if !@access_link.mobility_restricted_traveller_duration.nil?
+ = @access_link.mobility_restricted_traveller_duration.strftime('%Hh %Mm %Ss')
+
+ p
+ label = "#{@access_link.human_attribute_name('mobility_restricted_suitability')}: "
+ - if !@access_link.mobility_restricted_suitability.nil?)
+ = t((@access_link.mobility_restricted_suitability == true).to_s)
+ - else
+ = t('unknown')
+
+ p
+ label = "#{@access_link.human_attribute_name('stairs_availability')} : "
+ - if !@access_link.stairs_availability.nil?
+ = t((@access_link.stairs_availability == true).to_s)
+ - else
+ = t('unknown')
+
+ p
+ label = "#{@access_link.human_attribute_name('lift_availability')} : "
+ - if !@access_link.lift_availability.nil?
+ = t((@access_link.lift_availability == true).to_s)
+ - else
+ = t('unknown')
+
+- content_for :sidebar do
+ ul.actions
+ li
+ = link_to t('access_links.actions.edit'), edit_referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), class: 'edit'
+ li
+ = link_to t('access_links.actions.destroy'), referential_access_point_access_link_path(@referential, @access_link.access_point, @access_link), method: :delete, data: {:confirm => t('access_links.actions.destroy_confirm')}, class: 'remove'
+ br
+
+ = creation_tag(@access_link) \ No newline at end of file
diff --git a/app/views/access_links/show.kml.erb b/app/views/access_links/show.kml.erb
deleted file mode 100644
index 25e4351b8..000000000
--- a/app/views/access_links/show.kml.erb
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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_links/show.kml.slim b/app/views/access_links/show.kml.slim
new file mode 100644
index 000000000..8812105b7
--- /dev/null
+++ b/app/views/access_links/show.kml.slim
@@ -0,0 +1,16 @@
+doctype XML
+
+kml xmlns="http://www.opengis.net/kml/2.2"
+ document
+ - if @access_link.geometry
+ placemark id="route_#{@access_link.id}"
+ name = @access_link.name
+ = @access_link.geometry.kml_representation.html_safe
+
+ placemark id="#{@access_link.access_point.id}"
+ departure = "#{@access_link.link_orientation_type == 'access_point_to_stop_area'}"
+ = @access_link.access_point.geometry.kml_representation.html_safe
+
+ placemark id="#{@access_link.stop_area.id}"
+ arrival = "#{@access_link.link_orientation_type == 'access_point_to_stop_area'}"
+ = @access_link.stop_area.geometry.kml_representation.html_safe