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