Bug 9645 - Replace YUI buttons on the quotes management page with Bootstrap
authorOwen Leonard <oleonard@myacpl.org>
Fri, 1 Feb 2013 21:10:14 +0000 (16:10 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Mon, 18 Feb 2013 14:09:57 +0000 (09:09 -0500)
This patch converts the toolbar include file used by the quotes editor
to Bootstrap, replacing YUI button and menu code with Bootstrap markup.

To test, view any page in the quotes editor. Buttons and menus should
look correct and work correctly. Test save, delete, and upload buttons
on the summary page, and save and delete buttons on the upload page.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: All buttons work. Tested add, delete and upload.
You are using icon-remove and not icon-remove-circle,
which I prefer but is different of Bug 9627.
Question: "Import quotes" takes you to "Quotes uploader",
would not it be more consistent to use "Upload quotes" or
"Quotes importer"?

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, no problems found.
I think the difference to 9627 is, that this really deletes
quotes, while the icon-remove-circle is used for closing subscriptions.
Closed subscriptions remain in the system, it's just a way to indicate
that there will be no new issues. There is a separate option to really
delete subscriptions.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/includes/quotes-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/quotes-upload-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt

index 7229fb5..9b8f37f 100644 (file)
@@ -1,47 +1,5 @@
-<script type="text/javascript">
-    //<![CDATA[
-    // prepare DOM for YUI Toolbar
-    $(document).ready(function() {
-        $("#add_quote").empty();
-        $("#delete_quote").empty();
-        $("#import_quotes").empty();
-        yuiToolbar();
-     });
-
-    // YUI Toolbar Functions
-    function yuiToolbar() {
-
-        new YAHOO.widget.Button({
-            type: "button",
-            label: _("Add quote"),
-            name: "add",
-            container: "add_quote",
-            onclick: {fn: fnClickAddRow}
-        });
-
-        new YAHOO.widget.Button({
-            type: "button",
-            label: _("Delete quote(s)"),
-            name: "delete",
-            container: "delete_quote",
-            onclick: {fn: fnClickDeleteRow}
-        });
-
-        new YAHOO.widget.Button({
-            type: "button",
-            label: _("Import quotes"),
-            name: "import",
-            container: "import_quotes",
-            onclick: {fn: function (){parent.location="quotes-upload.pl";}}
-        });
-    }
-
-//]]>
-</script>
-<div id="toolbar">
-    <ul class="toolbar">
-        <li id="add_quote"><a id="add" href="#">Add quote</a></li>
-        <li id="delete_quote"><a id="delete" href="#">Delete quote(s)</a></li>
-        <li id="import_quotes"><a id="import" href="#">Import quotes</a></li>
-    </ul>
-</div>
+<div id="toolbar" class="btn-toolbar">
+        <div class="btn-group"><a class="btn btn-small" id="add_quote" href="#"><i class="icon-plus"></i> Add quote</a></div>
+        <div class="btn-group"><a class="btn btn-small" id="delete_quote" href="#"><i class="icon-remove"></i> Delete quote(s)</a></div>
+        <div class="btn-group"><a class="btn btn-small" id="import_quotes" href="/cgi-bin/koha/tools/quotes-upload.pl"><i class="icon-folder-open"></i> Import quotes</a></div>
+</div>
\ No newline at end of file
index 6d10986..ef3fd3d 100644 (file)
@@ -1,41 +1,4 @@
-<script type="text/javascript">
-    var oSaveButton = '';
-    var oDeleteButton = '';
-    //<![CDATA[
-    // prepare DOM for YUI Toolbar
-    $(document).ready(function() {
-        $("#save_quotes").empty();
-        $("#delete_quote").empty();
-        yuiToolbar();
-     });
-
-    // YUI Toolbar Functions
-    function yuiGetData() {
-        fnGetData(document.getElementById('quotes_editor'));
-    }
-
-    function yuiToolbar() {
-
-        oSaveButton = new YAHOO.widget.Button({
-            type: "button",
-            label: _("Save quotes"),
-            name: "save",
-            container: "save_quotes",
-        });
-
-        oDeleteButton = new YAHOO.widget.Button({
-            type: "button",
-            label: _("Delete quote(s)"),
-            name: "delete",
-            container: "delete_quote",
-        });
-    }
-
-//]]>
-</script>
-<div id="toolbar" style="visibility: hidden; position: absolute">
-    <ul class="toolbar">
-        <li id="save_quotes"><a id="save" href="#">Save quotes</a></li>
-        <li id="delete_quote"><a id="delete" href="#">Delete quote(s)</a></li>
-    </ul>
-</div>
+<div id="toolbar" class="btn-toolbar" style="visibility: hidden; position: absolute">
+        <div class="btn-group"><a class="btn btn-small" id="save_quotes" href="#"><i class="icon-hdd"></i> Save quotes</a></div>
+        <div class="btn-group"><a class="btn btn-small" id="delete_quote" href="#"><i class="icon-remove"></i> Delete quote(s)</a></div>
+</div>
\ No newline at end of file
index 19833a6..2dc4af9 100644 (file)
     var progress = document.querySelector('.percent');
     $("#server_response").hide();
 
+    function yuiGetData() {
+        fnGetData(document.getElementById('quotes_editor'));
+    }
+
     function fnAbortRead() {
         reader.abort();
     }
         $('#file_uploader').css("position","absolute");
         $('#file_uploader').css("top","-150px");
         $('#quotes_editor').css("visibility","visible");
-        oSaveButton.on("click", yuiGetData);
-        oDeleteButton.on("click", fnClickDeleteRow);
+        $("#save_quotes").on("click", yuiGetData);
+        $("#delete_quote").on("click", fnClickDeleteRow);
 
 
 
index 7a838d0..493c34b 100644 (file)
                         });
                    },
         });
+        $("#add_quote").click(function(){
+            fnClickAddRow();
+            return false;
+        });
+        $("#delete_quote").click(function(){
+            fnClickDeleteRow();
+            return false;
+        });
     });
 
         function fnClickAddQuote(e, node) {