aboutsummaryrefslogtreecommitdiffstats
path: root/root/html/includes/host_information.tt
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mageia.org>2010-10-03 15:36:00 +0000
committerOlivier Thauvin <nanardon@mageia.org>2010-10-03 15:36:00 +0000
commitddcf19029c7b58b2ea236bd14e6c1456949f0fc0 (patch)
tree725f066cac991b43163f1e08a5954b6071634f3d /root/html/includes/host_information.tt
parent114b46067622cc0c68d007711cf58f74e25411b8 (diff)
downloadmgamirrors-ddcf19029c7b58b2ea236bd14e6c1456949f0fc0.tar
mgamirrors-ddcf19029c7b58b2ea236bd14e6c1456949f0fc0.tar.gz
mgamirrors-ddcf19029c7b58b2ea236bd14e6c1456949f0fc0.tar.bz2
mgamirrors-ddcf19029c7b58b2ea236bd14e6c1456949f0fc0.tar.xz
mgamirrors-ddcf19029c7b58b2ea236bd14e6c1456949f0fc0.zip
- use google maps for location, improve messages
Diffstat (limited to 'root/html/includes/host_information.tt')
-rw-r--r--root/html/includes/host_information.tt48
1 files changed, 48 insertions, 0 deletions
diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt
index c0cb7cb..2c9b574 100644
--- a/root/html/includes/host_information.tt
+++ b/root/html/includes/host_information.tt
@@ -1,4 +1,5 @@
<!-- $Id$ -->
+<div style="float: left">
<form action="[% action || c.uri_for() %]" method="POST">
<input type="hidden" name="hostinfo" value="1">
<table border=0>
@@ -18,6 +19,16 @@
<input type="text" name="city" value="[% host.city | html %]">
</td>
</tr>
+<tr><th>Latitude</th>
+<td>
+<input type="text" id="latitude" name="latitude" value="[% host.latitude | html %]">
+</td>
+</tr>
+<tr><th>Longitude</th>
+<td>
+<input type="text" id="longitude" name="longitude" value="[% host.longitude | html %]">
+</td>
+</tr>
[% FOREACH mirror = c.model('Mirrors').find_mirrors %]
[% IF loop.first %]
@@ -48,3 +59,40 @@
</table>
<input type="submit">
</form>
+</div>
+
+<script type="text/javascript"
+ src="http://maps.google.com/maps/api/js?sensor=false">
+</script>
+<script type="text/javascript">
+ function initialize() {
+ var latlng = new google.maps.LatLng(
+ [% host.latitude || 0 %],
+ [% host.longitude || 0 %]
+ );
+ var myOptions = {
+ zoom: 4,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ var map = new google.maps.Map(document.getElementById("map_canvas"),
+ myOptions);
+
+ google.maps.event.addListener(map, 'click', function(event) {
+ recordposition(event.latLng);
+ });
+
+ function recordposition(location) {
+ document.getElementById("latitude").value = location.lat();
+ document.getElementById("longitude").value = location.lng();
+ }
+ }
+
+</script>
+
+<div id="map_canvas" style="float: left; width:40%; height:300px"></div>
+<div style="clear: both"></div>
+
+<script type="text/javascript">
+ initialize();
+</script>