[Koha-patches] [PATCH] Bug 8664 - Add floating toolbar with save button to system preferences editor

Owen Leonard oleonard at myacpl.org
Thu Oct 25 20:13:48 CEST 2012


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.
---
 .../intranet-tmpl/prog/en/css/preferences.css      |    4 ++++
 .../prog/en/modules/admin/preferences.tt           |    5 +++++
 2 files changed, 9 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css
index 262fe11..c58e9a5 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css
+++ b/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css
@@ -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
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
index 9591003..823a825 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt
@@ -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 %]" />
 
-- 
1.7.9.5


More information about the Koha-patches mailing list