From: Marcin Haba Date: Fri, 8 Nov 2019 05:34:34 +0000 (+0100) Subject: baculum: Make resource config page buttons always available X-Git-Tag: Release-9.6.0~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=592c3aa73755fcff9e997c052020e8f136464007;p=thirdparty%2Fbacula.git baculum: Make resource config page buttons always available --- diff --git a/gui/baculum/protected/Web/JavaScript/bacula-config.js b/gui/baculum/protected/Web/JavaScript/bacula-config.js index 843136eb0..2d11294bd 100644 --- a/gui/baculum/protected/Web/JavaScript/bacula-config.js +++ b/gui/baculum/protected/Web/JavaScript/bacula-config.js @@ -50,6 +50,12 @@ var BaculaConfigClass = jQuery.klass({ var show = !child_container.is(':visible'); this.show_item(child_container, show); this.loader_stop(id); + /** + * This initialization has to be here because on Configure page buttons to save/cancel/delete + * resources are available after unfolding selected resource, not before. + * It means that without it these buttons are not adjusted well to the page. + */ + W3SideBar.init(); }, unset_config_items: function(id) { var child_container = this.get_child_container(id); diff --git a/gui/baculum/protected/Web/JavaScript/misc.js b/gui/baculum/protected/Web/JavaScript/misc.js index b9d2a30b4..61185d656 100644 --- a/gui/baculum/protected/Web/JavaScript/misc.js +++ b/gui/baculum/protected/Web/JavaScript/misc.js @@ -760,8 +760,10 @@ var Users = { var W3SideBar = { ids: { sidebar: 'sidebar', - overlay_bg: 'overlay_bg', - page_main: 'page_main' + overlay_bg: 'overlay_bg' + }, + css: { + page_main: '.page_main_el' }, cookies: { side_bar_hide: 'baculum_side_bar_hide' @@ -769,7 +771,7 @@ var W3SideBar = { init: function() { this.sidebar = document.getElementById(this.ids.sidebar); this.overlay_bg = document.getElementById(this.ids.overlay_bg); - this.page_main = document.getElementById(this.ids.page_main); + this.page_main = $(this.css.page_main); var hide = Cookies.get_cookie(this.cookies.side_bar_hide); if (hide == 1) { this.close(); @@ -780,19 +782,19 @@ var W3SideBar = { Cookies.set_cookie('baculum_side_bar_hide', 1); this.sidebar.style.display = 'none'; this.overlay_bg.style.display = 'none'; - this.page_main.style.marginLeft = 0; + this.page_main.css({'margin-left': '0', 'width': '100%'}); } else { Cookies.set_cookie('baculum_side_bar_hide', 0); this.sidebar.style.display = 'block'; this.overlay_bg.style.display = 'block'; - this.page_main.style.marginLeft = '300px'; + this.page_main.css({'margin-left': '300px', 'width': 'calc(100% - 300px)'}); } }, close: function() { Cookies.set_cookie('baculum_side_bar_hide', 1); this.sidebar.style.display = 'none'; this.overlay_bg.style.display = 'none'; - this.page_main.style.marginLeft = 0; + this.page_main.css({'margin-left': '0', 'width': '100%'}); } }; diff --git a/gui/baculum/protected/Web/Lang/en/messages.mo b/gui/baculum/protected/Web/Lang/en/messages.mo index 6087799c2..3a372d067 100644 Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/en/messages.po b/gui/baculum/protected/Web/Lang/en/messages.po index 4ed4b3f92..85492b272 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -1142,8 +1142,8 @@ msgstr "Remove" msgid "Edit" msgstr "Edit" -msgid "Show/hide all resource directives" -msgstr "Show/hide all resource directives" +msgid "Show/hide all directives" +msgstr "Show/hide all directives" msgid "Show the resource raw config" msgstr "Show the resource raw config" diff --git a/gui/baculum/protected/Web/Lang/ja/messages.mo b/gui/baculum/protected/Web/Lang/ja/messages.mo index f30f0f76d..486378f00 100644 Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/ja/messages.po b/gui/baculum/protected/Web/Lang/ja/messages.po index e9e76cbd4..454904e9d 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -1377,8 +1377,8 @@ msgstr "Baculum設定" msgid "Show the resource raw config" msgstr "Show the resource raw config" -msgid "Show/hide all resource directives" -msgstr "Show/hide all resource directives" +msgid "Show/hide all directives" +msgstr "Show/hide all directives" msgid "Size" msgstr "サイズ" diff --git a/gui/baculum/protected/Web/Lang/pl/messages.mo b/gui/baculum/protected/Web/Lang/pl/messages.mo index e80944ac6..a4da11e67 100644 Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/pl/messages.po b/gui/baculum/protected/Web/Lang/pl/messages.po index 8898217c5..fd14f8852 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -1152,8 +1152,8 @@ msgstr "Usuń" msgid "Edit" msgstr "Edytuj" -msgid "Show/hide all resource directives" -msgstr "Pokaż/ukryj wszystkie dyrektywy w zasobie" +msgid "Show/hide all directives" +msgstr "Pokaż/ukryj wszystkie dyrektywy" msgid "Show the resource raw config" msgstr "Pokaż surową konfigurację zasobu" diff --git a/gui/baculum/protected/Web/Lang/pt/messages.mo b/gui/baculum/protected/Web/Lang/pt/messages.mo index 148cd2642..6d7b8c57a 100644 Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/pt/messages.po b/gui/baculum/protected/Web/Lang/pt/messages.po index 2c634198e..82db2a6b6 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -1160,7 +1160,7 @@ msgstr "Remover" msgid "Edit" msgstr "Editar" -msgid "Show/hide all resource directives" +msgid "Show/hide all directives" msgstr "Mostrar/ocultar todas as diretivas de recursos" msgid "Show the resource raw config" diff --git a/gui/baculum/protected/Web/Layouts/Main.tpl b/gui/baculum/protected/Web/Layouts/Main.tpl index 821b7204d..9f58667b3 100644 --- a/gui/baculum/protected/Web/Layouts/Main.tpl +++ b/gui/baculum/protected/Web/Layouts/Main.tpl @@ -27,7 +27,7 @@ -
+
<%[ Running jobs: ]%> diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.tpl b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.tpl index 450170c4a..7429c98a1 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.tpl +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.tpl @@ -32,25 +32,25 @@
- - -  <%=Prado::localize('Remove resource')%> - -
+
+ + +  <%=Prado::localize('Remove resource')%> +  <%=$this->getLoadValues() ? Prado::localize('Save') : Prado::localize('Create')%> - $('.save_progress').show(); - $('.save_done').hide(); + $('.save_progress').css('visibility', 'visible'); + $('.save_done').css('visibility', 'hidden'); - $('.save_progress').hide(); - $('.save_done').show(); + $('.save_progress').css('visibility', 'hidden'); + $('.save_done').css('visibility', 'visible'); var err_el = '<%=$this->SaveDirectiveError->ClientID%>'; if (document.getElementById(err_el).style.display == 'none') { <%=$this->SaveDirectiveActionOk%> } - $('.save_progress').hide(); - $('.save_done').show(); + $('.save_progress').css('visibility', 'hidden'); + $('.save_done').css('visibility', 'visible'); - -  <%[ OK ]%> -  <%[ Error ]%> -
- + +
+  <%[ OK ]%> +  <%[ Error ]%> + +
diff --git a/gui/baculum/protected/Web/Portlets/DirectiveSetting.tpl b/gui/baculum/protected/Web/Portlets/DirectiveSetting.tpl index a489c64c2..9a5281f16 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSetting.tpl +++ b/gui/baculum/protected/Web/Portlets/DirectiveSetting.tpl @@ -1,5 +1,5 @@ - +