always make a sidebar for custom reports with bind params; add show_sidebar setting
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
<script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = 1;</script>
|
||||
[% INCLUDE "sidebar/report/${report.tag}.tt" %]
|
||||
[% CATCH %]
|
||||
<script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = 0;</script>
|
||||
<script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = [% report.rconfig.bind_params.size ? '1' : '0' %];</script>
|
||||
[% INCLUDE "sidebar/report/generic_report.tt" %]
|
||||
[% END %]
|
||||
</form>
|
||||
@@ -49,5 +49,16 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
[% IF report.rconfig.bind_params.size AND NOT report.rconfig.show_sidebar %]
|
||||
$('.nd_sidebar').toggle(0);
|
||||
$('#nd_sidebar-toggle-img-out').toggle();
|
||||
$('.content').css('margin-right', '10px');
|
||||
$('div.content > div.tab-content table.nd_floatinghead').floatThead('destroy');
|
||||
$('div.content > div.tab-content table.nd_floatinghead').floatThead({
|
||||
scrollingTop: 40
|
||||
,useAbsolutePositioning: false
|
||||
});
|
||||
sidebar_hidden = 1;
|
||||
[% END %]
|
||||
[%+ INCLUDE 'js/report.js' -%]
|
||||
</script>
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
[% IF report.rconfig.bind_params.size %]
|
||||
<p class="nd_sidebar-title"><em>Report Options</em></p>
|
||||
|
||||
[% FOREACH k IN report.rconfig.bind_params %]
|
||||
<input name="[% k %]" value="[% params.$k | html_entity %]" type="hidden"/>
|
||||
[% FOREACH p IN report.rconfig.bind_params %]
|
||||
<div class="clearfix nd_netmap-sidebar">
|
||||
<em class="muted nd_sidebar-label">[% p.ucfirst | html_entity %]</em><br/>
|
||||
<input id="nd_port-query" placeholder=""
|
||||
name="[% p | html_entity %]" value="[% params.$p | html_entity %]" type="text"
|
||||
rel="tooltip" data-placement="left" data-offset="5" data-title="[% p.ucfirst | html_entity %]"/>
|
||||
</div>
|
||||
[% END %]
|
||||
|
||||
<button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
|
||||
<i class="icon-search icon-large pull-left nd_navbar-icon"></i> Search</button>
|
||||
[% ELSE %]
|
||||
[% FOREACH k IN report.rconfig.bind_params %]
|
||||
<input name="[% k %]" value="[% params.$k | html_entity %]" type="hidden"/>
|
||||
[% END %]
|
||||
[% END %]
|
||||
|
||||
Reference in New Issue
Block a user