]> git.openstreetmap.org Git - nominatim-ui.git/blob - src/pages/DeletablePage.svelte
0748b5cbe9522783d5a6ef62700f7122c58cd67a
[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           <th>Place id</th>
34           <th>Country Code</th>
35           <th>Name</th>
36           <th>OSM id</th>
37           <th>OSM type</th>
38           <th>Class</th>
39           <th>Type</th>
40         </thead>
41         <tbody>
42           {#each aPolygons as polygon}
43           <tr>
44             <td><DetailsLink feature={polygon}>{polygon.place_id}</DetailsLink></td>
45             <td>{polygon.country_code}</td>
46             <td>{polygon.name}</td>
47             <!-- eslint-disable-next-line svelte/no-at-html-tags -->
48             <td>{@html osmLink(polygon)}</td>
49             <td>{polygon.osm_type}</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