summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-10-10 23:54:05 -0700
committerMark Wells <mark@freeside.biz>2016-10-10 23:54:05 -0700
commit04f53daab621710db56b075e1aaf56e7c52f9ba9 (patch)
treef3bf508716c8c85c5382e3286e2e81ff6670247e /httemplate
parent49d9ea969069430ef3fe23e5b1ac3599e929bb04 (diff)
export tower/sector data to TowerCoverage API, #39776
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/process/tower.html3
-rw-r--r--httemplate/elements/tr-tower_sector.html24
-rw-r--r--httemplate/elements/tr-tower_sectors.html54
-rwxr-xr-xhttemplate/search/tower-map.html15
4 files changed, 67 insertions, 29 deletions
diff --git a/httemplate/edit/process/tower.html b/httemplate/edit/process/tower.html
index 588a68e8d..cfbb4ffa3 100644
--- a/httemplate/edit/process/tower.html
+++ b/httemplate/edit/process/tower.html
@@ -4,7 +4,8 @@
process_o2m => { 'table' => 'tower_sector',
'fields' => [qw(
sectorname ip_addr height freq_mhz direction width
- downtilt v_width db_high db_low
+ downtilt v_width db_high db_low power line_loss
+ antenna_gain hardware_typenum
sector_range
)],
},
diff --git a/httemplate/elements/tr-tower_sector.html b/httemplate/elements/tr-tower_sector.html
deleted file mode 100644
index 871c7fd9c..000000000
--- a/httemplate/elements/tr-tower_sector.html
+++ /dev/null
@@ -1,24 +0,0 @@
-% unless ( $opt{'js_only'} ) {
-
- <% include('tr-td-label.html', %opt) %>
- <TD <% $cell_style %>>
-
-% }
-%
- <% include( '/elements/sector.html', %opt ) %>
-%
-% unless ( $opt{'js_only'} ) {
-
- </TD>
- </TR>
-
-% }
-<%init>
-
-my( %opt ) = @_;
-
-my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
-
-$opt{'label'} ||= 'Sector';
-
-</%init>
diff --git a/httemplate/elements/tr-tower_sectors.html b/httemplate/elements/tr-tower_sectors.html
index 4e8f3fb47..106fc76f6 100644
--- a/httemplate/elements/tr-tower_sectors.html
+++ b/httemplate/elements/tr-tower_sectors.html
@@ -1,3 +1,11 @@
+<%shared>
+# kind of a hack...
+my ($export) = FS::tower_sector->part_export;
+my $antenna_types; # will be an ordered hash
+if ($export and $export->can('get_antenna_types')) {
+ $antenna_types = $export->get_antenna_types;
+}
+</%shared>
<%init>
my %opt = @_;
my $tower = $opt{'object'};
@@ -7,8 +15,9 @@ my $cgi = $opt{'cgi'};
my $tabcounter = 0;
my @fields = qw(
- sectorname ip_addr height freq_mhz direction width tilt v_width db_high
- db_low sector_range
+ sectorname ip_addr height freq_mhz direction width downtilt v_width
+ db_high db_low sector_range
+ power line_loss antenna_gain hardware_typenum
);
my @sectors;
@@ -74,6 +83,11 @@ my $id = $opt{id} || $opt{field} || 'sectornum';
border: none;
text-align: left;
}
+ .ui-tabs p {
+ margin-top: 8px;
+ margin-bottom: 8px;
+ }
+
</style>
@@ -216,6 +230,38 @@ $(function() {
</p>
<p>
+ <label for="<% $id %>_power"><% emt('Transmit power') %></label>
+ <input size="3"
+ id="<% $id %>_power"
+ name="<% $id %>_power"
+ value="<% $sector->power |h %>">
+ <% emt('dBm') %><br>
+ <label for="<% $id %>_antenna_gain">+ </label>
+ <input size="3"
+ id="<% $id %>_antenna_gain"
+ name="<% $id %>_antenna_gain"
+ value="<% $sector->antenna_gain |h %>">
+ <% emt('dB antenna gain') %><br>
+ <label for="<% $id %>_line_loss">&ndash; </label>
+ <input size="3"
+ id="<% $id %>_line_loss"
+ name="<% $id %>_line_loss"
+ value="<% $sector->line_loss |h %>">
+ <% emt('dB line loss') %>
+
+% if ( $antenna_types ) {
+ <p>
+ <label for="<% $id %>_hardware_typenum"><% emt('Antenna type') %></label>
+ <& /elements/select.html,
+ field => $id.'_hardware_typenum',
+ options => [ '', keys %$antenna_types ],
+ labels => $antenna_types,
+ curr_value => $sector->hardware_typenum,
+ &>
+ </p>
+% }
+% # this next section might not be necessary if you enter an antenna type
+ <p>
<label for="<% $id %>_width"><% emt('Horizontal beam') %></label>
<input size="3"
id="<% $id %>_width"
@@ -229,7 +275,7 @@ $(function() {
</p>
<label><% emt('Signal margin') %></label>
- <div style="display: inline-block; vertical-align: top">
+ <div style="display: inline-block; vertical-align: top">
<input class="dbspinner"
size="4"
id="<% $id %>_db_high"
@@ -244,7 +290,7 @@ $(function() {
name="<% $id %>_db_low"
value="<% $sector->db_low |h %>">
<% emt('dB (low quality)') %>
- </div>
+ </div>
</div>
</%def>
diff --git a/httemplate/search/tower-map.html b/httemplate/search/tower-map.html
index 559d83d08..d87e19ea6 100755
--- a/httemplate/search/tower-map.html
+++ b/httemplate/search/tower-map.html
@@ -8,6 +8,9 @@ html { height: 100% }
span.is_up { font-weight: bold; color: green }
span.is_down { font-weight: bold; color: red }
#search_location { width: 300px }
+
+.sector_list li { list-style: none }
+.sector_list li a { width: 150px }
</style>
<div id="map_canvas"></div>
@@ -300,4 +303,16 @@ Tower #<% $tower->towernum %> | <% $tower->towername %>
<br>
<input type="checkbox" name="show_coverage" value="<% $tower->towernum %>">
<% emt('Show coverage') %>
+<ul class="sector_list">
+% foreach my $sector ($tower->tower_sector) {
+% # could be more descriptive here
+ <li><% emt($sector->sectorname) %>
+% my @links_array;
+% foreach my $export ($sector->part_export) {
+% $export->export_links($sector, \@links_array); # already HTML, do not escape
+% }
+<% join(' ', @links_array) %>
+ </li>
+% }
+</ul>
</%def>