From: Marcin Haba Date: Thu, 14 Aug 2014 19:50:19 +0000 (+0200) Subject: baculum: Added window elements count X-Git-Tag: Release-7.2.0~136 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6fa13db2142a8fbacaa2acb2a5c5abf0d5913f19;p=bacula%2Fbacula baculum: Added window elements count --- diff --git a/gui/baculum/protected/JavaScript/configuration-window.js b/gui/baculum/protected/JavaScript/configuration-window.js index eb70900521..d6cd0847f6 100644 --- a/gui/baculum/protected/JavaScript/configuration-window.js +++ b/gui/baculum/protected/JavaScript/configuration-window.js @@ -35,5 +35,15 @@ var ConfigurationWindowClass = new Class.create({ is_progress: function() { return $(this.progress_id).getStyle('display') == 'block'; + }, + openConfigurationWindow: function(request, slideWindowObj) { + if(this.is_progress() === false) { + this.progress(true); + if(slideWindowObj.isFullSize() === true) { + slideWindowObj.resetSize(); + } + request.dispatch(); + } } }); + diff --git a/gui/baculum/protected/JavaScript/slide-window.js b/gui/baculum/protected/JavaScript/slide-window.js index 7c2f6fcff2..869d7c5234 100644 --- a/gui/baculum/protected/JavaScript/slide-window.js +++ b/gui/baculum/protected/JavaScript/slide-window.js @@ -24,11 +24,11 @@ var SlideWindowClass = Class.create({ contentItems : 'slide-window-element', contentAlternatingItems : 'slide-window-element-alternating', toolsButtonSuffix : '-slide-window-tools', - toolbarSuffix : '-slide-window-toolbar' + toolbarSuffix : '-slide-window-toolbar', + titleSuffix : '-slide-window-title' }, initialize: function(windowId, data) { - this.windowId = windowId; this.window = $(this.windowId + this.elements.containerSuffix); this.tools = $(this.windowId + this.elements.toolsButtonSuffix); @@ -60,7 +60,6 @@ var SlideWindowClass = Class.create({ alert('slide-window.js - "search" property does not exists.'); return false; } - this.setEvents(); }, @@ -168,7 +167,7 @@ var SlideWindowClass = Class.create({ setSearch: function() { var search_pattern = new RegExp(this.search.value) - $$('div[id=' + this.windowId + this.elements.containerSuffix + '] div.' + this.elements.contentItems).each(function(value){ + $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] div.' + this.elements.contentItems).each(function(value){ if(search_pattern.match(value.childNodes[2].textContent) == false) { value.setStyle({'display' : 'none'}); @@ -177,7 +176,7 @@ var SlideWindowClass = Class.create({ } }.bind(search_pattern)); - $$('div[id=' + this.windowId + this.elements.containerSuffix + '] tr.' + this.elements.contentItems + ', div[id=' + this.windowId + this.elements.containerSuffix + '] tr.' + this.elements.contentAlternatingItems).each(function(value){ + $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] tr.' + this.elements.contentItems + ', div[id="' + this.windowId + this.elements.containerSuffix + '"] tr.' + this.elements.contentAlternatingItems).each(function(value){ if(search_pattern.match(value.down('div').innerHTML) == false) { value.setStyle({'display' : 'none'}); } else { @@ -185,7 +184,12 @@ var SlideWindowClass = Class.create({ } }.bind(search_pattern)); }, - + setElementsCount : function() { + var title_el = $(this.windowId + this.elements.titleSuffix); + var elements_count = $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] div.' + this.elements.contentItems).length || $$('div[id="' + this.windowId + this.elements.containerSuffix + '"] tr.' + this.elements.contentItems + ', div[id="' + this.windowId + this.elements.containerSuffix + '"] tr.' + this.elements.contentAlternatingItems).length; + var count_el = $(this.windowId + this.elements.titleSuffix).getElementsByTagName('span')[0]; + $(count_el).update(' (' + elements_count + ')'); + }, toggleToolbar: function() { Effect.toggle($(this.windowId + this.elements.toolbarSuffix), 'slide', { duration: 0.2}); } diff --git a/gui/baculum/protected/Pages/Home.page b/gui/baculum/protected/Pages/Home.page index f622c8a03f..8e7ca3221b 100644 --- a/gui/baculum/protected/Pages/Home.page +++ b/gui/baculum/protected/Pages/Home.page @@ -6,12 +6,12 @@
diff --git a/gui/baculum/protected/Portlets/ClientList.tpl b/gui/baculum/protected/Portlets/ClientList.tpl index 2b169c485e..8142c24c1b 100644 --- a/gui/baculum/protected/Portlets/ClientList.tpl +++ b/gui/baculum/protected/Portlets/ClientList.tpl @@ -1,6 +1,12 @@ <%@ MasterClass="Application.Portlets.SlideWindow"%> + @@ -8,20 +14,14 @@ - ConfigurationWindow<%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>.progress(false); + clientConfigurationWindow.show(); + clientConfigurationWindow.progress(false); @@ -43,20 +43,14 @@ <%=$this->getParent()->Data['name']%> - ConfigurationWindow<%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->ClientConfiguration->getMaster()->ClientID%>.progress(false); + clientConfigurationWindow.show(); + clientConfigurationWindow.progress(false); diff --git a/gui/baculum/protected/Portlets/JobList.tpl b/gui/baculum/protected/Portlets/JobList.tpl index b076da81df..d20d0ddc41 100644 --- a/gui/baculum/protected/Portlets/JobList.tpl +++ b/gui/baculum/protected/Portlets/JobList.tpl @@ -1,6 +1,12 @@ <%@ MasterClass="Application.Portlets.SlideWindow" %> + @@ -8,20 +14,14 @@ - ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.progress(false); + jobConfigurationWindow.show(); + jobConfigurationWindow.progress(false); @@ -49,20 +49,14 @@ <%=$this->getParent()->Data['name']%> - ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->JobConfiguration->getMaster()->ClientID%>.progress(false); + jobConfigurationWindow.show(); + jobConfigurationWindow.progress(false); diff --git a/gui/baculum/protected/Portlets/JobRunList.tpl b/gui/baculum/protected/Portlets/JobRunList.tpl index cc649925fd..e7b8066c93 100644 --- a/gui/baculum/protected/Portlets/JobRunList.tpl +++ b/gui/baculum/protected/Portlets/JobRunList.tpl @@ -1,28 +1,28 @@ <%@ MasterClass="Application.Portlets.SlideWindow" %> + <%=($this->getPage()->JobRunWindow->oldDirector != $this->DataItem['director']) ? '
Director: ' . $this->DataItem['director'] . '
': ''%> - + <%=@$this->DataItem['name']%> - + - ConfigurationWindow<%=$this->getPage()->JobRunConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->JobRunConfiguration->getMaster()->ClientID%>.progress(false); + jobRunConfigurationWindow.show(); + jobRunConfigurationWindow.progress(false); <%=!($this->getPage()->JobRunWindow->oldDirector = $this->DataItem['director'])%> @@ -42,23 +42,17 @@ > - <%=$this->getParent()->DataItem['name']%> - + <%=$this->getParent()->DataItem['name']%> + - ConfigurationWindow<%=$this->getPage()->JobRunConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->JobRunConfiguration->getMaster()->ClientID%>.progress(false); + jobRunConfigurationWindow.show(); + jobRunConfigurationWindow.progress(false); diff --git a/gui/baculum/protected/Portlets/PoolList.tpl b/gui/baculum/protected/Portlets/PoolList.tpl index 326ca81156..cc261164c0 100644 --- a/gui/baculum/protected/Portlets/PoolList.tpl +++ b/gui/baculum/protected/Portlets/PoolList.tpl @@ -1,6 +1,12 @@ <%@ MasterClass="Application.Portlets.SlideWindow"%> + @@ -8,20 +14,14 @@ - ConfigurationWindow<%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>.progress(false); + poolConfigurationWindow.show(); + poolConfigurationWindow.progress(false); @@ -44,20 +44,14 @@ <%=$this->getParent()->Data['name']%> - ConfigurationWindow<%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->PoolConfiguration->getMaster()->ClientID%>.progress(false); + poolConfigurationWindow.show(); + poolConfigurationWindow.progress(false);
diff --git a/gui/baculum/protected/Portlets/SlideWindow.tpl b/gui/baculum/protected/Portlets/SlideWindow.tpl index faec0e304e..875ab8bb21 100644 --- a/gui/baculum/protected/Portlets/SlideWindow.tpl +++ b/gui/baculum/protected/Portlets/SlideWindow.tpl @@ -6,7 +6,7 @@ - + @@ -18,7 +18,7 @@
-
<%=$this->getParent()->windowTitle%>
+
<%=$this->getParent()->windowTitle%>
@@ -42,4 +42,4 @@
\ No newline at end of file + diff --git a/gui/baculum/protected/Portlets/StorageList.tpl b/gui/baculum/protected/Portlets/StorageList.tpl index 425643c33f..cac63cf395 100644 --- a/gui/baculum/protected/Portlets/StorageList.tpl +++ b/gui/baculum/protected/Portlets/StorageList.tpl @@ -1,6 +1,12 @@ <%@ MasterClass="Application.Portlets.SlideWindow" %> + @@ -8,20 +14,14 @@ - ConfigurationWindow<%=$this->getPage()->StorageConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->StorageConfiguration->getMaster()->ClientID%>.progress(false); + storageConfigurationWindow.show(); + storageConfigurationWindow.progress(false); @@ -43,20 +43,14 @@ <%=$this->getParent()->Data['name']%> - ConfigurationWindow<%=$this->getPage()->StorageConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->StorageConfiguration->getMaster()->ClientID%>.progress(false); + storageConfigurationWindow.show(); + storageConfigurationWindow.progress(false); diff --git a/gui/baculum/protected/Portlets/VolumeList.tpl b/gui/baculum/protected/Portlets/VolumeList.tpl index 27e8209c58..0c0de85d4e 100644 --- a/gui/baculum/protected/Portlets/VolumeList.tpl +++ b/gui/baculum/protected/Portlets/VolumeList.tpl @@ -1,6 +1,12 @@ <%@ MasterClass="Application.Portlets.SlideWindow" %> + <%=(isset($this->DataItem->pool->name) && $this->getPage()->VolumeWindow->oldPool != $this->DataItem->pool->name) ? '
Pool: ' . $this->DataItem->pool->name . '
': ''%> @@ -10,20 +16,14 @@ - ConfigurationWindow<%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>.progress(false); + volumeConfigurationWindow.show(); + volumeConfigurationWindow.progress(false); <%=!(isset($this->DataItem->pool->name) ? ($this->getPage()->VolumeWindow->oldPool = $this->DataItem->pool->name) : false)%> @@ -46,20 +46,14 @@ <%=$this->getParent()->Data['volumename']%> - ConfigurationWindow<%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>.show(); - ConfigurationWindow<%=$this->getPage()->VolumeConfiguration->getMaster()->ClientID%>.progress(false); + volumeConfigurationWindow.show(); + volumeConfigurationWindow.progress(false);
<%[ Limit: ]%><%[ Limit: ]%>
<%[ Search: ]%>