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