diff options
32 files changed, 594 insertions, 685 deletions
diff --git a/app/views/referential_stop_areas/_form.html.erb b/app/views/referential_stop_areas/_form.html.erb deleted file mode 100644 index 6ad9ba703..000000000 --- a/app/views/referential_stop_areas/_form.html.erb +++ /dev/null @@ -1,160 +0,0 @@ -<%= semantic_form_for [@referential, @stop_area] do |form| %> - <div class="row"> - <div class="container-fluid"> - <% if !manage_itl && @map %> - <%= @map.to_html %> - <% end %> - <%= form.inputs do %> - <%= form.input :id, :as => :hidden %> - <%= form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} %> - <%= form.input :stop_area_type, :as => :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } %> - <div class="location_info"> - <h3><%= t("stop_areas.stop_area.localisation") %></h3> - <div id="prefetch"> - <label><%= t('.geolocalize') %></label> - <input class="typeahead form-control input-lg" maxlength="255" type="text" placeholder="<%= t('.address') %>" /> - </div> - <% unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? %> - <%= form.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} %> - <% end %> - <%= form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} %> - <%= form.input :street_name %> - <%= form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' %> - <%= form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")} %> - <%= form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} %> - </div> - <% end %> - </div> - </div> - <div class="stop_areas.stop_area.general_info"> - <h3><%= t("stop_areas.stop_area.general") %></h3> - <%= form.inputs do %> - <%= form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} %> - <%= form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} %> - <%= form.input :fare_code, :as => :number %> - <%= form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")} %> - <%= form.input :comment, :as => :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") } %> - <%= form.input :time_zone, :include_blank => true %> - <%= form.input :url %> - <% end %> - </div> - <div class="pmr_info"> - <h3><%= t("stop_areas.stop_area.accessibility") %></h3> - <%= form.inputs do %> - <% if !manage_itl %> - <%= 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 %> - <% end %> - <% end %> - </div> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -<% end %> - -<script> - $(document).ready(function() { - var address_display = function( address ) { - var name = ""; - if ( address.house_number) { - name += address.house_number+" "; - } - name += address.road+", "; - if ( address.suburb) { - name += address.suburb+", "; - } - if ( address.postcode) { - name += address.postcode+" "; - } - if ( address.city) { - name += address.city; - } else if ( address.village) { - name += address.village; - } else if ( address.town) { - name += address.town; - } else if ( address.county ) { - name += address.county; - } else if ( address.country ) { - name += address.country; - } - - - return name; - }; - var filtering = function(list) { - // update map view - removeAddress(); - - var selection = $.grep( list, function(item) { - return (item.type == "house" || item.type == "residential" || - item.type == "tertiary" || item.type == "primary" || - item.type == "secondary") && item.address.road ; - }); - return $.map( selection, function( d) { - var city = ""; - if ( d.address.city) { - city = d.address.city; - } else if ( d.address.town) { - city = d.address.town; - } else if ( d.address.village) { - city = d.address.village; - } - return { postcode: d.address.postcode, - road: d.address.road, - lon: d.lon, lat: d.lat, - suburb: d.address.suburb, - city: city, - postcode: d.address.postcode, - the_key: address_display( d.address)}; - }); - }; - - var addressesEngine = new Bloodhound({ - datumTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road); - }, - queryTokenizer: function(d) { - return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road); - }, - limit: 10, - remote: { - url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+ - // FIXME #821 - '<%#= @referential.viewbox_left_top_right_bottom %>', - filter: filtering, - } - }); - - // kicks off the loading/processing of `local` and `prefetch` - var promise = addressesEngine.initialize(); - - // passing in `null` for the `options` arguments will result in the default - // options being used - $('#prefetch .typeahead').typeahead( - { - hint: true, - highlight: true, - minLength: 1 - }, - { - name: 'addresses', - displayKey: 'the_key', - source: addressesEngine.ttAdapter(), - } - ); - - $('.typeahead').on('typeahead:selected', function($e, datum) { - // update map view - addAddress( datum.lon, datum.lat, datum.road); - // update form fields - <% if @stop_area.new_record? %> - $('input[name="stop_area[street_name]"]').val(datum.road); - $('input[name="stop_area[zip_code]"]').val(datum.postcode); - $('input[name="stop_area[city_name]"]').val(datum.city); - <% end %> - }) - }); -</script> diff --git a/app/views/referential_stop_areas/_form.html.slim b/app/views/referential_stop_areas/_form.html.slim new file mode 100644 index 000000000..5a27abcb5 --- /dev/null +++ b/app/views/referential_stop_areas/_form.html.slim @@ -0,0 +1,152 @@ += semantic_form_for [@referential, @stop_area] do |form| + .row + .container-fluid + - if !manage_itl && @map + = @map.to_html + + = form.inputs do + = form.input :id, as: :hidden + = form.input :name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.name")} + = form.input :stop_area_type, as: :select, :input_html => { :disabled => !@stop_area.new_record? }, :collection => Chouette::StopArea.stop_area_types, :include_blank => false, :member_label => Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } + + .location_info + h3 = t("stop_areas.stop_area.localisation") + #prefetch + label = t('.geolocalize') + input.typeahead.form-control.input-lg maxlength="255" type="text" placeholder="#{t('.address')}" + + - unless @stop_area.projection.blank? or @stop_area.projection_type_label.empty? + = form.input :projection_xy, :label => t("activerecord.attributes.stop_area.projection_xy", :projection => @referential.projection_type_label), :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.projection_xy")} + + = form.input :coordinates, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.coordinates")} + = form.input :street_name + = form.input :country_code, required: format_restriction_for_locales(@referential) == '.hub' + = form.input :zip_code, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.zip_code")} + = form.input :city_name, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.city_name")} + + .stop_areas.stop_area.general_info + h3 = t("stop_areas.stop_area.general") + + = form.inputs do + = form.input :objectid, :required => !@stop_area.new_record?, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.objectid")} + = form.input :registration_number, required: format_restriction_for_locales(@referential) == '.hub', :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.registration_number")} + = form.input :fare_code, as: :number + = form.input :nearest_topic_name, :input_html => { :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.nearest_topic_name")} + = form.input :comment, as: :text, :input_html => { :rows => 5, :title => t("formtastic.titles#{format_restriction_for_locales(@referential)}.stop_area.comment") } + = form.input :time_zone, :include_blank => true + = form.input :url + + .pmr_info + h3 = t("stop_areas.stop_area.accessibility") + = form.inputs do + - if !manage_itl + = 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.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(document).ready(function() { + var address_display = function( address ) { + var name = ""; + if ( address.house_number) { + name += address.house_number+" "; + } + name += address.road+", "; + if ( address.suburb) { + name += address.suburb+", "; + } + if ( address.postcode) { + name += address.postcode+" "; + } + if ( address.city) { + name += address.city; + } else if ( address.village) { + name += address.village; + } else if ( address.town) { + name += address.town; + } else if ( address.county ) { + name += address.county; + } else if ( address.country ) { + name += address.country; + } + + + return name; + }; + var filtering = function(list) { + // update map view + removeAddress(); + + var selection = $.grep( list, function(item) { + return (item.type == "house" || item.type == "residential" || + item.type == "tertiary" || item.type == "primary" || + item.type == "secondary") && item.address.road ; + }); + return $.map( selection, function( d) { + var city = ""; + if ( d.address.city) { + city = d.address.city; + } else if ( d.address.town) { + city = d.address.town; + } else if ( d.address.village) { + city = d.address.village; + } + return { postcode: d.address.postcode, + road: d.address.road, + lon: d.lon, lat: d.lat, + suburb: d.address.suburb, + city: city, + postcode: d.address.postcode, + the_key: address_display( d.address)}; + }); + }; + + var addressesEngine = new Bloodhound({ + datumTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.id+" : "+d.road); + }, + queryTokenizer: function(d) { + return Bloodhound.tokenizers.whitespace(d.id+" :: "+d.road); + }, + limit: 10, + remote: { + url: 'http://nominatim.openstreetmap.org/search?q=%QUERY&format=json&addressdetails=1&bounded=1&viewbox='+ + // FIXME #821 + // <%#= @referential.viewbox_left_top_right_bottom %>', + filter: filtering, + } + }); + + // kicks off the loading/processing of `local` and `prefetch` + var promise = addressesEngine.initialize(); + + // passing in `null` for the `options` arguments will result in the default + // options being used + $('#prefetch .typeahead').typeahead( + { + hint: true, + highlight: true, + minLength: 1 + }, + { + name: 'addresses', + displayKey: 'the_key', + source: addressesEngine.ttAdapter(), + } + ); + + $('.typeahead').on('typeahead:selected', function($e, datum) { + // update map view + addAddress( datum.lon, datum.lat, datum.road); + // update form fields + - if @stop_area.new_record? + $('input[name="stop_area[street_name]"]').val(datum.road); + $('input[name="stop_area[zip_code]"]').val(datum.postcode); + $('input[name="stop_area[city_name]"]').val(datum.city); + + }) + });
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_genealogical.html.erb b/app/views/referential_stop_areas/_genealogical.html.erb deleted file mode 100644 index a76b972e2..000000000 --- a/app/views/referential_stop_areas/_genealogical.html.erb +++ /dev/null @@ -1,66 +0,0 @@ - <h3><%= genealogical_title %></h3> - - <% if @stop_area.parent.present? %> - <div class="parent"> - <%= link_to([@referential, @stop_area.parent], :title => t("area_types.label.#{ @stop_area.parent.stop_area_type}") + " #{ @stop_area.parent.name}") do %> - <%= image_tag "map/" + @stop_area.parent.stop_area_type + ".png" %><span><%= @stop_area.parent.name %></span> - <% end %> - </div> - <div class="link"><%= image_tag "icons/link.png"%></div> - <% elsif @stop_area.routing_lines.present? %> - <div class="lines"> - <% @stop_area.routing_lines.each do |line| %> - <div class="line"> - <%= link_to([@referential, line]) do %> - <span><%= line.name %></span> - <% end %> - </div> - <% end %> - </div> - <div class="link"><%= image_tag "icons/link.png"%></div> - <% else %> - <div class="no_parent"> </div> - <% end %> - - <div class="target"> - <%= image_tag "map/" + @stop_area.stop_area_type + ".png"%><span><%= @stop_area.name %></span> - </div> - - <% if @stop_area.children.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.children.each do |child| %> - <div class="child"> - <%= link_to([@referential, child], :title => t("area_types.label.#{ child.stop_area_type}") + " #{ child.name}") do %> - <%= image_tag "map/" + child.stop_area_type + ".png" %><span><%= child.name %></span> - <% end %> - </div> - <% end %> - </div> - <% elsif @stop_area.routing_stops.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.routing_stops.each do |stop| %> - <div class="child"> - <%= link_to([@referential, stop], :title => t("area_types.label.#{ stop.stop_area_type}") + " #{ stop.name}") do %> - <%= image_tag "map/" + stop.stop_area_type + ".png" %><span><%= "#{stop.name} #{' [' + stop.registration_number + ']' if stop.registration_number.present? }" %></span> - <% end %> - </div> - <% end %> - </div> - <% elsif @stop_area.routes.present? %> - <div class="link"><%= image_tag "icons/link.png"%></div> - <div class="children"> - <% @stop_area.routes.each do |route| %> - <div class="child"> - <%= link_to([@referential, route.line ]) do %> - <span><%= route.line.number %></span> - <% end %> - - <%= link_to([@referential, route.line , route]) do %> - <span><%= route.name %></span> - <% end %> - </div> - <% end %> - </div> - <% end %> diff --git a/app/views/referential_stop_areas/_genealogical.html.slim b/app/views/referential_stop_areas/_genealogical.html.slim new file mode 100644 index 000000000..a44884c92 --- /dev/null +++ b/app/views/referential_stop_areas/_genealogical.html.slim @@ -0,0 +1,54 @@ +h3 = genealogical_title + +- if @stop_area.parent.present? + .parent + = link_to([@referential, @stop_area.parent], :title => t("area_types.label.#{@stop_area.parent.stop_area_type}") + "#{@stop_area.parent.name}") do + = image_tag "map/" + @stop_area.parent.stop_area_type + ".png" + = @stop_area.parent.name + + .link + = image_tag "icons/link.png" + +- elsif @stop_area.routing_lines.present? + .lines + - @stop_area.routing_lines.each do |line| + .line + = link_to([@referential, line]) do + span> = line.name + + .link = image_tag "icons/link.png" +- else + .no_parent = + +.target + = image_tag "map/" + @stop_area.stop_area_type + ".png" + span = @stop_area.name + +- if @stop_area.children.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.children.each do |child| + .child + = link_to([@referential, child], :title => t("area_types.label.#{ child.stop_area_type}") + " #{ child.name}") do + = image_tag "map/" + child.stop_area_type + ".png" + span = child.name + +- elsif @stop_area.routing_stops.present? + .link = image_tag "icons/link.png" + .children + - @stop_area.routing_stops.each do |stop| + .child + = link_to([@referential, stop], :title => t("area_types.label.#{ stop.stop_area_type}") + " #{ stop.name}") do + = image_tag "map/" + stop.stop_area_type + ".png" + span = "#{stop.name} #{' [' + stop.registration_number + ']' if stop.registration_number.present? }" + +- elsif @stop_area.routes.present? + <div class="link"><%= image_tag "icons/link.png"%></div> + .children + - @stop_area.routes.each do |route| + .child + = link_to([@referential, route.line ]) do + span = route.line.number + + = link_to([@referential, route.line , route]) do + span = route.name
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_stop_area.html.erb b/app/views/referential_stop_areas/_stop_area.html.erb deleted file mode 100644 index 2d2118aed..000000000 --- a/app/views/referential_stop_areas/_stop_area.html.erb +++ /dev/null @@ -1,53 +0,0 @@ -<div id="index_item" class="panel panel-default stop_area"> - <div class="panel-heading"> - <div class="panel-title clearfix"> - <span class="pull-right"> - <%= link_to edit_referential_stop_area_path(@referential, stop_area), :class => "btn btn-default btn-sm" do %> - <span class="fa fa-pencil"></span> - <% end %> - <%= link_to referential_stop_area_path(@referential, stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %> - <span class="fa fa-trash-o"></span> - <% end %> - </span> - <h5> - <%= link_to([@referential, stop_area], :class => "preview", :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do %> - <span class="name"> - <%= image_tag "map/" + stop_area.stop_area_type + ".png" %> <%= truncate(stop_area.name, :length => 20) %> - </span> - <% end %> - </h5> - </div> - </div> - <div class="panel-body"> - <p> - <% unless stop_area.area_type == 'ITL' || stop_area.geometry %> - <span class="warning"><%= t('.no_position') %></span> - <% end %> - </p> - <p> - <%= stop_area.human_attribute_name('registration_number') %> : <%= stop_area.registration_number.present? ? stop_area.registration_number : t(".no_object") %> - </p> - <p> - <%= t('.address') %> : <%= (stop_area.zip_code.present? || stop_area.city_name.present?) ? "#{stop_area.zip_code} #{stop_area.city_name}" : t(".no_object") %> - </p> - <p> - <% if stop_area.area_type == 'ITL' %> - <%= t('.lines') %> : <% if stop_area.routing_lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_area.routing_lines.each do |line| %> - <span class="label label-default line"><%= line.number %></span> - <% end %> - <% end %> - <% else %> - <%= t('.lines') %> : <% if stop_area.lines.blank? %> - <%= t(".no_object") %> - <% else %> - <% stop_area.lines.each do |line| %> - <span class="label label-default line"><%= line.number || truncate( line.name, :length => 4 ) %></span> - <% end %> - <% end %> - <% end %> - </p> - </div> -</div> diff --git a/app/views/referential_stop_areas/_stop_area.html.slim b/app/views/referential_stop_areas/_stop_area.html.slim new file mode 100644 index 000000000..f94bd319e --- /dev/null +++ b/app/views/referential_stop_areas/_stop_area.html.slim @@ -0,0 +1,44 @@ +#index_item.panel.panel-default.stop_area + .panel-heading + .panel-title.clearfix + span.pull-right + = link_to edit_referential_stop_area_path(@referential, stop_area), class: 'btn btn-default btn-sm' do + span.fa.fa-pencil + + = link_to referential_stop_area_path(@referential, stop_area), method: :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, class: 'btn btn-danger btn-sm' do + span.fa.fa-trash-o + + h5 + = link_to([@referential, stop_area], class: "preview", :title => t("area_types.label.#{stop_area.stop_area_type}") + " #{stop_area.name}") do + span.name + = image_tag "map/" + stop_area.stop_area_type + ".png" + = truncate(stop_area.name, :length => 20) + + .panel-body + p + - unless stop_area.area_type == 'ITL' || stop_area.geometry + span.warning = t('.no_position') + + p + = "#{stop_area.human_attribute_name('registration_number')} : #{stop_area.registration_number.present? ? stop_area.registration_number : t('.no_object')}" + + p + = "#{t('.address')} : " + = "#{(stop_area.zip_code.present? || stop_area.city_name.present?) ? "#{stop_area.zip_code} #{stop_area.city_name}" : t('.no_object')}" + + p + - if stop_area.area_type == 'ITL' + = "#{t('.lines')} : " + - if stop_area.routing_lines.blank? + = t(".no_object") + - else + - stop_area.routing_lines.each do |line| + span.label.label-default.line = line.number + + - else + = "#{t('.lines')} : " + - if stop_area.lines.blank? + = t(".no_object") + - else + - stop_area.lines.each do |line| + span.label.label-default.line = line.number || truncate( line.name, length: 4 )
\ No newline at end of file diff --git a/app/views/referential_stop_areas/_stop_areas.html.erb b/app/views/referential_stop_areas/_stop_areas.html.erb deleted file mode 100644 index 9c7a82d6d..000000000 --- a/app/views/referential_stop_areas/_stop_areas.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -<div class="page_info"> - <span class="search"> <%= t("will_paginate.page_entries_info.search") %></span> <%= page_entries_info @stop_areas %> -</div> -<div class="stop_areas paginated_content"> - <%= paginated_content(@stop_areas) %> -</div> -<div class="pagination"> - <%= will_paginate @stop_areas, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer %> -</div> diff --git a/app/views/referential_stop_areas/_stop_areas.html.slim b/app/views/referential_stop_areas/_stop_areas.html.slim new file mode 100644 index 000000000..e05bab1bc --- /dev/null +++ b/app/views/referential_stop_areas/_stop_areas.html.slim @@ -0,0 +1,9 @@ +.page_info + span.search = t("will_paginate.page_entries_info.search") + = page_entries_info @stop_areas + +.stop_areas.paginated_content + = paginated_content(@stop_areas) + +.pagination + = will_paginate @stop_areas, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer
\ No newline at end of file diff --git a/app/views/referential_stop_areas/access_links.html.erb b/app/views/referential_stop_areas/access_links.html.erb deleted file mode 100644 index 3cea2fbdd..000000000 --- a/app/views/referential_stop_areas/access_links.html.erb +++ /dev/null @@ -1,46 +0,0 @@ -<%= title_tag t('stop_areas.access_links.title', :stop_area => @stop_area.name ) %> - -<div class="stop_area_show"> - -<div class="panel-group" id="generic"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#generic" href="#generic_access_links"> - <%= t('.generic_access_links') %> - </a> - </h4> - </div> - <div id="generic_access_links" class="panel-collapse collapse in"> - <div class="panel-body"> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@generic_access_links) %> - </table> - </div> - </div> - </div> - </div> -</div> - -<div class="panel-group" id="detail"> - <div class="panel panel-default"> - <div class="panel-heading"> - <h4 class="panel-title"> - <a data-toggle="collapse" data-parent="#detail" href="#detail_access_links"> - <%= t('.detail_access_links') %> - </a> - </h4> - </div> - <div id="detail_access_links" class="panel-collapse collapse"> - <div class="panel-body"> - <div class="access_link_pairs"> - <table> - <%= render :partial => "access_link_pairs/access_link_pair", :collection => access_links_pairs(@detail_access_links) %> - </table> - </div> - </div> - </div> - </div> -</div> - diff --git a/app/views/referential_stop_areas/access_links.html.slim b/app/views/referential_stop_areas/access_links.html.slim new file mode 100644 index 000000000..128d1b4b9 --- /dev/null +++ b/app/views/referential_stop_areas/access_links.html.slim @@ -0,0 +1,28 @@ += title_tag t('stop_areas.access_links.title', stop_area: @stop_area.name ) + +.stop_area_show + #generic.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#generic" href="#generic_access_links" + = t('.generic_access_links') + + #generic_access_links.panel-collapse.collapse.in + .panel-body + .access_link_pairs + table + = render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@generic_access_links) + + #detail.panel-group + .panel.panel-default + .panel-heading + h4.panel-title + a data-toggle="collapse" data-parent="#detail" href="#detail_access_links + = t('.detail_access_links') + + #detail_access_links.panel-collapse.collapse + .panel-body + .access_link_pairs + table + = render partial: 'access_link_pairs/access_link_pair', collection: access_links_pairs(@detail_access_links)
\ No newline at end of file diff --git a/app/views/referential_stop_areas/add_children.html.erb b/app/views/referential_stop_areas/add_children.html.erb deleted file mode 100644 index 4d30ba674..000000000 --- a/app/views/referential_stop_areas/add_children.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.add_children.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :children_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=children&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @children, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/add_children.html.slim b/app/views/referential_stop_areas/add_children.html.slim new file mode 100644 index 000000000..50b6ae5a5 --- /dev/null +++ b/app/views/referential_stop_areas/add_children.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.add_children.title', stop_area: @stop_area.name) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :children_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=children&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @children, :view_path => 'app/views', :format => :json, :scope => self ).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/add_routing_lines.html.erb b/app/views/referential_stop_areas/add_routing_lines.html.erb deleted file mode 100644 index 84d03f8b2..000000000 --- a/app/views/referential_stop_areas/add_routing_lines.html.erb +++ /dev/null @@ -1,32 +0,0 @@ -<%= title_tag t('stop_areas.add_routing_lines.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :routing_line_ids, :as => :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<script> - $(function() { - $( "#stop_area_routing_line_ids" ).tokenInput('<%= referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, :format => :json) %>', { - crossDomain: false, - prePopulate: $('#stop_area_routing_line_id').data('pre'), - minChars: 1, - hintText: '<%= t('search_hint') %>', - noResultsText: '<%= t('no_result_text') %>', - searchingText: '<%= t('searching_term') %>' - }); - }); -</script> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/add_routing_lines.html.slim b/app/views/referential_stop_areas/add_routing_lines.html.slim new file mode 100644 index 000000000..667d58254 --- /dev/null +++ b/app/views/referential_stop_areas/add_routing_lines.html.slim @@ -0,0 +1,25 @@ += title_tag t('stop_areas.add_routing_lines.title', stop_area: @stop_area.name) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :routing_line_ids, as: :text, :input_html => { :"data-pre" => ( @lines.map { |line| { :id => line.id.to_s, :name => "#{line.number} - #{line.name}" } } ).to_json } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +javascript: + $(function() { + $("#stop_area_routing_line_ids").tokenInput("#{referential_stop_area_stop_area_routing_lines_path(@referential, @stop_area, format: :json)}", { + crossDomain: false, + prePopulate: $('#stop_area_routing_line_id').data('pre'), + minChars: 1, + hintText: "#{t('search_hint')}", + noResultsText: "#{t('no_result_text')}", + searchingText: "#{t('searching_term')}" + }); + }); + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/add_routing_stops.html.erb b/app/views/referential_stop_areas/add_routing_stops.html.erb deleted file mode 100644 index 310e2f8b0..000000000 --- a/app/views/referential_stop_areas/add_routing_stops.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.add_routing_stops.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :routing_stop_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @stop_area.routing_stops, :view_path => 'app/views', :format => :json, :scope => self).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/add_routing_stops.html.slim b/app/views/referential_stop_areas/add_routing_stops.html.slim new file mode 100644 index 000000000..4cd1acc0a --- /dev/null +++ b/app/views/referential_stop_areas/add_routing_stops.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.add_routing_stops.title', :stop_area => @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :routing_stop_ids, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?filter=itl_excluded", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'),:searching_text => t('searching_term'), :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', @stop_area.routing_stops, :view_path => 'app/views', :format => :json, :scope => self).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/edit.html.erb b/app/views/referential_stop_areas/edit.html.erb deleted file mode 100644 index 10d937050..000000000 --- a/app/views/referential_stop_areas/edit.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('stop_areas.edit.title', :stop_area => @stop_area.name ) %> - -<%= render "form" %> diff --git a/app/views/referential_stop_areas/edit.html.slim b/app/views/referential_stop_areas/edit.html.slim new file mode 100644 index 000000000..a999ab715 --- /dev/null +++ b/app/views/referential_stop_areas/edit.html.slim @@ -0,0 +1,3 @@ += title_tag t('stop_areas.edit.title', stop_area: @stop_area.name) + += render 'form'
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.html.erb b/app/views/referential_stop_areas/index.html.erb deleted file mode 100644 index 17f36d562..000000000 --- a/app/views/referential_stop_areas/index.html.erb +++ /dev/null @@ -1,38 +0,0 @@ -<%= title_tag t('stop_areas.index.title') %> - -<div id="country_codes"> - <%= @country_codes.to_json %> -</div> - -<%= search_form_for @q, :url => referential_stop_areas_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| %> -<div class="panel panel-default"> - <div class="panel-heading"> - <div class="input-group col-md-9"> - <%= f.text_field :name_cont, :placeholder => "#{t('.name')}", :class => 'form-control' %> - <div class="input-group-btn"> - <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> - </div> - </div><!-- /input-group --> - <a data-toggle="collapse" data-parent="#search" href="#advanced_search"> - <i class="fa fa-plus"></i> <%= "#{t('.advanced_search')}" %> - </a> - </div> - - <div id="advanced_search" class="panel-collapse collapse"> - <div class="panel-body"> - <%= f.text_field :zip_code_cont, :placeholder => "#{t('.zip_code')}", :class => 'form-control typeahead' %> - <%= f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { :include_blank => "#{t('.area_type')}" }, { :class => 'form-control' }) %> - </div> - </div> -</div> -<% end %> - -<div id="stop_areas"><%= render 'stop_areas' %></div> - -<% content_for :sidebar do %> -<ul class="actions"> - <li><%= link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), :class => "add" %></li> - <li><%#= link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@referential), :method => :put, :class => "calculator" %></li> -</ul> - -<% end %> diff --git a/app/views/referential_stop_areas/index.html.slim b/app/views/referential_stop_areas/index.html.slim new file mode 100644 index 000000000..85bd15d20 --- /dev/null +++ b/app/views/referential_stop_areas/index.html.slim @@ -0,0 +1,32 @@ += title_tag t('stop_areas.index.title') + +#country_codes + = @country_codes.to_json + += search_form_for @q, :url => referential_stop_areas_path(@referential), remote: true, :html => {:method => :get, class: "form-inline", :id => "search", role: "form"} do |f| + .panel.panel-default + .panel-heading + .input-group.col-md-9 + = f.text_field :name_cont, :placeholder => "#{t('.name')}", class: 'form-control' + .input-group-btn + button.btn.btn-default type="submit" + i.fa.fa-search + + a data-toggle="collapse" data-parent="#search" href="#advanced_search" + i.fa.fa-plus + = "#{t('.advanced_search')}" + + #advanced_search.panel-collapse.collapse + .panel-body + = f.text_field :zip_code_cont, :placeholder => "#{t('.zip_code')}", class: 'form-control typeahead' + = f.select(:area_type_cont, options_from_collection_for_select(Chouette::StopArea.stop_area_types, 'name', Proc.new { |stop_area_type| t("area_types.label.#{stop_area_type}") } ), { :include_blank => "#{t('.area_type')}" }, { :class => 'form-control' }) + +#stop_areas + = render 'stop_areas' + +- content_for :sidebar do + ul.actions + li + = link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), class: 'add' + li + / = link_to t('stop_areas.actions.default_geometry'), default_geometry_referential_stop_areas_path(@referential), :method => :put, :class => "calculator"
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.js.erb b/app/views/referential_stop_areas/index.js.erb deleted file mode 100644 index 1621823cc..000000000 --- a/app/views/referential_stop_areas/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#stop_areas').html('<%= escape_javascript(render("stop_areas")) %>');
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.js.slim b/app/views/referential_stop_areas/index.js.slim new file mode 100644 index 000000000..3105fb356 --- /dev/null +++ b/app/views/referential_stop_areas/index.js.slim @@ -0,0 +1 @@ +$('#stop_areas').html("#{escape_javascript(render('stop_areas'))}");
\ No newline at end of file diff --git a/app/views/referential_stop_areas/index.kml.erb b/app/views/referential_stop_areas/index.kml.erb deleted file mode 100644 index f43f130b6..000000000 --- a/app/views/referential_stop_areas/index.kml.erb +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kml xmlns="http://www.opengis.net/kml/2.2"> - <Document> - <% @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| %> - <Placemark id="<%= stop_area.id %>" > - <name><%= stop_area.name %></name> - <stop_area_type><%= stop_area.stop_area_type %></stop_area_type> - <stop_area_type_label><%= t("area_types.label.#{stop_area.stop_area_type}") %></stop_area_type_label> - <%= stop_area.geometry.kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/referential_stop_areas/index.kml.slim b/app/views/referential_stop_areas/index.kml.slim new file mode 100644 index 000000000..00d257f93 --- /dev/null +++ b/app/views/referential_stop_areas/index.kml.slim @@ -0,0 +1,10 @@ +doctype XML + +kml xmlns="http://www.opengis.net/kml/2.2" + document + - @stop_areas.where("latitude is not null and longitude is not null").each do |stop_area| + placemark id="#{stop_area.id}" + name = stop_area.name + stop_area_type = stop_area.stop_area_type + stop_area_type_label = t("area_types.label.#{stop_area.stop_area_type}") + = stop_area.geometry.kml_representation.html_safe
\ No newline at end of file diff --git a/app/views/referential_stop_areas/new.html.erb b/app/views/referential_stop_areas/new.html.erb deleted file mode 100644 index 9fcf4390e..000000000 --- a/app/views/referential_stop_areas/new.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= title_tag t('stop_areas.new.title') %> - -<%= render "form" %> diff --git a/app/views/referential_stop_areas/new.html.slim b/app/views/referential_stop_areas/new.html.slim new file mode 100644 index 000000000..54fd59422 --- /dev/null +++ b/app/views/referential_stop_areas/new.html.slim @@ -0,0 +1,3 @@ += title_tag t('stop_areas.new.title') + += render 'form'
\ No newline at end of file diff --git a/app/views/referential_stop_areas/select_parent.html.erb b/app/views/referential_stop_areas/select_parent.html.erb deleted file mode 100644 index 3f550d370..000000000 --- a/app/views/referential_stop_areas/select_parent.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%= title_tag t('stop_areas.select_parent.title', :stop_area => @stop_area.name ) %> - -<%= semantic_form_for [@referential, @stop_area] do |form| %> -<div> - <%= form.inputs do %> - <%= form.input :parent_id, :as => :search_stop_area, :json => referential_autocomplete_stop_areas_path(@referential, :format => :json)+"?relation=parent&target_type=#{@stop_area.area_type}", :hint_text => t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [@parent].compact, :view_path => 'app/views', :format => :json, :scope => self ).render } %> - <% end %> - - <%= form.actions do %> - <%= form.action :submit, :as => :button %> - <%= form.action :cancel, :as => :link %> - <% end %> -</div> -<% end %> - -<% content_for :sidebar do %> -<ul class="actions"> -</ul> -<% end %> diff --git a/app/views/referential_stop_areas/select_parent.html.slim b/app/views/referential_stop_areas/select_parent.html.slim new file mode 100644 index 000000000..4a72f5c1d --- /dev/null +++ b/app/views/referential_stop_areas/select_parent.html.slim @@ -0,0 +1,13 @@ += title_tag t('stop_areas.select_parent.title', stop_area: @stop_area.name ) + += semantic_form_for [@referential, @stop_area] do |form| + div + = form.inputs do + = form.input :parent_id, as: :search_stop_area, json: referential_autocomplete_stop_areas_path(@referential, format: :json)+"?relation=parent&target_type=#{@stop_area.area_type}", hint_text: t('search_hint'), :no_result_text => t('no_result_text'), :searching_text => t('searching_term'), :tokenLimit => 1, :input_html => { :"data-pre" => Rabl::Renderer.new('autocomplete_stop_areas/index', [@parent].compact, :view_path => 'app/views', format: :json, :scope => self ).render } + + = form.actions do + = form.action :submit, as: :button + = form.action :cancel, as: :link + +- content_for :sidebar do + ul.actions
\ No newline at end of file diff --git a/app/views/referential_stop_areas/show.html.erb b/app/views/referential_stop_areas/show.html.erb deleted file mode 100644 index 7083abd10..000000000 --- a/app/views/referential_stop_areas/show.html.erb +++ /dev/null @@ -1,176 +0,0 @@ -<%= title_tag t('stop_areas.show.title', :stop_area => @stop_area.name ) %> - -<div class="stop_area_show"> - <% if show_map? %> - <%= @map.to_html %> - <% end %> - <div class="summary"> - <p> - <label><%= @stop_area.human_attribute_name("comment") %>: </label> - <%= @stop_area.comment %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("nearest_topic_name") %>: </label> - <%= @stop_area.nearest_topic_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("street_name") %>: </label> - <%= @stop_area.street_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("country_code") %>: </label> - <%= @stop_area.country_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("zip_code") %>: </label> - <%= @stop_area.zip_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("city_name") %>: </label> - <%= @stop_area.city_name %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("fare_code") %>: </label> - <%= @stop_area.fare_code %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("time_zone") %>: </label> - <%= @stop_area.time_zone %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("url") %>: </label> - <%= @stop_area.url %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("registration_number") %>: </label> - <%= @stop_area.registration_number %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("stop_area_type") %>: </label> - <%= t("area_types.label.#{@stop_area.stop_area_type}") %> - <i class="fa fa-info-circle" data-toggle="tooltip" data-placement="right" title="<%= t('.not_editable') %>"></i> - </p> - <% if !manage_itl %> - <p> - <label><%= @stop_area.human_attribute_name("mobility_restricted_suitability") %>: </label> - <% if (!@stop_area.mobility_restricted_suitability.nil?) %> - <%= t((@stop_area.mobility_restricted_suitability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("stairs_availability") %>: </label> - <% if (!@stop_area.stairs_availability.nil?) %> - <%= t((@stop_area.stairs_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> - <label><%= @stop_area.human_attribute_name("lift_availability") %>: </label> - <% if (!@stop_area.lift_availability.nil?) %> - <%= t((@stop_area.lift_availability == true).to_s) %> - <% else %> - <%=t("unknown") %> - <% end %> - </p> - <p> <label><%= t('stop_areas.show.geographic_data') %> </label></p> - <% if @stop_area.long_lat_type == nil %> - <span class='geo_data'><%= t('stop_areas.show.no_geographic_data') %></span> - <% else %> - <% if !@stop_area.projection.nil? %> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection") %>: </span> - <%= @referential.projection_type_label %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection_x") %>: </span> - <%= @stop_area.projection_x %> - </p> - <p> - <span class='geo_data'><%= @stop_area.human_attribute_name("projection_y") %>: </span> - <%= @stop_area.projection_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 %> - </div> -</div> -<p class="after_map" /> - -<div class="genealogical clearfix"> - <%= render "stop_areas/genealogical" %> -</div> - -<% if manage_access_points %> -<div> - <h3><%= t('.access_points') %></h3> - - <div class="access_points paginated_content"> - <%= paginated_content @access_points, "access_points/access_point" %> - </div> -</div> -<% end %> - -<% content_for :sidebar do %> - <table> - <tr><td> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), :class => "add" %></li> - <li><%= link_to t('stop_areas.actions.edit'), edit_referential_stop_area_path(@referential, @stop_area), :class => "edit" %></li> - <li><%= link_to t('stop_areas.actions.destroy'), referential_stop_area_path(@referential, @stop_area), :method => :delete, :data => {:confirm => t('stop_areas.actions.destroy_confirm')}, :class => "remove" %></li> - </ul> - </td></tr> - <% if manage_itl %> - <tr><td> - <h4><%= t(".itl_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_referential_stop_area_path(@referential, @stop_area), :class => "add_routing_lines" %></li> - <li><%= link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_referential_stop_area_path(@referential, @stop_area), :class => "add_routing_stops" %></li> - </ul> - </td></tr> - <% else %> - <tr><td> - <h4><%= t(".stop_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), :class => "parent" %></li> - <% if @stop_area.parent == nil %> - <li><%= link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "parent"), :class => "clone" %></li> - <% end %> - <% if manage_children %> - <li><%= link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), :class => "children" %></li> - <li><%= link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, :hierarchy => "child"), :class => "clone" %></li> - <% end %> - </ul> - </td></tr> - - <% if manage_access_points %> - <tr><td> - <h4><%= t(".access_managment") %></h4> - <ul class="actions"> - <li><%= link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), :class => "add" %></li> - <li><%= link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), :class => "access_link" %></li> - </ul> - </td></tr> - <% end %> - - <% end %> - </table> - <br> - <%= creation_tag(@stop_area) %> -<% end %> diff --git a/app/views/referential_stop_areas/show.html.slim b/app/views/referential_stop_areas/show.html.slim new file mode 100644 index 000000000..2224728e9 --- /dev/null +++ b/app/views/referential_stop_areas/show.html.slim @@ -0,0 +1,172 @@ += title_tag t('stop_areas.show.title', stop_area: @stop_area.name) + +.stop_area_show + = @map.to_html if show_map? + + .summary + p + label = "#{@stop_area.human_attribute_name('comment')} : " + = @stop_area.comment + + p + label = "#{@stop_area.human_attribute_name('nearest_topic_name')} : " + = @stop_area.nearest_topic_name + + p + label = "#{@stop_area.human_attribute_name('street_name')} : " + = @stop_area.street_name + + p + label = "#{@stop_area.human_attribute_name('country_code')} : " + = @stop_area.country_code + + p + label = "#{@stop_area.human_attribute_name('zip_code')} : " + = @stop_area.zip_code + + p + label = "#{@stop_area.human_attribute_name('city_name')} : " + = @stop_area.city_name + + p + label = "#{@stop_area.human_attribute_name('fare_code')} : " + = @stop_area.fare_code + + p + label = "#{@stop_area.human_attribute_name('time_zone')} : " + = @stop_area.time_zone + + p + label = "#{@stop_area.human_attribute_name('url')} : " + = @stop_area.url + + p + label = "#{@stop_area.human_attribute_name('registration_number')} : " + = @stop_area.registration_number + + p + label = "#{@stop_area.human_attribute_name('stop_area_type')} : " + = t("area_types.label.#{@stop_area.stop_area_type}") + + i.fa.fa-info-circle data-toggle="tooltip" data-placement="right" title="#{t('.not_editable')}" + + - if !manage_itl + p + label = "#{@stop_area.human_attribute_name('mobility_restricted_suitability')} : " + + - if !@stop_area.mobility_restricted_suitability.nil? + = t((@stop_area.mobility_restricted_suitability == true).to_s) + - else + = t('unknown') + + p + label = "#{@stop_area.human_attribute_name('stairs_availability')} : " + + - if !@stop_area.stairs_availability.nil? + = t((@stop_area.stairs_availability == true).to_s) + - else + = t('unknown') + + p + label = "#{@stop_area.human_attribute_name('lift_availability')} : " + - if !@stop_area.lift_availability.nil? + = t((@stop_area.lift_availability == true).to_s) + - else + = t('unknown') + + p + label = t('stop_areas.show.geographic_data') + + - if @stop_area.long_lat_type == nil + span.geo_data = t('stop_areas.show.no_geographic_data') + - else + - if !@stop_area.projection.nil? + p + span.geo_data = "#{@stop_area.human_attribute_name('projection')} : " + = @referential.projection_type_label + + p + span.geo_data = "#{@stop_area.human_attribute_name('projection_x')} : " + = @stop_area.projection_x + + p + span.geo_data = "#{@stop_area.human_attribute_name('projection_y')} : " + = @stop_area.projection_y + + - if !@stop_area.long_lat_type.nil? + p + span.geo_data = "#{@stop_area.human_attribute_name('long_lat_type')} : " + = @stop_area.long_lat_type + + p + span.geo_data = "#{@stop_area.human_attribute_name('longitude')} : " + = @stop_area.longitude + + p + span.geo_data = "#{@stop_area.human_attribute_name('latitude')} : " + = @stop_area.latitude + +p.after_map + +.genealogical.clearfix + = render "stop_areas/genealogical" + +- if manage_access_points + div + h3 = t('.access_points') + .access_points.paginated_content + = paginated_content @access_points, "access_points/access_point" + +- content_for :sidebar do + table + tr + td + ul.actions + li + = link_to t('stop_areas.actions.new'), new_referential_stop_area_path(@referential), class: 'add' + li + = link_to t('stop_areas.actions.edit'), edit_referential_stop_area_path(@referential, @stop_area), class: 'edit' + li + = link_to t('stop_areas.actions.destroy'), referential_stop_area_path(@referential, @stop_area), method: :delete, data: { :confirm => t('stop_areas.actions.destroy_confirm') }, class: 'remove' + + - if manage_itl + tr + td + h4 = t('.itl_managment') + ul.actions + li + = link_to t('stop_areas.actions.add_routing_lines'), add_routing_lines_referential_stop_area_path(@referential, @stop_area), class: 'add_routing_lines' + li + = link_to t('stop_areas.actions.add_routing_stops'), add_routing_stops_referential_stop_area_path(@referential, @stop_area), class: 'add_routing_stops' + + - else + tr + td + h4 = t('.stop_managment') + ul.actions + li + = link_to t('stop_areas.actions.select_parent'), select_parent_referential_stop_area_path(@referential, @stop_area), class: 'parent' + + - if @stop_area.parent == nil + li + = link_to t('stop_areas.actions.clone_as_parent'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, hierarchy: 'parent'), class: 'clone' + + - if manage_children + li + = link_to t('stop_areas.actions.add_children'), add_children_referential_stop_area_path(@referential, @stop_area), class: 'children' + li + = link_to t('stop_areas.actions.clone_as_child'), new_referential_stop_area_stop_area_copy_path(@referential, @stop_area, hierarchy: 'child'), class: 'clone' + + - if manage_access_points + tr + td + h4 = t(".access_managment") + ul.actions + li + = link_to t('access_points.actions.new'), new_referential_stop_area_access_point_path(@referential,@stop_area), class: 'add' + li + = link_to t('stop_areas.actions.manage_access_links'), access_links_referential_stop_area_path(@referential,@stop_area), class: 'access_link' + + br + + = creation_tag(@stop_area)
\ No newline at end of file diff --git a/app/views/referential_stop_areas/show.kml.erb b/app/views/referential_stop_areas/show.kml.erb deleted file mode 100644 index 39a764bd6..000000000 --- a/app/views/referential_stop_areas/show.kml.erb +++ /dev/null @@ -1,28 +0,0 @@ -<?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.stop_area_type %></stop_area_type> - <%= (@stop_area.position or @stop_area.default_position).kml_representation.html_safe %> - </Placemark> - <% end %> - </Document> -</kml> diff --git a/app/views/referential_stop_areas/show.kml.slim b/app/views/referential_stop_areas/show.kml.slim new file mode 100644 index 000000000..4327436ed --- /dev/null +++ b/app/views/referential_stop_areas/show.kml.slim @@ -0,0 +1,22 @@ +doctype XML + +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 + stop_area_type = child.stop_area_type + = (child.position or child.default_position).kml_representation.html_safe + + - elsif !params["routing"].nil? + - @stop_area.routing_stops.each do |child| + placemark id="#{child.id}" + name = child.name + stop_area_type = child.stop_area_type + = (child.position or child.default_position).kml_representation.html_safe + - else + placemark id="#{@stop_area.id}" + name = @stop_area.name + stop_area_type = @stop_area.stop_area_type + = (@stop_area.position or @stop_area.default_position).kml_representation.html_safe |
