annotate globalneighbors/templates/city.html @ 23:6891c5523b69

load with neighbors :)
author Jeff Hammel <k0scist@gmail.com>
date Sun, 25 Jun 2017 18:13:43 -0700
parents 21095c9006e5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
1 <!DOCTYPE html>
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
2 <html>
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
3 <head>
15
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
4 <title>{{ city.name }}</title>
10
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
5 </head>
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
6 <body>
14
27925261c137 fix broken tests including an aggregious case where we add ourselves as a neighbor to ourself
Jeff Hammel <k0scist@gmail.com>
parents: 12
diff changeset
7 <a href="/"
27925261c137 fix broken tests including an aggregious case where we add ourselves as a neighbor to ourself
Jeff Hammel <k0scist@gmail.com>
parents: 12
diff changeset
8 title="back to Global Niehgbors">Home</a>
27925261c137 fix broken tests including an aggregious case where we add ourselves as a neighbor to ourself
Jeff Hammel <k0scist@gmail.com>
parents: 12
diff changeset
9
15
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
10 <h1>{{ city.name }}</h1>
12
6d89ea94930b add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents: 10
diff changeset
11
15
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
12 <!-- give a link to Google maps, for fun -->
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
13 <h2>
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
14 <a href="https://www.google.com/maps/?ll={{city.latitude}},{{city.longitude}}"
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
15 target="_blank"
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
16 title="location">{{city.latitude}},{{city.longitude}}
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
17 </a>
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
18 </h2>
14
27925261c137 fix broken tests including an aggregious case where we add ourselves as a neighbor to ourself
Jeff Hammel <k0scist@gmail.com>
parents: 12
diff changeset
19
12
6d89ea94930b add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents: 10
diff changeset
20 <dl>
6d89ea94930b add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents: 10
diff changeset
21 <dt>Population:</dt>
15
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
22 <dd>{{ city.population }}</dd>
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
23
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
24 <dt>Country:</dt>
21095c9006e5 city page is now functional + linky
Jeff Hammel <k0scist@gmail.com>
parents: 14
diff changeset
25 <dd>{{ city['country code'] }}
12
6d89ea94930b add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents: 10
diff changeset
26 </dl>
23
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
27
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
28 {% if neighbors %}
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
29 <div>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
30 <p>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
31 {{ neighbors|length }} nearest neighbors:
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
32 </p>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
33 <table>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
34 <tr><th>Neighbor</th><th>Distance (km)</th></tr>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
35 {% for neighbor in neighbors %}
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
36 <tr>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
37 <td><a href="/{{ neighbor.geoid }}">{{ neighbor.name }}</a></td>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
38 <td>{{ neighbor.distance }}</td>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
39 </tr>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
40 {% endfor %}
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
41 </table>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
42 </div>
6891c5523b69 load with neighbors :)
Jeff Hammel <k0scist@gmail.com>
parents: 15
diff changeset
43 {% endif %}
10
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
44 </body>
21ed15391e8a add a placeholder view for a city based on geoid
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
45 </html>