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