%inherit file="//layout/view.html" />
<%namespace file="//view/_helpers.html" import="*"/>
<%namespace name="lib" file="//lib.html" import="*"/>
<%!
import logging
logger = logging.getLogger('splunk.appserver.templates.view.dashboard')
headerPanels = ["appHeader", "navigationHeader"]
upperPanels = ["viewHeader", "splSearchControls-inline", "reportFirstPanel", "reportSecondPanel", "reportThirdPanel"]
lowerPanels = ["graphArea", "resultsArea"]
renderingErrors = []
%>
<%def name="css()">
<% parent.css() %>
<%lib:stylesheet_tags files="${['/static/css/reportbuilder.css']}" compile="${False}" />
%def>
<%def name="buildPanelContents(modules, groupName)">
<%call expr="parent.buildPanelContents(modules, groupName)">%call>
%def>
<%def name="buildSimplePanelContainer(modules, panelName)">
<%call expr="parent.buildSimplePanelContainer(modules, panelName)">%call>
%def>
<%def name="getFloatLayoutRow(modules, rowNumber)">
<%call expr="parent.getFloatLayoutRow(modules, rowNumber)">%call>
%def>
<%def name="getDashboardPanel(modules, panelGroup)">
% for groupName in panelGroup :
<%call expr="buildPanelContents(modules, groupName)">%call>
% endfor
%def>
% if "messaging" in modules :
<%call expr="buildSimplePanelContainer(modules, 'messaging')">%call>
% endif
% for panelName in upperPanels :
<%call expr="buildSimplePanelContainer(modules, panelName)">%call>
% endfor
% for rowNumber in range(1,10):
% if 'panel_row' + str(rowNumber) + '_col1' in modules :
<%call expr="parent.getFloatLayoutRow(modules, rowNumber)">%call>
% endif
% endfor
% for panelName in lowerPanels :
<%call expr="buildSimplePanelContainer(modules, panelName)">%call>
% endfor
<%call expr="lib.add_script_block()">
// slightly modified the equalHeights extension.
// if elements are less than 5px across, i let them shrink to 0 height.
// reason being is that our switchers may well have hidden every module within
// a container. The container then falls to 0 width, but it has a 1px border
// And if if it also has a min-height, the border will be visible which we dont want.
$.fn.equalHeights = function(px) {
$(this).each(function(){
$(this).children().css({'min-height': 0});
if ($.browser.msie && $.browser.version == 6.0) {
$(this).children().css({'height': 0});
}
var max = 0;
$(this).children().each(function(i){
if ($(this).height() > max) { max = $(this).height(); }
});
if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': max}); }
$(this).children().not(":width(<5)").css({'min-height': max});
// while we're in here we check whether the row is <10 px, which we assume
// means that all the modules in the row are hidden. In this case
// we hide the border, and reduce the padding to 0 so the whole row
// will take up no space, and not have that vestigial border.
if (max<10) {
$(this).css({"padding": "0px", "border-bottom-width" : "0px"});
} else {
$(this).css({"padding": "5px 10px", "border-bottom-width" : "1px" });
}
});
return this;
};
// borrowed from http://james.padolsey.com/javascript/extending-jquerys-selector-capabilities/
$.extend($.expr[':'],{
width: function(a,i,m) {
if(!m[3]||!(/^(<|>)\d+$/).test(m[3])) {return false;}
return m[3].substr(0,1) === '>' ?
$(a).width() > m[3].substr(1) : $(a).width() < m[3].substr(1);
}
});
$(document).bind("change click ready allModulesLoaded", function(event) {
$(".equalHeightRow").equalHeights(true);
});
%call>