aboutsummaryrefslogtreecommitdiffstats
path: root/root/html/includes/host_information.tt
diff options
context:
space:
mode:
Diffstat (limited to 'root/html/includes/host_information.tt')
-rw-r--r--root/html/includes/host_information.tt59
1 files changed, 43 insertions, 16 deletions
diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt
index 9093f98..b7b02f3 100644
--- a/root/html/includes/host_information.tt
+++ b/root/html/includes/host_information.tt
@@ -1,13 +1,17 @@
<!-- $Id$ -->
<div style="float: left">
-[% IF NOT host.readonly %]
+[% IF c.req.param('modify') AND NOT host.readonly %]
+ [% edit = 1 %]
+[% END %]
+
+[% IF edit %]
<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 %]
+[% IF NOT edit %]
[% c.model('Mirrors').country_info(host.country).name | html %]
[% ELSE %]
<select name="country">
@@ -22,38 +26,38 @@
<tr><th>City</th>
<td>
-[% IF host.readonly %]
-[% host.city | html %]
-[% ELSE %]
+[% IF edit %]
<input type="text" name="city" value="[% host.city | html %]">
+[% ELSE %]
+[% host.city | html %]
[% END %]
</td>
</tr>
<tr><th>Latitude</th>
<td>
-[% IF host.readonly %]
-[% host.latitude | html %]
-[% ELSE %]
+[% IF edit %]
<input type="text" id="latitude" name="latitude" value="[% host.latitude | html %]">
+[% ELSE %]
+[% host.latitude | html %]
[% END %]
</td>
</tr>
<tr><th>Longitude</th>
<td>
-[% IF host.readonly %]
-[% host.longitude | html %]
-[% ELSE %]
+[% IF edit %]
<input type="text" id="longitude" name="longitude" value="[% host.longitude | html %]">
+[% ELSE %]
+[% host.longitude | html %]
[% END %]
</td>
</tr>
-[% IF NOT host.readonly %]
+[% IF edit %]
<tr><td colspan=2>Click on the map to update latitude and longitude</td></tr>
[% END %]
<tr><th>Synchronized from</th>
<td>
-[% IF host.readonly %]
+[% IF NOT edit %]
[% host.syncfrom | html %]
[% ELSE %]
[% FOREACH mirror = c.model('Mirrors').find_mirrors %]
@@ -74,7 +78,7 @@
<tr><th>Approximated bandwidth</th>
<td>
-[% IF host.readonly %]
+[% IF NOT edit %]
[% c.model('Mirrors').bandwidth_name(host.bandwidth) | html %]
[% ELSE %]
<select name="bandwidth">
@@ -86,11 +90,27 @@
[% END %]
</td>
</tr>
+[% IF edit AND needmail %]
+<tr>
+<td colspan=2>
+Please enter your e-mail address:<br>
+<input type="text" name="mail"><br>
+a mail will be be sent with the link to confirm<br>
+your update request.<br>
+</td>
+</tr>
+[% END %]
</table>
-[% IF NOT host.readonly %]
+[% IF edit %]
<input type="submit">
<input type="reset">
</form>
+[% ELSE %]
+[% IF NOT host.readonly %]
+<form action="[% action || c.uri_for() %]" method="POST">
+<input type="submit" name="modify" value="update information">
+</form>
+[% END %]
[% END %]
</div>
@@ -111,7 +131,7 @@
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
-[% IF NOT host.readonly %]
+[% IF edit %]
google.maps.event.addListener(map, 'click', function(event) {
recordposition(event.latLng);
});
@@ -120,6 +140,13 @@
document.getElementById("latitude").value = location.lat();
document.getElementById("longitude").value = location.lng();
}
+[% ELSE %]
+ var myLatlng = new google.maps.LatLng([% host.latitude %],[% host.longitude %]);
+ var marker = new google.maps.Marker({
+ position: myLatlng,
+ map: map,
+ title:"[% host.hostname %]"
+ });
[% END %]
}