refactor search sidebar templating again
This commit is contained in:
@@ -50,6 +50,7 @@ get '/search' => sub {
|
|||||||
{ id => 'node', label => 'Node' },
|
{ id => 'node', label => 'Node' },
|
||||||
{ id => 'vlan', label => 'VLAN' },
|
{ id => 'vlan', label => 'VLAN' },
|
||||||
{ id => 'port', label => 'Port' },
|
{ id => 'port', label => 'Port' },
|
||||||
|
{ id => 'quux', label => 'Frobnitz' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
template 'search';
|
template 'search';
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<div id="device_search" class="tab-pane [% 'active' IF params.tab == 'device' %]">
|
|
||||||
<form id="device_form" class="nd_sidesearchform form-stacked" method="get" action="/search">
|
|
||||||
[%+ INCLUDE inc/search/box.tt %]
|
|
||||||
<p><em>Device Search Options</em></p>
|
|
||||||
<input name="tab" value="device" type="hidden"/>
|
|
||||||
[%+ INCLUDE inc/search/submit.tt %]
|
|
||||||
</form>
|
|
||||||
</div> <!-- /tab-pane -->
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
<div id="node_search" class="tab-pane [% 'active' IF params.tab == 'node' %]">
|
|
||||||
<form id="node_form" class="nd_sidesearchform form-stacked" method="get" action="/search">
|
|
||||||
[%+ INCLUDE inc/search/box.tt %]
|
|
||||||
<p><em>Node Search Options</em></p>
|
<p><em>Node Search Options</em></p>
|
||||||
<input name="tab" value="node" type="hidden"/>
|
<input name="tab" value="node" type="hidden"/>
|
||||||
<div class="clearfix input-prepend">
|
<div class="clearfix input-prepend">
|
||||||
@@ -27,6 +25,3 @@
|
|||||||
<span class="nd_searchcheckbox uneditable-input">Archived Data</span>
|
<span class="nd_searchcheckbox uneditable-input">Archived Data</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
[%+ INCLUDE inc/search/submit.tt %]
|
|
||||||
</form>
|
|
||||||
</div> <!-- /tab-pane -->
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
<div id="port_search" class="tab-pane [% 'active' IF params.tab == 'port' %]">
|
|
||||||
<form id="port_form" class="nd_sidesearchform form-stacked" method="get" action="/search">
|
|
||||||
[%+ INCLUDE inc/search/box.tt %]
|
|
||||||
<input name="tab" value="vlan" type="hidden"/>
|
|
||||||
[%+ INCLUDE inc/search/submit.tt %]
|
|
||||||
</form>
|
|
||||||
</div> <!-- /tab-pane -->
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<div id="vlan_search" class="tab-pane [% 'active' IF params.tab == 'vlan' %]">
|
|
||||||
<form id="vlan_form" class="nd_sidesearchform form-stacked" method="get" action="/search">
|
|
||||||
[%+ INCLUDE inc/search/box.tt %]
|
|
||||||
<input name="tab" value="vlan" type="hidden"/>
|
|
||||||
[%+ INCLUDE inc/search/submit.tt %]
|
|
||||||
</form>
|
|
||||||
</div> <!-- /tab-pane -->
|
|
||||||
@@ -3,8 +3,19 @@
|
|||||||
<div class="well">
|
<div class="well">
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
[% FOREACH tab IN vars.tabs %]
|
[% FOREACH tab IN vars.tabs %]
|
||||||
|
<div id="[% tab.id %]_search" class="tab-pane [% 'active' IF params.tab == tab.id %]">
|
||||||
[% INCLUDE "inc/search/${tab.id}.tt" %]
|
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="/search">
|
||||||
|
<div class="clearfix">
|
||||||
|
<input class="span3" name="q" value="[% params.q %]" type="text"/>
|
||||||
|
</div>
|
||||||
|
[%+ TRY %][% INCLUDE "inc/search/${tab.id}.tt" %][% CATCH %]<!-- no "[% tab.id %]" search options -->[% END %]
|
||||||
|
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
||||||
|
<div class="nd_search clearfix">
|
||||||
|
<button id="[% tab.id %]_submit" type="submit" class="btn info">Search Again</button>
|
||||||
|
<a id="[% tab.id %]_bookmark" href="#"><img class="nd_bookmark" src="/images/glyphicons_072_bookmark.png"></a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div> <!-- /tab-pane -->
|
||||||
[% END %]
|
[% END %]
|
||||||
</div> <!-- /tab-content -->
|
</div> <!-- /tab-content -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user