html template fixups (#576)

* none is not a valid value for min-width, so set it to zero

* these 2 "checked" if statements need a space in front of them,
else they will attach to the previous element

id="nd_showspeed"checked="checked"

* multiple tag has no options according to
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select

also, don't close select before we've gotten to the option tags

* multiple tag has no options according to
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select

also, don't close select before we've gotten to the option tags

* just to be sure put a space in front of these optional tags as well,

* $a is technically allowed but is considered not best practice
This commit is contained in:
nick n
2019-05-12 09:32:42 +02:00
committed by Oliver Gorwits
parent 90a7ee6b56
commit cd2a4b9362
12 changed files with 38 additions and 38 deletions

View File

@@ -31,14 +31,14 @@ ajax '/ajax/portcontrol' => require_any_role [qw(admin port_control)] => sub {
schema('netdisco')->txn_do(sub { schema('netdisco')->txn_do(sub {
if (param('port')) { if (param('port')) {
my $a = "$action $subaction"; my $act = "$action $subaction";
$a =~ s/-other$//; $act =~ s/-other$//;
$a =~ s/^portcontrol/port/; $act =~ s/^portcontrol/port/;
schema('netdisco')->resultset('DevicePortLog')->create({ schema('netdisco')->resultset('DevicePortLog')->create({
ip => param('device'), ip => param('device'),
port => param('port'), port => param('port'),
action => $a, action => $act,
username => session('logged_in_user'), username => session('logged_in_user'),
userip => request->remote_address, userip => request->remote_address,
reason => (param('reason') || 'other'), reason => (param('reason') || 'other'),

View File

@@ -87,7 +87,7 @@ div.content > div.tab-content table.nd_floatinghead thead {
/* to be added to qtip-bootstrap class */ /* to be added to qtip-bootstrap class */
.nd_qtip-unconstrained { .nd_qtip-unconstrained {
min-width: none; min-width: 0;
max-width: none; max-width: none;
} }

View File

@@ -32,10 +32,10 @@
<input data-form="update" name="mac" type="text" value="[% row.mac | html_entity %]"> <input data-form="update" name="mac" type="text" value="[% row.mac | html_entity %]">
</td> </td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input data-form="update" name="matchoui" type="checkbox" [% 'checked="checked"' IF row.matchoui %]> <input data-form="update" name="matchoui" type="checkbox" [% ' checked="checked"' IF row.matchoui %]>
</td> </td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input data-form="update" name="active" type="checkbox" [% 'checked="checked"' IF row.active %]> <input data-form="update" name="active" type="checkbox" [% ' checked="checked"' IF row.active %]>
</td> </td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input data-form="update" name="why" type="text" value="[% row.why | html_entity %]"> <input data-form="update" name="why" type="text" value="[% row.why | html_entity %]">

View File

@@ -43,13 +43,13 @@
<input data-form="update" name="password" type="password" value="********"> <input data-form="update" name="password" type="password" value="********">
</td> </td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input data-form="update" name="ldap" type="checkbox" [% 'checked="checked"' IF row.ldap %]> <input data-form="update" name="ldap" type="checkbox" [% ' checked="checked"' IF row.ldap %]>
</td> </td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input data-form="update" name="port_control" type="checkbox" [% 'checked="checked"' IF row.port_control %]> <input data-form="update" name="port_control" type="checkbox" [% ' checked="checked"' IF row.port_control %]>
</td> </td>
<td class="nd_center-cell"> <td class="nd_center-cell">
<input data-form="update" name="admin" type="checkbox" [% 'checked="checked"' IF row.admin %]> <input data-form="update" name="admin" type="checkbox" [% ' checked="checked"' IF row.admin %]>
</td> </td>
<td class="nd_center-cell">[% row.created | html_entity %]</td> <td class="nd_center-cell">[% row.created | html_entity %]</td>
<td class="nd_center-cell">[% row.last_seen | html_entity %]</td> <td class="nd_center-cell">[% row.last_seen | html_entity %]</td>

View File

@@ -13,7 +13,7 @@
<div class="checkbox pull-left"> <div class="checkbox pull-left">
<label> <label>
<input type="checkbox" name="showips" id="nd_showips" <input type="checkbox" name="showips" id="nd_showips"
[% 'checked="checked"' IF vars.sidebar_defaults.device_netmap.showips %] [% ' checked="checked"' IF vars.sidebar_defaults.device_netmap.showips %]
data-toggle="toggle" data-size="small" data-width="30" data-toggle="toggle" data-size="small" data-width="30"
data-on="Show" data-off=" " data-onstyle="success"> data-on="Show" data-off=" " data-onstyle="success">
<span onclick="$('#nd_showips').bootstrapToggle('toggle')">&nbsp;Management IP</span> <span onclick="$('#nd_showips').bootstrapToggle('toggle')">&nbsp;Management IP</span>
@@ -22,7 +22,7 @@
<div class="checkbox pull-left"> <div class="checkbox pull-left">
<label> <label>
<input type="checkbox" name="showspeed" id="nd_showspeed" <input type="checkbox" name="showspeed" id="nd_showspeed"
[% 'checked="checked"' IF vars.sidebar_defaults.device_netmap.showspeed %] [% ' checked="checked"' IF vars.sidebar_defaults.device_netmap.showspeed %]
data-toggle="toggle" data-size="small" data-width="30" data-toggle="toggle" data-size="small" data-width="30"
data-on="Show" data-off=" " data-onstyle="success"> data-on="Show" data-off=" " data-onstyle="success">
<span onclick="$('#nd_showspeed').bootstrapToggle('toggle')">&nbsp;Link Speed</span> <span onclick="$('#nd_showspeed').bootstrapToggle('toggle')">&nbsp;Link Speed</span>
@@ -78,8 +78,8 @@
[% IF hgroup_list.size %] [% IF hgroup_list.size %]
<select class="nd_side-select" size="[% hgroup_list.size > 4 ? 4 : hgroup_list.size %]" <select class="nd_side-select" size="[% hgroup_list.size > 4 ? 4 : hgroup_list.size %]"
multiple="on" name="hgroup" id="nd_hgroup-select" multiple name="hgroup" id="nd_hgroup-select"
rel="tooltip" data-placement="left" data-offset="5" data-title="Host Groups"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Host Groups">
[% FOREACH opt IN hgroup_list.pairs %] [% FOREACH opt IN hgroup_list.pairs %]
<option[% ' selected="selected"' IF hgroup_lkp.exists(opt.key) %] <option[% ' selected="selected"' IF hgroup_lkp.exists(opt.key) %]
value="[% opt.key %]">[% opt.value | html_entity %]</option> value="[% opt.key %]">[% opt.value | html_entity %]</option>
@@ -88,8 +88,8 @@
[% END %] [% END %]
[% IF lgroup_list.size %] [% IF lgroup_list.size %]
<select class="nd_side-select" size="[% lgroup_list.size > 4 ? 4 : lgroup_list.size %]" <select class="nd_side-select" size="[% lgroup_list.size > 4 ? 4 : lgroup_list.size %]"
multiple="on" name="lgroup" id="nd_lgroup-select" multiple name="lgroup" id="nd_lgroup-select"
rel="tooltip" data-placement="left" data-offset="5" data-title="Device Locations"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Device Locations">
[% FOREACH loc IN lgroup_list %] [% FOREACH loc IN lgroup_list %]
<option[% ' selected="selected"' IF lgroup_lkp.exists(loc) %] <option[% ' selected="selected"' IF lgroup_lkp.exists(loc) %]
value="[% loc %]">[% loc | html_entity %]</option> value="[% loc %]">[% loc | html_entity %]</option>
@@ -123,7 +123,7 @@
<div class="clearfix input-prepend"> <div class="clearfix input-prepend">
<label class="add-on"> <label class="add-on">
<input type="checkbox" id="dynamicsize" name="dynamicsize" <input type="checkbox" id="dynamicsize" name="dynamicsize"
[% 'checked="checked"' IF vars.sidebar_defaults.device_netmap.dynamicsize %]/> [% ' checked="checked"' IF vars.sidebar_defaults.device_netmap.dynamicsize %]/>
</label> </label>
<label class="nd_checkboxlabel" for="dynamicsize"> <label class="nd_checkboxlabel" for="dynamicsize">
<span class="nd_searchcheckbox uneditable-input">Dynamic Size</span> <span class="nd_searchcheckbox uneditable-input">Dynamic Size</span>

View File

@@ -126,7 +126,7 @@
<li> <li>
<em class="muted">Show Ports with Status:</em><br/> <em class="muted">Show Ports with Status:</em><br/>
<div class="clearfix"> <div class="clearfix">
<select id="nd_port-state-select" size="4" multiple="on" name="port_state"/> <select id="nd_port-state-select" size="4" multiple name="port_state">
<option selected="selected" value="up">Link Up</option> <option selected="selected" value="up">Link Up</option>
<option selected="selected" value="free">Port Free</option> <option selected="selected" value="free">Port Free</option>
<option selected="selected" value="down">Link Down</option> <option selected="selected" value="down">Link Down</option>

View File

@@ -44,8 +44,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select nd_colored-input" size="[% class_list.size > 5 ? 5 : class_list.size %]" <select class="nd_side-select nd_colored-input" size="[% class_list.size > 5 ? 5 : class_list.size %]"
multiple="on" name="class" multiple name="class"
rel="tooltip" data-placement="left" data-offset="5" data-title="Module Class"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Module Class">
[% FOREACH opt IN class_list %] [% FOREACH opt IN class_list %]
<option[% ' selected="selected"' IF class_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF class_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]

View File

@@ -2,8 +2,8 @@
<p class="nd_sidebar-title"><em>NetBIOS Domain</em></p> <p class="nd_sidebar-title"><em>NetBIOS Domain</em></p>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select nd_colored-input" size="[% domain_list.size > 8 ? 8 : domain_list.size %]" <select class="nd_side-select nd_colored-input" size="[% domain_list.size > 8 ? 8 : domain_list.size %]"
multiple="on" name="domain" multiple name="domain"
rel="tooltip" data-placement="left" data-offset="5" data-title="Domain"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Domain">
[% FOREACH opt IN domain_list %] [% FOREACH opt IN domain_list %]
[% UNLESS opt == '' %] [% UNLESS opt == '' %]
<option[% ' selected="selected"' IF domain_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF domain_lkp.exists(opt) %]>[% opt | html_entity %]</option>

View File

@@ -13,8 +13,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select nd_colored-input" size="[% type_list.size > 8 ? 8 : type_list.size %]" <select class="nd_side-select nd_colored-input" size="[% type_list.size > 8 ? 8 : type_list.size %]"
multiple="on" name="remote_type" multiple name="remote_type"
rel="tooltip" data-placement="left" data-offset="5" data-title="Remote Type"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Remote Type">
[% FOREACH opt IN type_list %] [% FOREACH opt IN type_list %]
<option[% ' selected="selected"' IF type_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF type_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]

View File

@@ -6,8 +6,8 @@
</legend> </legend>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select nd_colored-input" size="[% vendor_list.size > 8 ? 8 : vendor_list.size %]" <select class="nd_side-select nd_colored-input" size="[% vendor_list.size > 8 ? 8 : vendor_list.size %]"
multiple="on" name="vendor" multiple name="vendor"
rel="tooltip" data-placement="left" data-offset="5" data-title="Vendor"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Vendor">
[% FOREACH opt IN vendor_list %] [% FOREACH opt IN vendor_list %]
[% UNLESS opt == '' %] [% UNLESS opt == '' %]
<option[% ' selected="selected"' IF vendor_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF vendor_lkp.exists(opt) %]>[% opt | html_entity %]</option>

View File

@@ -2,8 +2,8 @@
<p class="nd_sidebar-title"><em>Details by SSID</em></p> <p class="nd_sidebar-title"><em>Details by SSID</em></p>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select nd_colored-input" size="[% ssid_list.size > 8 ? 8 : ssid_list.size %]" <select class="nd_side-select nd_colored-input" size="[% ssid_list.size > 8 ? 8 : ssid_list.size %]"
multiple="on" name="ssid" multiple name="ssid"
rel="tooltip" data-placement="left" data-offset="5" data-title="SSID"/> rel="tooltip" data-placement="left" data-offset="5" data-title="SSID">
[% FOREACH opt IN ssid_list %] [% FOREACH opt IN ssid_list %]
<option[% ' selected="selected"' IF ssid_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF ssid_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]

View File

@@ -43,8 +43,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select" size="[% model_list.size > 5 ? 5 : model_list.size %]" <select class="nd_side-select" size="[% model_list.size > 5 ? 5 : model_list.size %]"
multiple="on" name="model" multiple name="model"
rel="tooltip" data-placement="left" data-offset="5" data-title="Model"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Model">
[% FOREACH opt IN model_list %] [% FOREACH opt IN model_list %]
<option[% ' selected="selected"' IF model_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF model_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]
@@ -52,8 +52,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select" size="[% os_list.size > 5 ? 5 : os_list.size %]" <select class="nd_side-select" size="[% os_list.size > 5 ? 5 : os_list.size %]"
multiple="on" name="os" multiple name="os"
rel="tooltip" data-placement="left" data-offset="5" data-title="Operating System"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Operating System">
[% FOREACH opt IN os_list %] [% FOREACH opt IN os_list %]
<option[% ' selected="selected"' IF os_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF os_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]
@@ -61,8 +61,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select" size="[% os_ver_list.size > 5 ? 5 : os_ver_list.size %]" <select class="nd_side-select" size="[% os_ver_list.size > 5 ? 5 : os_ver_list.size %]"
multiple="on" name="os_ver" multiple name="os_ver"
rel="tooltip" data-placement="left" data-offset="5" data-title="OS Release"/> rel="tooltip" data-placement="left" data-offset="5" data-title="OS Release">
[% FOREACH opt IN os_ver_list %] [% FOREACH opt IN os_ver_list %]
<option[% ' selected="selected"' IF os_ver_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF os_ver_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]
@@ -70,8 +70,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select" size="[% vendor_list.size > 5 ? 5 : vendor_list.size %]" <select class="nd_side-select" size="[% vendor_list.size > 5 ? 5 : vendor_list.size %]"
multiple="on" name="vendor" multiple name="vendor"
rel="tooltip" data-placement="left" data-offset="5" data-title="Vendor"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Vendor">
[% FOREACH opt IN vendor_list %] [% FOREACH opt IN vendor_list %]
<option[% ' selected="selected"' IF vendor_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF vendor_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]
@@ -79,8 +79,8 @@
</div> </div>
<div class="clearfix"> <div class="clearfix">
<select class="nd_side-select" size="3" <select class="nd_side-select" size="3"
multiple="on" name="layers" multiple name="layers"
rel="tooltip" data-placement="left" data-offset="5" data-title="Layer"/> rel="tooltip" data-placement="left" data-offset="5" data-title="Layer">
[% FOREACH opt IN [ 1 .. 7 ] %] [% FOREACH opt IN [ 1 .. 7 ] %]
<option[% ' selected="selected"' IF layers_lkp.exists(opt) %]>[% opt | html_entity %]</option> <option[% ' selected="selected"' IF layers_lkp.exists(opt) %]>[% opt | html_entity %]</option>
[% END %] [% END %]