]> git.openstreetmap.org Git - rails.git/blob - app/views/directions/show.html.erb
Merge remote-tracking branch 'upstream/pull/6189'
[rails.git] / app / views / directions / show.html.erb
1 <% content_for(:content_class) { "overlay-sidebar" } %>
2
3 <svg class="d-none">
4   <% Rails.root.glob("app/assets/images/routing/*.svg")
5           .map { |path| File.basename(path, ".svg") }
6           .each do |icon| %>
7     <%= inline_svg_tag "routing/#{icon}.svg", :id => "routing-sprite-#{icon}", :to_symbol => true %>
8     <% if icon.end_with?("right") %>
9       <symbol id="routing-sprite-<%= icon.sub("right", "left") %>">
10         <use href="#routing-sprite-<%= icon %>" transform="matrix(-1 0 0 1 20 0)" />
11       </symbol>
12     <% end
13   end %>
14 </svg>
15
16 <%= render "sidebar_header", :title => t(".title") %>
17
18 <div id="directions_loader" hidden>
19   <div class="text-center loader">
20     <div class="spinner-border" role="status">
21       <span class="visually-hidden"><%= t("browse.start_rjs.loading") %></span>
22     </div>
23   </div>
24 </div>
25
26 <div id="directions_error" hidden></div>
27
28 <div id="directions_route" hidden>
29   <div id="directions_distance_units_settings" class="collapse">
30     <div class="btn-group btn-group-sm w-100">
31       <input type="radio" class="btn-check" name="directions_distance_units" value="km_m" id="directions_distance_units_km_m" autocomplete="off" checked>
32       <label class="btn btn-outline-secondary p-0 px-1" for="directions_distance_units_km_m"><%= t ".kilometers" %></label>
33
34       <input type="radio" class="btn-check" name="directions_distance_units" value="mi_ft" id="directions_distance_units_mi_ft" autocomplete="off">
35       <label class="btn btn-outline-secondary p-0 px-1" for="directions_distance_units_mi_ft"><%= t ".miles_feet" %></label>
36
37       <input type="radio" class="btn-check" name="directions_distance_units" value="mi_yd" id="directions_distance_units_mi_yd" autocomplete="off">
38       <label class="btn btn-outline-secondary p-0 px-1" for="directions_distance_units_mi_yd"><%= t ".miles_yards" %></label>
39     </div>
40   </div>
41
42   <div class="mx-n3">
43     <table class='table table-hover table-sm mb-3'>
44       <thead>
45         <td colspan="2" class="ps-3">
46           <span>
47             <%= t ".distance" %>: <output id="directions_route_distance"></output>.
48             <%= t ".time" %>: <output id="directions_route_time"></output>.
49           </span>
50           <br>
51           <span id="directions_route_ascend_descend">
52             <%= t ".ascend" %>: <output id="directions_route_ascend"></output>.
53             <%= t ".descend" %>: <output id="directions_route_descend"></output>.
54           </span>
55         </td>
56         <td class="pe-3 text-end">
57           <button type="button" class="btn btn-outline-secondary p-1 border-0 me-n1" data-bs-toggle="collapse" data-bs-target="#directions_distance_units_settings">
58             <svg width="16" height="16" fill="currentColor" class="d-block">
59               <title><%= t ".distance_units_settings" %></title>
60               <path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0" />
61               <path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z" />
62             </svg>
63           </button>
64         </td>
65       </thead>
66       <tbody id="directions_route_steps"></tbody>
67     </table>
68   </div>
69
70   <p class="text-center">
71     <%= tag.a t(".download"), :id => "directions_route_download", :download => t(".filename") %>
72   </p>
73
74   <p class="text-center">
75     <%= t ".directions_courtesy_html", :link => tag.a("", :id => "directions_route_credit", :target => "_blank") %>
76   </p>
77 </div>