]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/pages/DeletablePage.svelte
1d6b91eb8f6dd92f05fc5af8483214a5167cbcf9
[nominatim-ui.git] / src / pages / DeletablePage.svelte
1 <script>
2   import { onMount } from 'svelte';
3   import { fetch_from_api, update_html_title } from '../lib/api_utils.js';
4   import { osmLink } from '../lib/helpers.js';
5
6   import DetailsLink from '../components/DetailsLink.svelte';
7
8   let aPolygons = [];
9
10   function loaddata() {
11     fetch_from_api('deletable', { format: 'json' }, function (data) {
12       aPolygons = data;
13     });
14     update_html_title('Deletable objects');
15   }
16   onMount(loaddata);
17 </script>
18
19 <div class="container">
20   <div class="row">
21     <div class="col-sm-12">
22       <h1>Deletable</h1>
23
24       <p>
25           {aPolygons.length} objects have been deleted in OSM but are still in the Nominatim database.
26       </p>
27
28       <table class="table table-striped table-hover">
29         <thead>
30           <th>Place id</th>
31           <th>Country Code</th>
32           <th>Name</th>
33           <th>OSM id</th>
34           <th>OSM type</th>
35           <th>Class</th>
36           <th>Type</th>
37         </thead>
38         <tbody>
39           {#each aPolygons as polygon}
40           <tr>
41             <td><DetailsLink feature={polygon}>{polygon.place_id}</DetailsLink></td>
42             <td>{polygon.country_code}</td>
43             <td>{polygon.name}</td>
44             <td>{@html osmLink(polygon)}</td>
45             <td>{polygon.osm_type}</td>
46             <td>{polygon.class}</td>
47             <td>{polygon.type}</td>
48           </tr>
49           {/each}
50         </tbody>
51       </table>
52
53     </div>
54   </div>
55 </div>
56