Mercurial > hg > GlobalNeighbors
annotate globalneighbors/templates/index.html @ 22:e69cb496324e
we have a data dump
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 25 Jun 2017 17:45:19 -0700 |
parents | 2fef925fbf37 |
children |
rev | line source |
---|---|
6 | 1 <!DOCTYPE html> |
2 <html> | |
3 <head> | |
4 <title>Global Neighbors</title> | |
7
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
5 <script src="https://code.jquery.com/jquery-1.12.4.js"></script> |
12
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
6 <script src="/js/jquery.easy-autocomplete.min.js"></script> |
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
7 <link rel="stylesheet" type="text/css" href="/css/style.css"/> |
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
8 <link rel="stylesheet" type="text/css" href="/css/easy-autocomplete.css"/> |
7
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
9 <script> |
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
10 $( function() { |
12
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
11 var options = { |
13 | 12 url: function(phrase) { |
13 return "/cities?term=" + phrase; | |
14 }, | |
15 getValue: "name", | |
12
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
16 list: { |
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
17 match: { |
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
18 enabled: true |
13 | 19 } |
20 }, | |
21 template: { | |
22 type: "custom", | |
23 method: function (value, item) { | |
20
2fef925fbf37
display country + population in autocomplete drop down
Jeff Hammel <k0scist@gmail.com>
parents:
13
diff
changeset
|
24 return '<a href="/' + item.geonameid + '"><b>' + value + '</b> ' + item["country code"] + '<br/><small>Population: ' + item.population + '</small></a>'; |
13 | 25 } |
26 } | |
12
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
27 }; |
6d89ea94930b
add passthrough fileserver for autocomplete
Jeff Hammel <k0scist@gmail.com>
parents:
11
diff
changeset
|
28 $( "#cities" ).easyAutocomplete(options); |
7
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
29 }); |
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
30 </script> |
6 | 31 </head> |
32 <body> | |
33 <h1>Global Neighbors</h1> | |
34 <h2>Serving {{ n_cities }} cities</h2> | |
7
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
35 |
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
36 <div class="ui-widget"> |
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
37 <label for="cities">Enter a city: </label> |
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
38 <input id="cities"/> |
13 | 39 <select> |
40 <option value="">ALL</option> | |
41 {% for country_code in country_codes %} | |
42 <option value="{{ country_code }}">{{ country_code }}</option> | |
43 {% endfor %} | |
44 </select> | |
7
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
45 </div> |
254195d0bac2
partial implementation of autocomplete using jqueryui; easyautocomplete.com may be more what we want
Jeff Hammel <k0scist@gmail.com>
parents:
6
diff
changeset
|
46 |
6 | 47 </body> |
48 </html> |