]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Make resource config page buttons always available
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 8 Nov 2019 05:34:34 +0000 (06:34 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 14:59:53 +0000 (15:59 +0100)
14 files changed:
gui/baculum/protected/Web/JavaScript/bacula-config.js
gui/baculum/protected/Web/JavaScript/misc.js
gui/baculum/protected/Web/Lang/en/messages.mo
gui/baculum/protected/Web/Lang/en/messages.po
gui/baculum/protected/Web/Lang/ja/messages.mo
gui/baculum/protected/Web/Lang/ja/messages.po
gui/baculum/protected/Web/Lang/pl/messages.mo
gui/baculum/protected/Web/Lang/pl/messages.po
gui/baculum/protected/Web/Lang/pt/messages.mo
gui/baculum/protected/Web/Lang/pt/messages.po
gui/baculum/protected/Web/Layouts/Main.tpl
gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.tpl
gui/baculum/protected/Web/Portlets/DirectiveSetting.tpl
gui/baculum/themes/Baculum-v2/css/baculum.css

index 843136eb04df5764c3b0b3dd7817a0e990a35791..2d11294bdaf273e8ef9244c4d18bcc185ac974f9 100644 (file)
@@ -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);
index b9d2a30b4e367a993606904107680ebbc670fcda..61185d656dcc6e4a8add80b7a12e72c26e7fb4a4 100644 (file)
@@ -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%'});
        }
 };
 
index 6087799c24c9d0ac980f8af1415b85b93043a790..3a372d0679f817c8f629d6ad98ac5fef4b2e86a0 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ
index 4ed4b3f92ee98f9b085742cd53fb8ae04e5107e8..85492b2729f0cce134a8db4b329ca0a0bde6ef30 100644 (file)
@@ -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"
index f30f0f76d5baf52d0e63dfdf1ac285cbe61bf4ff..486378f00e742af182d508d2a5dc2375a384bee0 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ
index e9e76cbd4bd28476e9de3e42bbd88c620e59b721..454904e9dcdf7f69c42cb0ded35b21ac6c719c3f 100644 (file)
@@ -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 "サイズ"
index e80944ac63fa882b6ff1a215443820f550dfbebe..a4da11e6706d4449117704254dce4e98fac4b410 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ
index 8898217c52419ba8c45edc77295c8a4b84a9e501..fd14f885242d9f6dc8a92cc2e3325638551f3edf 100644 (file)
@@ -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"
index 148cd2642c9b6ee30aeab56ca64a6bf66563ea8f..6d7b8c57ab52103cf4d8d323727a9c8e853d7824 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ
index 2c634198eda1f3281da8edbd3ee1ae50e042affa..82db2a6b64083f427cc6407b9f7c1a2503e7d0b4 100644 (file)
@@ -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"
index 821b7204d20bcecb92e7c2bb68223c976438adf4..9f58667b342b78108090089f2bfddbe11870a64c 100644 (file)
@@ -27,7 +27,7 @@
                        </div>
                        <com:Application.Web.Portlets.MainSideBar />
                        <!-- !PAGE CONTENT! -->
-                       <div class="w3-main" id="page_main" style="margin-left:300px; margin-top:43px;">
+                       <div class="w3-main page_main_el" id="page_main" style="margin-left:300px; margin-top:43px;">
                                <span class="w3-tag w3-large w3-purple w3-right w3-padding-small w3-margin-top w3-margin-right">
                                        <i class="fa fa-cogs w3-large"></i> <%[ Running jobs: ]%> <span id="running_jobs"></span>
                                </span>
index 450170c4a57c29cbdf29a8bfa4deca2e53ee4be1..7429c98a1031c4f9e46690d7822a0509748f3481 100644 (file)
        </div>
 </div>
 <com:TActivePanel ID="ConfigDirectives">
-       <com:Application.Web.Portlets.DirectiveSetting
-               ID="DirectiveSetting"
-               Resource="<%=$this->getResource()%>"
-               OnLoadDirectives="loadDirectives"
-               Visible="<%=$this->LoadValues%>"
-       />
-       <com:TActiveLinkButton
-               CssClass="w3-button w3-green w3-margin-bottom"
-               Attributes.onclick="$(this).parent().prev('div.resource_remove_confirm').show();"
-               Visible="<%=$this->ShowRemoveButton && $this->LoadValues%>"
-       >
-               <prop:Text><i class="fa fa-trash-alt"></i> &nbsp;<%=Prado::localize('Remove resource')%></prop:Text>
-       </com:TActiveLinkButton>
        <com:TActiveRepeater
                ID="RepeaterDirectives"
                ItemRenderer="Application.Web.Portlets.DirectiveRenderer"
                >
        </com:TActiveRepeater>
-       <div class="w3-row w3-center">
+       <div class="w3-row w3-center w3-border bottom_buttons page_main_el" style="margin-left: 300px">
+               <com:Application.Web.Portlets.DirectiveSetting
+                       ID="DirectiveSetting"
+                       Resource="<%=$this->getResource()%>"
+                       OnLoadDirectives="loadDirectives"
+                       Visible="<%=$this->LoadValues%>"
+               />
+               <com:TActiveLinkButton
+                       CssClass="w3-button w3-red w3-right"
+                       Attributes.onclick="$(this).parent().parent().prev('div.resource_remove_confirm').show();"
+                       Visible="<%=$this->ShowRemoveButton && $this->LoadValues%>"
+               >
+                       <prop:Text><i class="fa fa-trash-alt"></i> &nbsp;<%=Prado::localize('Remove resource')%></prop:Text>
+               </com:TActiveLinkButton>
                <com:TActiveLinkButton
                        ID="Cancel"
                        CssClass="w3-button w3-red"
                                <i class="fa fa-save"></i> &nbsp;<%=$this->getLoadValues() ? Prado::localize('Save') : Prado::localize('Create')%>
                        </prop:Text>
                        <prop:ClientSide.OnLoading>
-                               $('.save_progress').show();
-                               $('.save_done').hide();
+                               $('.save_progress').css('visibility', 'visible');
+                               $('.save_done').css('visibility', 'hidden');
                        </prop:ClientSide.OnLoading>
                        <prop:ClientSide.OnComplete>
-                               $('.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%>
                                }
                        </prop:ClientSide.OnComplete>
                        <prop:ClientSide.OnFailure>
-                               $('.save_progress').hide();
-                               $('.save_done').show();
+                               $('.save_progress').css('visibility', 'hidden');
+                               $('.save_done').css('visibility', 'visible');
                        </prop:ClientSide.OnFailure>
                </com:TActiveLinkButton>
-               <i class="fa fa-sync-alt w3-spin save_progress" style="display: none"></i>
-               <com:TActiveLabel ID="SaveDirectiveOk" Display="None" CssClass="w3-text-green"><i class="fa fa-check save_done"></i> &nbsp;<%[ OK ]%></com:TActiveLabel>
-               <com:TActiveLabel ID="SaveDirectiveError" Display="None" CssClass="w3-text-red"><i class="fa fa-times-circle save_done"></i> &nbsp;<%[ Error ]%></com:TActiveLabel>
-               <br />
-               <com:TActiveLabel ID="SaveDirectiveErrMsg" Display="None" CssClass="w3-text-red" />
+               <span class="save_progress" style="width: 10px; visibility: hidden"><i class="fa fa-sync-alt w3-spin"></i></span>
+               <div class="save_done" style="display: inline-block; min-width: 70px;">
+                       <com:TActiveLabel ID="SaveDirectiveOk" Display="None" CssClass="w3-text-green"><i class="fa fa-check save_done"></i> &nbsp;<%[ OK ]%></com:TActiveLabel>
+                       <com:TActiveLabel ID="SaveDirectiveError" Display="None" CssClass="w3-text-red"><i class="fa fa-times-circle save_done"></i> &nbsp;<%[ Error ]%></com:TActiveLabel>
+                       <com:TActiveLabel ID="SaveDirectiveErrMsg" Display="None" CssClass="w3-text-red" />
+               </div>
        </div>
 </com:TActivePanel>
index a489c64c26e618d1d8e203e0d4b090a91e3c0229..9a5281f16f12e55a1858697a17b4b63c673c66b7 100644 (file)
@@ -1,5 +1,5 @@
 <com:TLabel ID="DirectiveOptions" CssClass="directive_setting">
-       <button type="button" class="w3-button w3-green w3-margin-bottom" rel="show_all_directives"><i class="fa fa-expand-arrows-alt"></i> &nbsp;<%[ Show/hide all resource directives ]%></button>
+       <button type="button" class="w3-button w3-green" rel="show_all_directives"><i class="fa fa-expand-arrows-alt"></i> &nbsp;<%[ Show/hide all directives ]%></button>
        <!--li rel="show_raw_config"><%[ Show the resource raw config ]%></li>
        <li rel="save_multiple_hosts"><%[ Save the resource on multiple hosts ]%></li>
        <li rel="save_addition_path"><%[ Save the resource to additional path ]%></li>
index 5e4fea3c7f94ceece55ebecbbd370f4e05145e56..074c50b3248c5f6249fc6d913f93b446cf08c4d5 100644 (file)
@@ -284,3 +284,17 @@ table.component td:nth-of-type(1) {
        vertical-align: sub;
        padding-top: 11px;
 }
+
+.bottom_buttons {
+       position: fixed;
+       bottom: 0;
+       left: 0;
+       padding: 5px 0;
+       min-height: 48px;
+       background-color: rgba(255, 255, 255, 0.5);
+       width: calc(100% - 300px);
+}
+
+.bottom_buttons a, .bottom_buttons button {
+       margin: 0 3px;
+}