From ccc2208b2b7d09a9b1671846bc76a060649e64a4 Mon Sep 17 00:00:00 2001 From: Brian Medley Date: Sun, 22 Apr 2012 10:48:40 -0500 Subject: [PATCH] support coordinates in gui, #15655 --- httemplate/browse/tower.html | 16 +++++++++++++++- httemplate/edit/tower.html | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) 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 . "
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> -- 2.11.0