aboutsummaryrefslogtreecommitdiffstats
path: root/root/html/includes/host_information.tt
blob: 2c9b5748f099f93d39f2bccde91158b1471c9fc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!-- $Id$ -->
<div style="float: left">
<form action="[% action || c.uri_for() %]" method="POST">
<input type="hidden" name="hostinfo" value="1">
<table border=0>
<tr><th>Country</th>
<td>
<select name="country">
<option value=""></option>
[% FOREACH country = c.model('Mirrors').country_list %]
<option value="[% country.code %]" [% "selected=select" IF country.code == host.country %]>[% country.name | html %]</option>
[% END %]
</select>
</td>
</tr>

<tr><th>City</th>
<td>
<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 %]
<tr><th>Synchronized from</th>
<td>
<select name="syncfrom">
<option value="">Unknown</option>
[% END %]
[% IF mirror.public %]
<option value="[% mirror.hostname | html %]" [% "selected=select" IF host.syncfrom == mirror.hostname %]>[% mirror.hostname | html %]</option>
[% END %]
[% IF loop.last %]
</select>
</td>
</tr>
[% END %]
[% END %]
<tr><th>Approximated bandwidth</th>
<td>
<select name="bandwidth">
<option value=""></option>
[% FOREACH bd = c.model('Mirrors').bandwidth_list %]
<option value="[% bd.value %]" [% "selected=select" IF host.bandwidth == bd.value %]>[% bd.name | html %]</option>
[% END %]
</select>
</td>
</tr>
</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>