summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Medley <bpm@snafu.org>2012-04-22 10:48:40 -0500
committerBrian Medley <bpm@snafu.org>2012-04-22 10:48:40 -0500
commitccc2208b2b7d09a9b1671846bc76a060649e64a4 (patch)
treec90b3efe732136247aafb0ba758a67b3eb527ade
parent7dd79523c75c3cd238fb1c0cb7ccb346a6569811 (diff)
support coordinates in gui, #15655
-rw-r--r--httemplate/browse/tower.html16
-rw-r--r--httemplate/edit/tower.html4
2 files changed, 19 insertions, 1 deletions
diff --git a/httemplate/browse/tower.html b/httemplate/browse/tower.html
index 7767a3c36..7f096a748 100644
--- a/httemplate/browse/tower.html
+++ b/httemplate/browse/tower.html
@@ -8,9 +8,10 @@
'count_query' => 'SELECT COUNT(*) FROM tower',
'disableable' => 1,
'disabled_statuspos' => 1,
- 'header' => [ 'Name', 'Sectors', ],
+ 'header' => [ 'Name', 'Sectors', 'Coordinates'],
'fields' => [ $tower_sub,
$sector_sub,
+ $coord_sub,
],
'links' => [ ],
)
@@ -49,6 +50,19 @@ my $num_svc_links = sub {
},
};
+my $coord_sub = sub {
+ my $tower = shift;
+
+ my $coords = $m->scomp("/elements/coord-links.html", $tower->latitude, $tower->longitude, $tower->towername);
+
+ [
+ [
+ { 'data' => "Latitude: " . $tower->latitude . "<br>Longitude: " . $tower->longitude, },
+ { 'data' => $coords, 'link' => "Coordinates", },
+ ],
+ ]
+};
+
my $tower_sub = sub {
my $tower = shift;
my $sectors = join(',',
diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html
index 5a0f2a8ce..82513082c 100644
--- a/httemplate/edit/tower.html
+++ b/httemplate/edit/tower.html
@@ -12,12 +12,16 @@
m2_label => 'Sector',
m2_error_callback => $m2_error_callback,
},
+ 'latitude',
+ 'longitude',
],
labels => { 'towernum' => 'Tower',
'towername' => 'Name',
'sectornum' => 'Sector',
'disabled' => 'Disabled',
'default_ip_addr' => 'Tower IP address',
+ 'latitude', => 'Latitude',
+ 'longitude', => 'Longitude',
},
&>
<%init>