X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Ftower.html;h=e2f9fd0bde6e25c2fe39d1f4501fe907bb27e3b8;hb=98f6d91ec7eaa907204afbfeb90ede1e3bff656d;hp=82eb872b18945c89faaaffa36c22afc7db05474c;hpb=8e4c66cfb8aaf0aee2d1142636e53d0e17d11d4f;p=freeside.git diff --git a/httemplate/browse/tower.html b/httemplate/browse/tower.html index 82eb872b1..e2f9fd0bd 100644 --- a/httemplate/browse/tower.html +++ b/httemplate/browse/tower.html @@ -8,11 +8,13 @@ 'count_query' => 'SELECT COUNT(*) FROM tower', 'disableable' => 1, 'disabled_statuspos' => 1, - 'header' => [ 'Name', 'Sectors', ], + 'header' => [ 'Name', 'Location', 'Sectors', ], 'fields' => [ $tower_sub, + $coord_sub, $sector_sub, ], 'links' => [ ], + 'cell_style' => [ $tagdesc_style ], ) %> <%init> @@ -20,6 +22,9 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +#false laziness w/ browse/part_tag.html +my $tagdesc_style = sub { 'background-color:#'.shift->color }; + my $num_svc_links = sub { my ($query_string, $sectors) = @_; return if !$sectors; @@ -49,12 +54,32 @@ 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. + "
Altitude: ". $tower->altitude. + "
Height: ". $tower->height. + "
Veg. height: ". $tower->veg_height, + }, + { 'data' => $coords, 'link' => "Coordinates", }, + ], + ] +}; + my $tower_sub = sub { my $tower = shift; - my $sectors = join(',', map { $_->sectornum } $tower->tower_sector); + my $sectors = join(',', + map { $_->sectornum } $tower->tower_sector, $tower->default_sector + ); [ #rows [ - { 'data' => $tower->towername, }, + { 'data' => $tower->towername. ' ', }, { 'data' => ' (edit) ', size => '-1', 'link' => $p.'edit/tower.html?' . $tower->towernum }, ], @@ -73,7 +98,7 @@ my $sector_sub = sub { my $sectornum = $sector->sectornum; [ { - 'data' => $sector->sectorname, + 'data' => $sector->sectorname. ' ', 'link' => ( $sector->ip_addr ? 'http://'. $sector->ip_addr : '' ), },