refactor sidebar inclusion
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
# use lib '/root/perl-profiles/netdisco-web/lib/perl5';
|
||||||
|
use local::lib '/srv/www/vhosts/netdisco.ecmwf.int/perl-profiles/netdisco-web';
|
||||||
|
use lib '/srv/www/vhosts/netdisco.ecmwf.int/Netdisco/lib';
|
||||||
|
|
||||||
use Dancer;
|
use Dancer;
|
||||||
use Netdisco::Web;
|
use Netdisco::Web;
|
||||||
dance;
|
dance;
|
||||||
|
|||||||
@@ -7,20 +7,21 @@
|
|||||||
<img class="sidebar_toggle" id="sidebar_toggle_img_in"
|
<img class="sidebar_toggle" id="sidebar_toggle_img_in"
|
||||||
src="[% uri_base %]/images/splashyfish_right.png"
|
src="[% uri_base %]/images/splashyfish_right.png"
|
||||||
rel="twipsy" data-placement="left" data-offset="5" title="Hide Sidebar"/>
|
rel="twipsy" data-placement="left" data-offset="5" title="Hide Sidebar"/>
|
||||||
<h3 class="device_label">[% d.ip %]</h3>
|
|
||||||
[% IF d.dns %]
|
|
||||||
<p class="device_label">[% d.dns.remove(settings.domain_suffix) %]</p>
|
|
||||||
[% END %]
|
|
||||||
<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 %]">
|
<div id="[% tab.id %]_search" class="tab-pane [% 'active' IF params.tab == tab.id %]">
|
||||||
[% TRY %]
|
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/device') %]">
|
||||||
[% INCLUDE "sidebar/device/${tab.id}.tt" %]
|
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
||||||
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 1;</script>
|
[% TRY %]
|
||||||
[% CATCH %]
|
[% INCLUDE "sidebar/device/${tab.id}.tt" %]
|
||||||
<!-- no "[% tab.id %]" search options -->
|
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 1;</script>
|
||||||
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 0;</script>
|
[% CATCH %]
|
||||||
[% END %]
|
<!-- no "[% tab.id %]" search options -->
|
||||||
|
<input name="ip" value="[% params.ip %]" type="hidden"/>
|
||||||
|
<input name="q" value="[% params.q %]" type="hidden"/>
|
||||||
|
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 0;</script>
|
||||||
|
[% END %]
|
||||||
|
</form>
|
||||||
</div> <!-- /tab-pane -->
|
</div> <!-- /tab-pane -->
|
||||||
[% END %]
|
[% END %]
|
||||||
</div> <!-- /tab-content -->
|
</div> <!-- /tab-content -->
|
||||||
|
|||||||
@@ -11,14 +11,13 @@
|
|||||||
[% FOREACH tab IN vars.tabs %]
|
[% FOREACH tab IN vars.tabs %]
|
||||||
<div id="[% tab.id %]_search" class="tab-pane [% 'active' IF params.tab == tab.id %]">
|
<div id="[% tab.id %]_search" class="tab-pane [% 'active' IF params.tab == tab.id %]">
|
||||||
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/search') %]">
|
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/search') %]">
|
||||||
<input name="q" value="[% params.q %]" type="hidden"/>
|
|
||||||
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
||||||
[% TRY %]
|
[% TRY %]
|
||||||
[% INCLUDE "sidebar/search/${tab.id}.tt" %]
|
[% INCLUDE "sidebar/search/${tab.id}.tt" %]
|
||||||
<button id="[% tab.id %]_submit" type="submit" class="btn info span3">Search Again</button>
|
|
||||||
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 1;</script>
|
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 1;</script>
|
||||||
[% CATCH %]
|
[% CATCH %]
|
||||||
<!-- no "[% tab.id %]" search options -->
|
<!-- no "[% tab.id %]" search options -->
|
||||||
|
<input name="q" value="[% params.q %]" type="hidden"/>
|
||||||
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 0;</script>
|
<script type="text/javascript">has_sidebar["[% tab.id %]"] = 0;</script>
|
||||||
[% END %]
|
[% END %]
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/device') %]">
|
|
||||||
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
|
||||||
<input name="ip" value="[% params.ip %]" type="hidden"/>
|
|
||||||
<input name="q" value="[% params.q %]" type="hidden"/>
|
|
||||||
</form>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/device') %]">
|
|
||||||
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
|
||||||
<input name="ip" value="[% params.ip %]" type="hidden"/>
|
|
||||||
<input name="q" value="[% params.q %]" type="hidden"/>
|
|
||||||
</form>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/device') %]">
|
|
||||||
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
|
||||||
<input name="ip" value="[% params.ip %]" type="hidden"/>
|
|
||||||
<input name="q" value="[% params.q %]" type="hidden"/>
|
|
||||||
</form>
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
|
|
||||||
<form id="[% tab.id %]_form" class="nd_sidesearchform form-stacked" method="get" action="[% uri_for('/device') %]">
|
<p><em>Port Filter Options</em></p>
|
||||||
<input name="tab" value="[% tab.id %]" type="hidden"/>
|
|
||||||
<input name="ip" value="[% params.ip %]" type="hidden"/>
|
<input name="ip" value="[% params.ip %]" type="hidden"/>
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<a class="field_clear_icon" href="#"
|
<a class="field_clear_icon" href="#"
|
||||||
rel="twipsy" data-placement="left" data-offset="3" title="Show all Ports">
|
rel="twipsy" data-placement="above" data-offset="3" title="Show all Ports">
|
||||||
<img src="[% uri_base %]/images/tango_sweep.png"/></a>
|
<img src="[% uri_base %]/images/tango_sweep.png"/></a>
|
||||||
<input class="nd_port_query span3" placeholder="Port, Name or VLAN"
|
<input class="nd_port_query span3" placeholder="Port, Name or VLAN"
|
||||||
name="q" value="[% params.q %]" type="text"
|
name="q" value="[% params.q %]" type="text"
|
||||||
@@ -96,10 +95,4 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="nd_search clearfix">
|
<button id="[% tab.id %]_submit" type="submit" class="btn info span3">Update View</button>
|
||||||
<button id="[% tab.id %]_submit" type="submit" class="btn info">Update View</button>
|
|
||||||
<a id="[% tab.id %]_bookmark" href="#"
|
|
||||||
rel="twipsy" data-placement="left" data-offset="5" title="Bookmark these Settings">
|
|
||||||
<img class="nd_bookmark" src="[% uri_base %]/images/glyphicons_072_bookmark.png"></a>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
<p><em>Device Search Options</em></p>
|
<p><em>Device Search Options</em></p>
|
||||||
|
<input name="q" value="[% params.q %]" type="hidden"/>
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<input class="span3" placeholder="System Name"
|
<input class="span3" placeholder="System Name"
|
||||||
type="text" name="name" value="[% params.name %]"
|
type="text" name="name" value="[% params.name %]"
|
||||||
@@ -60,3 +61,4 @@
|
|||||||
<span class="nd_searchcheckbox uneditable-input">Match All Options</span>
|
<span class="nd_searchcheckbox uneditable-input">Match All Options</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<button id="[% tab.id %]_submit" type="submit" class="btn info span3">Search Again</button>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
<p><em>Node Search Options</em></p>
|
<p><em>Node Search Options</em></p>
|
||||||
|
<input name="q" value="[% params.q %]" type="hidden"/>
|
||||||
<div class="clearfix input-prepend">
|
<div class="clearfix input-prepend">
|
||||||
<label class="add-on">
|
<label class="add-on">
|
||||||
<input type="checkbox" id="stamps" name="stamps"[% ' checked="checked"' IF params.stamps %]/>
|
<input type="checkbox" id="stamps" name="stamps"[% ' checked="checked"' IF params.stamps %]/>
|
||||||
@@ -34,3 +35,4 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
[% END %]
|
[% END %]
|
||||||
|
<button id="[% tab.id %]_submit" type="submit" class="btn info span3">Search Again</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user