support coordinates in gui, #15655
authorBrian Medley <bpm@snafu.org>
Sun, 22 Apr 2012 15:48:40 +0000 (10:48 -0500)
committerBrian Medley <bpm@snafu.org>
Sun, 22 Apr 2012 15:48:40 +0000 (10:48 -0500)
httemplate/browse/tower.html
httemplate/edit/tower.html

index 7767a3c..7f096a7 100644 (file)
@@ -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(',', 
index 5a0f2a8..8251308 100644 (file)
                           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>