]> 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
28         are still in the Nominatim database.
29       </p>
30
31       <table class="table table-striped table-hover">
32         <thead>
33           <tr>
34             <th>Place id</th>
35             <th>Country Code</th>
36             <th>Name</th>
37             <th>OSM object</th>
38             <th>Class</th>
39             <th>Type</th>
40           </tr>
41         </thead>
42         <tbody>
43           {#each aPolygons as polygon}
44           <tr>
45             <td><DetailsLink feature={polygon}>{polygon.place_id}</DetailsLink></td>
46             <td>{polygon.country_code}</td>
47             <td>{polygon.name}</td>
48             <!-- eslint-disable-next-line svelte/no-at-html-tags -->
49             <td>{@html osmLink(polygon)}</td>
50             <td>{polygon.class}</td>
51             <td>{polygon.type}</td>
52           </tr>
53           {/each}
54         </tbody>
55       </table>
56
57     </div>
58   </div>
59 </div>
60