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