Bug 8664 - Add floating toolbar with save button to system preferences editor
authorOwen Leonard <oleonard@myacpl.org>
Wed, 22 Aug 2012 12:48:38 +0000 (08:48 -0400)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 23 Nov 2012 17:12:37 +0000 (12:12 -0500)
This patch adds a copy of the "save" button in a toolbar at
the top of the system preferences editor. The toolbar becomes
fixed at the top of the page when you scroll down, exactly like
the toolbar on addbiblio.pl.

Because multiple save buttons might appear when the system prefs
page displays search results, the toolbar does not appear in
this case.

To test, open the system preferences editor and change a setting.
Try saving both with the button in the toolbar and the button at
the top of the page. Test scrolling to confirm that the toolbar
"sticks" to the top of the page when you scroll down.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/css/preferences.css
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt

index 262fe11..c58e9a5 100644 (file)
@@ -69,4 +69,8 @@ h3.collapsed {
 
 #yui-main {
        margin-bottom:2em;
+}
+#toolbar.floating {
+    box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.5);
+    border-radius: 0;
 }
\ No newline at end of file
index 9591003..823a825 100644 (file)
@@ -6,8 +6,12 @@
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/humanmsg.css" />
 <script src="[% themelang %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
 <script src="[% themelang %]/js/ajax.js" type="text/javascript"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
 <script type="text/javascript">
 //<![CDATA[
+    [% UNLESS ( searchfield ) %]$(document).ready(function(){
+            $('#toolbar').fixFloat();
+        });[% END %]
     // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
     var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
     var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
@@ -49,6 +53,7 @@
     <div class="prefs-tab">
     <h2>[% TAB.tab_title %] preferences</h2>
     <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
+        [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button></div>[% END %]
         <input type="hidden" name="op" value="save" />
         <input type="hidden" name="tab" value="[% TAB.tab %]" />