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