diff options
author | Mark Wells <mark@freeside.biz> | 2016-10-10 23:54:05 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2016-10-10 23:54:05 -0700 |
commit | 04f53daab621710db56b075e1aaf56e7c52f9ba9 (patch) | |
tree | f3bf508716c8c85c5382e3286e2e81ff6670247e /httemplate/elements | |
parent | 49d9ea969069430ef3fe23e5b1ac3599e929bb04 (diff) |
export tower/sector data to TowerCoverage API, #39776
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/tr-tower_sector.html | 24 | ||||
-rw-r--r-- | httemplate/elements/tr-tower_sectors.html | 54 |
2 files changed, 50 insertions, 28 deletions
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">– </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> |