X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/d429667c4eb8ef7968a96612b3615ccf0bb1fccc..3e7d875df78b94d17251d811f891761dc8b67735:/src/components/SearchSection.svelte

diff --git a/src/components/SearchSection.svelte b/src/components/SearchSection.svelte
index 0246605..c789804 100644
--- a/src/components/SearchSection.svelte
+++ b/src/components/SearchSection.svelte
@@ -96,16 +96,15 @@
              placeholder="Search"
              value="{api_request_params.q || ''}" />
 
-      <div class="form-group search-button-group">
-        <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
-        <input type="hidden" name="viewbox" value="{sViewBox || ''}" />
-        <input type="hidden" name="dedupe" value="{!api_request_params.dedupe ? '' : 1}" />
-        <input type="hidden" name="bounded" value="{api_request_params.bounded ? 1 : ''}" />
-        <input type="hidden" name="accept-language" value="{api_request_params['accept-language'] || ''}" />
-        <input type="hidden" name="countrycodes" value="{api_request_params.countrycodes || ''}" />
-        <input type="hidden" name="limit" value="{api_request_params.limit || ''}" />
-        <input type="hidden" name="polygon_threshold" value="{api_request_params.polygon_threshold || ''}" />
-      </div>
+      <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
+      <input type="hidden" name="viewbox" value="{sViewBox || ''}" />
+      <input type="hidden" name="dedupe" value="{!api_request_params.dedupe ? '' : 1}" />
+      <input type="hidden" name="bounded" value="{api_request_params.bounded ? 1 : ''}" />
+      <input type="hidden" name="accept-language" value="{api_request_params['accept-language'] || ''}" />
+      <input type="hidden" name="countrycodes" value="{api_request_params.countrycodes || ''}"
+                                                    pattern="^[a-zA-Z]{'{2}'}(,[a-zA-Z]{'{2}'})*$" />
+      <input type="hidden" name="limit" value="{api_request_params.limit || ''}" />
+      <input type="hidden" name="polygon_threshold" value="{api_request_params.polygon_threshold || ''}" />
     </UrlSubmitForm>
   </div>
   <div class="tab-pane" class:active={bStructuredSearch} id="structured" role="tabpanel">
@@ -129,16 +128,15 @@
              placeholder="Postal Code"
              value="{api_request_params.postalcode || ''}" />
 
-      <div class="form-group search-button-group">
-        <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
-        <input type="hidden" name="viewbox" value="{sViewBox || ''}" />
-        <input type="hidden" name="dedupe" value="{!api_request_params.dedupe ? '' : 1}" />
-        <input type="hidden" name="bounded" value="{api_request_params.bounded ? 1 : ''}" />
-        <input type="hidden" name="accept-language" value="{api_request_params['accept-language'] || ''}" />
-        <input type="hidden" name="countrycodes" value="{api_request_params.countrycodes || ''}" />
-        <input type="hidden" name="limit" value="{api_request_params.limit || ''}" />
-        <input type="hidden" name="polygon_threshold" value="{api_request_params.polygon_threshold || ''}" />
-      </div>
+      <button type="submit" class="btn btn-primary btn-sm">Search</button>
+      <input type="hidden" name="viewbox" value="{sViewBox || ''}" />
+      <input type="hidden" name="dedupe" value="{!api_request_params.dedupe ? '' : 1}" />
+      <input type="hidden" name="bounded" value="{api_request_params.bounded ? 1 : ''}" />
+      <input type="hidden" name="accept-language" value="{api_request_params['accept-language'] || ''}" />
+      <input type="hidden" name="countrycodes" value="{api_request_params.countrycodes || ''}"
+                                              pattern="^[a-zA-Z]{'{2}'}(,[a-zA-Z]{'{2}'})*$" />
+      <input type="hidden" name="limit" value="{api_request_params.limit || ''}" />
+      <input type="hidden" name="polygon_threshold" value="{api_request_params.polygon_threshold || ''}" />
     </UrlSubmitForm>
   </div>
 </div> <!-- /tab-content -->
@@ -174,7 +172,7 @@
     <li>
       <label for="option_limit">Maximum number of results</label>
       <input type="number" class="form-control form-control-sm d-inline w-auto api-param-setting"
-             data-api-param="limit" id="option_limit" size="5" min="1" max="50"
+             data-api-param="limit" id="option_limit" min="1" max="50"
              value="{api_request_params.limit || ''}"
              on:change={set_api_param}>
     </li>
@@ -182,7 +180,7 @@
     <li>
       <label for="option_polygon_threshold">Polygon simplification</label>
       <input type="number" class="form-control form-control-sm d-inline w-auto api-param-setting"
-             data-api-param="polygon_threshold" id="option_polygon_threshold" size="5" min="0.0" step="0.01"
+             data-api-param="polygon_threshold" id="option_polygon_threshold" min="0.0"  max="1.0" step="0.001"
              value="{api_request_params.polygon_threshold || ''}"
              on:change={set_api_param}>
     </li>
@@ -196,10 +194,11 @@
     </li>
 
     <li>
-      <label for="option_ccode">Countries</label>
+      <label for="option_ccode">Country Codes</label>
       <input type="text" placeholder="e.g. de,gb" class="form-control form-control-sm d-inline w-auto api-param-setting"
              data-api-param="countrycodes" id="option_ccode" size="15"
              value="{api_request_params.countrycodes || ''}"
+             pattern="^[a-zA-Z]{'{2}'}(,[a-zA-Z]{'{2}'})*$"
              on:change={set_api_param}>
     </li>
   </ul>
@@ -214,23 +213,10 @@
   .nav-link {
     padding: 0.1rem 1rem;
   }
-  .tab-content {
-    display: flex;
-    align-items: baseline
-  }
 
   #q {
-    min-width: 500px;
-  }
-  @media (max-width: 850px) {
-    #q {
-      min-width: 400px;
-    }
-  }
-  @media (max-width: 768px) {
-    .search-button-group {
-      display: inline;
-    }
+    width: 500px;
+    max-width: 100%;
   }
 
   #searchAdvancedOptions ul {
