]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/templates/searchpage.hbs
4e675be3a0239a7228b47faff64cb12d73cd9055
[nominatim-ui.git] / src / templates / searchpage.hbs
1 {{#*inline "partial_one_result"}}
2   <div class="result" data-position="{{iResNum}}">
3     {{formatMapIcon aResult}}
4
5     <span class="name">{{aResult.display_name}}</span>
6     <span class="type">({{formatLabel aResult}})</span>
7     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
8
9     <a class="details btn btn-outline-secondary btn-sm" href="{{detailsURL aResult}}">details</a>
10   </div>
11 {{/inline}}
12
13 <div class="top-bar">
14   <ul class="nav nav-tabs">
15     <li class="nav-item">
16       <a class="nav-link {{#unless hStructured}}active{{/unless}}" data-toggle="tab" href="#simple">simple</a>
17     </li>
18     <li class="nav-item">
19       <a class="nav-link {{#if hStructured}}active{{/if}}" data-toggle="tab" href="#structured">structured</a>
20     </li>
21     <div class="search-type-link">
22       <a id="switch-to-reverse" href="/reverse.html">reverse search</a>
23     </div>
24   </ul>
25   <div class="tab-content p-2">
26     <div class="tab-pane {{#unless hStructured}}active{{/unless}}" id="simple" role="tabpanel">
27       <form class="form-inline" role="search" accept-charset="UTF-8" action="">
28         <input id="q"
29                name="q"
30                type="text"
31                class="form-control form-control-sm"
32                placeholder="Search"
33                value="{{sQuery}}" />
34
35         <div class="form-group search-button-group">
36           <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
37           <input type="hidden" name="viewbox" value="{{sViewBox}}" />
38           <div class="form-check form-check-inline">
39             <input type="checkbox" class="form-check-input"
40                    id="use_viewbox" {{#if sViewBox}}checked="checked"{{/if}}>
41             <label class="form-check-label" for="use_viewbox">apply viewbox</label>
42           </div>
43         </div>
44       </form>
45     </div>
46     <div class="tab-pane {{#if hStructured}}active{{/if}}" id="structured" role="tabpanel">
47       <form class="form-inline" role="search" accept-charset="UTF-8" action="">
48         <input name="street" type="text" class="form-control form-control-sm mr-1"
49                placeholder="House number/Street"
50                value="{{hStructured.street}}" />
51         <input name="city" type="text" class="form-control form-control-sm mr-1"
52                placeholder="City"
53                value="{{hStructured.city}}" />
54         <input id="county" name="county" type="text" class="form-control form-control-sm mr-1"
55                placeholder="County"
56                value="{{hStructured.county}}" />
57         <input name="state" type="text" class="form-control form-control-sm mr-1"
58                placeholder="State"
59                value="{{hStructured.state}}" />
60         <input name="country" type="text" class="form-control form-control-sm mr-1"
61                placeholder="Country"
62                value="{{hStructured.country}}" />
63         <input name="postalcode" type="text" class="form-control form-control-sm mr-1"
64                placeholder="Postal Code"
65                value="{{hStructured.postalcode}}" />
66
67         <div class="form-group search-button-group">
68           <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
69           <input type="hidden" name="viewbox" value="{{sViewBox}}" />
70           <div class="form-check form-check-inline">
71             <input type="checkbox" class="form-check-input"
72                    id="use_viewbox" {{#if sViewBox}}checked="checked"{{/if}}>
73             <label class="form-check-label" for="use_viewbox">apply viewbox</label>
74           </div>
75         </div>
76       </form>
77     </div>
78   </div> <!-- /tab-content -->
79 </div> <!-- /top-bar -->
80
81 <div id="content">
82
83   {{#if bSearchRan}}
84     <div id="searchresults" class="sidebar">
85       {{#each aSearchResults as |aResult|}}
86         {{>partial_one_result iResNum=@index aResult=aResult env=env}}
87       {{/each}}
88
89       {{#if aSearchResults}}
90         {{#if sMoreURL}}
91           <div class="more">
92             <a class="btn btn-primary" href="{{sMoreURL}}">
93               Search for more results
94             </a>
95           </div>
96         {{/if}}
97       {{else}}
98         <div class="noresults">No search results found</div>
99       {{/if}}
100     </div>
101
102   {{else}}
103
104     <div id="intro" class="sidebar">
105       <h2>Welcome to Nominatim</h2>
106
107       <p>
108         Nominatim is a search engine for
109         <a href="https://www.openstreetmap.org">OpenStreetMap</a> data. This
110         is the debugging interface. You may search for a name or address
111         (forward search) or look up data by its geographic coordinate (reverse
112         search). Each result comes with a link to a details page where you
113         can inspect what data about the object is saved in the database and
114         investigate how the address of the object has been computed.
115       </p>
116
117       For more information visit the
118       <a href="https://nominatim.org">Nominatim home page</a>.
119     </div>
120
121   {{/if}}
122
123   <div id="map-wrapper">
124     <div id="map-position">
125       <div id="map-position-inner"></div>
126       <div id="map-position-close"><a href="#">hide</a></div>
127     </div>
128     <div id="map"></div>
129   </div>
130 </div>