aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--root/html/includes/host_information.tt45
1 files changed, 40 insertions, 5 deletions
diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt
index 2c9b574..9093f98 100644
--- a/root/html/includes/host_information.tt
+++ b/root/html/includes/host_information.tt
@@ -1,39 +1,63 @@
<!-- $Id$ -->
<div style="float: left">
+[% IF NOT host.readonly %]
<form action="[% action || c.uri_for() %]" method="POST">
<input type="hidden" name="hostinfo" value="1">
+[% END %]
<table border=0>
<tr><th>Country</th>
<td>
+[% IF host.readonly %]
+[% c.model('Mirrors').country_info(host.country).name | html %]
+[% ELSE %]
<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>
+[% END %]
</td>
</tr>
<tr><th>City</th>
<td>
+[% IF host.readonly %]
+[% host.city | html %]
+[% ELSE %]
<input type="text" name="city" value="[% host.city | html %]">
+[% END %]
</td>
</tr>
<tr><th>Latitude</th>
<td>
+[% IF host.readonly %]
+[% host.latitude | html %]
+[% ELSE %]
<input type="text" id="latitude" name="latitude" value="[% host.latitude | html %]">
+[% END %]
</td>
</tr>
<tr><th>Longitude</th>
<td>
+[% IF host.readonly %]
+[% host.longitude | html %]
+[% ELSE %]
<input type="text" id="longitude" name="longitude" value="[% host.longitude | html %]">
+[% END %]
</td>
</tr>
+[% IF NOT host.readonly %]
+<tr><td colspan=2>Click on the map to update latitude and longitude</td></tr>
+[% END %]
-[% FOREACH mirror = c.model('Mirrors').find_mirrors %]
-[% IF loop.first %]
<tr><th>Synchronized from</th>
<td>
+[% IF host.readonly %]
+[% host.syncfrom | html %]
+[% ELSE %]
+[% FOREACH mirror = c.model('Mirrors').find_mirrors %]
+[% IF loop.first %]
<select name="syncfrom">
<option value="">Unknown</option>
[% END %]
@@ -42,23 +66,32 @@
[% END %]
[% IF loop.last %]
</select>
-</td>
-</tr>
[% END %]
[% END %]
+[% END %]
+</td>
+</tr>
+
<tr><th>Approximated bandwidth</th>
<td>
+[% IF host.readonly %]
+[% c.model('Mirrors').bandwidth_name(host.bandwidth) | html %]
+[% ELSE %]
<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>
+[% END %]
</td>
</tr>
</table>
+[% IF NOT host.readonly %]
<input type="submit">
+<input type="reset">
</form>
+[% END %]
</div>
<script type="text/javascript"
@@ -77,7 +110,8 @@
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
-
+
+[% IF NOT host.readonly %]
google.maps.event.addListener(map, 'click', function(event) {
recordposition(event.latLng);
});
@@ -86,6 +120,7 @@
document.getElementById("latitude").value = location.lat();
document.getElementById("longitude").value = location.lng();
}
+[% END %]
}
</script>