]> git.openstreetmap.org Git - rails.git/blob - app/views/layouts/_search.html.erb
Merge remote-tracking branch 'upstream/pull/4846'
[rails.git] / app / views / layouts / _search.html.erb
1 <div class="search_forms">
2   <form method="GET" action="<%= search_path %>" class="search_form bg-body-secondary px-1 py-2">
3     <div class="row gx-2 mx-0">
4       <div class="col">
5         <div class="input-group flex-nowrap">
6           <%= text_field_tag "query", params[:query], :placeholder => t("site.search.search"), :autofocus => autofocus, :autocomplete => "on", :class => "form-control form-control-sm z-0", :dir => "auto" %>
7           <div class="input-group-text border-start-0 p-0 position-relative">
8             <%= button_tag t("site.search.where_am_i"), :type => "button", :class => "describe_location position-absolute end-0 me-1 btn btn-sm btn-outline-primary border-0 bg-transparent text-primary link-body-emphasis link-opacity-100-hover", :title => t("site.search.where_am_i_title") %>
9           </div>
10           <%= submit_tag t("site.search.submit_text"), :class => "btn btn-sm btn-primary", :data => { :disable_with => false } %>
11         </div>
12       </div>
13       <div class="col-auto">
14         <%= link_to directions_path, :class => "btn btn-sm btn-primary px-1 switch_link", :title => t("site.search.get_directions_title") do %>
15           <svg width="28" height="20" class="align-bottom">
16             <path d="M11.5 9.5 v-3h3v-1l-5 -5l-5 5v1h3v6" fill="none" stroke="#fff8" />
17             <path d="M7.5 19.5h4v-5a1 1 0 0 1 1 -1h5v3h1l5 -5l-5 -5h-1v3h-6a4 4 0 0 0 -4 4z" fill="#fff8" stroke="#fff" />
18           </svg>
19         <% end %>
20       </div>
21     </div>
22   </form>
23
24   <form method="GET" action="<%= directions_path %>" class="directions_form bg-body-secondary pb-3">
25     <div class="d-flex flex-row-reverse px-3 py-3"><button type="button" class="btn-close" aria-label="<%= t("javascripts.close") %>"></button></div>
26
27     <div class="row gx-2 m-1">
28       <div class="col-1">
29         <%= image_tag "marker-green.png", :class => "routing_marker mx-auto d-block", :data => { :type => "from" }, :draggable => "true" %>
30       </div>
31       <div class="col">
32         <%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
33       </div>
34     </div>
35     <div class="row gx-2 m-1">
36       <div class="col-1">
37         <%= image_tag "marker-red.png", :class => "routing_marker mx-auto d-block", :data => { :type => "to" }, :draggable => "true" %>
38       </div>
39       <div class="col">
40         <%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %>
41       </div>
42     </div>
43     <div class="row gx-2 m-1">
44       <div class="col offset-1">
45         <select class="routing_engines form-select form-select-sm" name="routing_engines"></select>
46       </div>
47       <div class="col-auto">
48         <%= submit_tag t("site.search.submit_text"), :class => "routing_go btn btn-sm btn-primary", :data => { :disable_with => false } %>
49       </div>
50     </div>
51     <div class="row gx-2 m-1">
52       <div class="col offset-1">
53         <button class="btn btn-sm btn-link reverse_directions"><%= t("site.search.reverse_directions_text") %></button>
54       </div>
55     </div>
56
57     <div class="loader_copy d-none">
58       <div class="text-center loader">
59         <div class="spinner-border" role="status">
60           <span class="visually-hidden"><%= t("browse.start_rjs.loading") %></span>
61         </div>
62       </div>
63     </div>
64   </form>
65 </div>