complete defaults into templates, attempt to set cookie in handler

This commit is contained in:
Oliver Gorwits
2017-12-10 18:09:10 +00:00
parent 88cb2b0b06
commit 53358c5311
10 changed files with 38 additions and 39 deletions

View File

@@ -20,9 +20,9 @@
[%- ELSE -%]
<span><i class="icon-leaf"></i>&nbsp;
[%- END -%]
<a href="[% report_moduleinventory %]&description=[% nodes.$item.module.description | uri %]">[% nodes.$item.module.description -%]</a>
<a href="[% uri_for('/report/moduleinventory') %]?description=[% nodes.$item.module.description | uri %]">[% nodes.$item.module.description -%]</a>
[%- IF nodes.$item.module.name -%]
<a href="[% report_moduleinventory %]&name=[% nodes.$item.module.name | uri %]">([% nodes.$item.module.name %])</a>
<a href="[% uri_for('/report/moduleinventory') %]?name=[% nodes.$item.module.name | uri %]">([% nodes.$item.module.name %])</a>
[%- END -%]
[%- IF nodes.$item.module.fw_ver -%]
fw: [% nodes.$item.module.fw_ver %]
@@ -34,13 +34,13 @@
sw: [% nodes.$item.module.sw_ver %]
[%- END -%]
[%- IF nodes.$item.module.serial -%]
<a href="[% report_moduleinventory %]&serial=[% nodes.$item.module.serial | uri %]">[serial: [% nodes.$item.module.serial %]]</a>
<a href="[% uri_for('/report/moduleinventory') %]?serial=[% nodes.$item.module.serial | uri %]">[serial: [% nodes.$item.module.serial %]]</a>
[%- END -%]
[%- IF nodes.$item.module.type -%]
/ <a href="[% report_moduleinventory %]&type=[% nodes.$item.module.type | uri %]">[% nodes.$item.module.type %]</a>
/ <a href="[% uri_for('/report/moduleinventory') %]?type=[% nodes.$item.module.type | uri %]">[% nodes.$item.module.type %]</a>
[%- END -%]
[%- IF nodes.$item.module.model -%]
/ <a href="[% report_moduleinventory %]&model=[% nodes.$item.module.model | uri %]">[% nodes.$item.module.model %]</a>
/ <a href="[% uri_for('/report/moduleinventory') %]?model=[% nodes.$item.module.model | uri %]">[% nodes.$item.module.model %]</a>
[%- END -%]
[%- IF nodes.$item.module.fru -%]
<b>[FRU]</b>

View File

@@ -92,16 +92,6 @@
update_csv_download_link('device', '[% tab.tag %]', '[% tab.provides_csv %]');
[% IF tab.tag == 'ports' %]
// to be fair I can't remember why we do this in JS and not from the app
// perhaps because selecting form fields to go in the cookie is easier?
// var cookie = $('#ports_form').find('input,select')
// .not('#nd_port-query,input[name="q"],input[name="tab"]')
// .serializeArray();
// $('#ports_form').find('input[type="checkbox"]').map(function() {
// cookie.push({'name': 'columns', 'value': $(this).attr('name')});
// });
// $.cookie('nd_ports-form', $.param(cookie) ,{ expires: 365 });
// form reset icon on ports tab
$('#nd_sidebar-reset-link').attr('href', uri_base + '/device?tab=[% tab.tag %]&reset=on&' +
$('#ports_form')

View File

@@ -86,7 +86,7 @@
<ul class="dropdown-menu">
[% FOREACH item IN settings._reports_menu.$category %]
[% NEXT IF settings._reports.$item.hidden %]
<li><a href="[% uri_for('/report/' _ item) %]">[% settings._reports.$item.label | html_entity %]</a></li>
<li><a href="[% uri_for('/report/' _ item) %]?firstsearch=on">[% settings._reports.$item.label | html_entity %]</a></li>
[% END %]
</ul>
</li>
@@ -138,6 +138,7 @@
<form class="navbar-search pull-left" method="get" action="[% uri_for('/search') %]">
<input placeholder="Find Anything" class="search-query span3"
id="nq" name="q" value="[% display_name %]" type="text" autocomplete="off"/>
<input name="firstsearch" type="hidden" value="on">
<div class="btn-group nd_navbar-search-group">
<button class="btn btn-inverse nd_navbar-search-icon">
<span style="font-size: 18px;">

View File

@@ -58,7 +58,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="fruonly"
name="fruonly"[% ' checked="checked"' IF params.fruonly %]/>
name="fruonly"[% ' checked="checked"' IF report_moduleinventory_defaults.fruonly %]/>
</label>
<label class="nd_checkboxlabel" for="fruonly">
<span class="nd_searchcheckbox uneditable-input">FRU Only</span>
@@ -67,7 +67,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="matchall"
name="matchall"[% ' checked="checked"' IF params.matchall %]/>
name="matchall"[% ' checked="checked"' IF report_moduleinventory_defaults.matchall %]/>
</label>
<label class="nd_checkboxlabel" for="matchall">
<span class="nd_searchcheckbox uneditable-input">Match All Options</span>

View File

@@ -89,7 +89,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="matchall"
name="matchall"[% ' checked="checked"' IF params.matchall %]/>
name="matchall"[% ' checked="checked"' IF search_device_defaults.matchall %]/>
</label>
<label class="nd_checkboxlabel" for="matchall">
<span class="nd_searchcheckbox uneditable-input">Match All Options</span>

View File

@@ -4,7 +4,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="stamps"
name="stamps"[% ' checked="checked"' IF params.stamps %]/>
name="stamps"[% ' checked="checked"' IF search_node_defaults.stamps %]/>
</label>
<label class="nd_checkboxlabel" for="stamps">
<span class="nd_searchcheckbox uneditable-input">Time Stamps</span>
@@ -13,7 +13,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="deviceports"
name="deviceports"[% ' checked="checked"' IF params.deviceports %]/>
name="deviceports"[% ' checked="checked"' IF search_node_defaults.deviceports %]/>
</label>
<label class="nd_checkboxlabel" for="deviceports">
<span class="nd_searchcheckbox uneditable-input">Device Ports</span>
@@ -22,7 +22,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="show_vendor"
name="show_vendor"[% ' checked="checked"' IF params.show_vendor %]/>
name="show_vendor"[% ' checked="checked"' IF search_node_defaults.show_vendor %]/>
</label>
<label class="nd_checkboxlabel" for="show_vendor">
<span class="nd_searchcheckbox uneditable-input">Vendor</span>
@@ -31,7 +31,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="archived"
name="archived"[% ' checked="checked"' IF params.archived %]/>
name="archived"[% ' checked="checked"' IF search_node_defaults.archived %]/>
</label>
<label class="nd_checkboxlabel" for="archived">
<span class="nd_searchcheckbox uneditable-input">
@@ -41,7 +41,7 @@
<div class="clearfix input-prepend">
<label class="add-on nd_sidebar-legend">
<input type="checkbox" id="node_partial"
name="partial"[% ' checked="checked"' IF params.partial %]/>
name="partial"[% ' checked="checked"' IF search_node_defaults.partial %]/>
</label>
<label class="nd_checkboxlabel" for="node_partial">
<span class="nd_searchcheckbox uneditable-input">Partial Match</span>
@@ -52,20 +52,20 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="age_invert"
name="age_invert"[% ' checked="checked"' IF params.age_invert %]/>
name="age_invert"[% ' checked="checked"' IF search_node_defaults.age_invert %]/>
</label>
<label class="nd_checkboxlabel" for="age_invert">
<span class="nd_searchcheckbox uneditable-input">Not within...</span>
</label>
</div>
<input class="nd_side-input" id="daterange"
type="text" name="daterange" value="[% params.daterange | html_entity %]"/>
type="text" name="daterange" value="[% search_node_defaults.daterange | html_entity %]"/>
</div>
<div class="clearfix">
<em class="muted">MAC address format:</em><br/>
<select id="nd_node-mac-format" name="mac_format">
[% FOREACH format IN [ 'IEEE', 'Cisco', 'Microsoft', 'Sun' ] %]
<option[% ' selected="selected"' IF params.mac_format == format %]>[% format %]</option>
<option[% ' selected="selected"' IF search_node_defaults.mac_format == format %]>[% format %]</option>
[% END %]
</select>
</div>

View File

@@ -4,7 +4,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="port_partial"
name="partial"[% ' checked="checked"' IF params.partial %]/>
name="partial"[% ' checked="checked"' IF search_port_defaults.partial %]/>
</label>
<label class="nd_checkboxlabel" for="port_partial">
<span class="nd_searchcheckbox uneditable-input">Partial Match</span>
@@ -13,7 +13,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="port_uplink"
name="uplink"[% ' checked="checked"' IF params.uplink %]/>
name="uplink"[% ' checked="checked"' IF search_port_defaults.uplink %]/>
</label>
<label class="nd_checkboxlabel" for="port_uplink">
<span class="nd_searchcheckbox uneditable-input">Uplinks</span>
@@ -22,7 +22,7 @@
<div class="clearfix input-prepend">
<label class="add-on">
<input type="checkbox" id="port_ethernet"
name="ethernet"[% ' checked="checked"' IF params.ethernet %]/>
name="ethernet"[% ' checked="checked"' IF search_port_defaults.ethernet %]/>
</label>
<label class="nd_checkboxlabel" for="port_ethernet">
<span class="nd_searchcheckbox uneditable-input">Ethernet Only</span>