aboutsummaryrefslogtreecommitdiffstats
path: root/root
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mageia.org>2010-10-03 16:33:12 +0000
committerOlivier Thauvin <nanardon@mageia.org>2010-10-03 16:33:12 +0000
commit5f978cf71067a1783caf01e64be05160b9b1e6d2 (patch)
tree2e1fb1f83220350ab4babe992f3d9e92423794a9 /root
parentddcf19029c7b58b2ea236bd14e6c1456949f0fc0 (diff)
downloadmgamirrors-5f978cf71067a1783caf01e64be05160b9b1e6d2.tar
mgamirrors-5f978cf71067a1783caf01e64be05160b9b1e6d2.tar.gz
mgamirrors-5f978cf71067a1783caf01e64be05160b9b1e6d2.tar.bz2
mgamirrors-5f978cf71067a1783caf01e64be05160b9b1e6d2.tar.xz
mgamirrors-5f978cf71067a1783caf01e64be05160b9b1e6d2.zip
- deny readonly host modification
Diffstat (limited to 'root')
-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>