From e2327ec12f95020a66ba997d90041a5c0a4a5214 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Fri, 1 Feb 2013 19:31:44 -0500
Subject: [PATCH] [SIGNED-OFF] Bug 9636 - Replace YUI buttons on labels pages
 with Bootstrap

This patch converts the toolbar include file used by the label manager
to Bootstrap, replacing YUI button and menu code with Bootstrap markup.

This patch converts the previous menu buttons to plain buttons,
removing the redundant links to the manage pages, which are in the
left-hand sidebar. This keeps toolbar buttons within the general
category of "action" (as opposed to "view").

This patch also removes an unused include file, labels-new-toolbar.inc

To test, view the labels home page and any of the label manage pages
(layouts, templates, profiles, batches). Buttons should look correct
and work correctly.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Work as described. No errors.
Nicole is not going to be happy, images in Label creator section
of manual needs to change :)
---
 .../prog/en/includes/labels-new-toolbar.inc        |   23 -----
 .../prog/en/includes/labels-toolbar.inc            |   92 ++++----------------
 2 files changed, 17 insertions(+), 98 deletions(-)
 delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/labels-new-toolbar.inc

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-new-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-new-toolbar.inc
deleted file mode 100644
index 2f75b27..0000000
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-new-toolbar.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-<script type="text/javascript">
-    //<![CDATA[
-    // prepare DOM for YUI Toolbar
-     $(document).ready(function() {
-        yuiToolbar();
-     });
-    // YUI Toolbar Functions
-    function yuiToolbar() {
-        new YAHOO.widget.Button("newlabel");
-        new YAHOO.widget.Button("newtemplate");
-        new YAHOO.widget.Button("newprofile");
-        new YAHOO.widget.Button("newbatch");
-    }
-    //]]>
-</script>
-<div id="toolbar">
-    <ul class="toolbar">
-        <li><a id="newlabel" href="/cgi-bin/koha/labels/label-edit-layout.pl?op=new">New layout</a></li>
-        <li><a id="newtemplate" href="/cgi-bin/koha/labels/label-edit-template.pl?op=new">New template</a></li>
-        <li><a id="newprofile" href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">New profile</a></li>
-        <li><a id="newbatch" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=new">New batch</a></li>
-    </ul>
-</div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc
index 4de8007..06850f9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/labels-toolbar.inc
@@ -1,75 +1,17 @@
-<script type="text/javascript">
-    //<![CDATA[
-    // prepare DOM for YUI Toolbar
-    $(document).ready(function() {
-        $("#layoutsc").empty();
-        $("#templatesc").empty();
-        $("#profilesc").empty();
-        $("#batches").empty();
-        yuiToolbar();
-     });
-
-    // YUI Toolbar Functions
-    function yuiToolbar() {
-        var layouts = [
-                {text: _("Manage layouts"), url: "/cgi-bin/koha/labels/label-manage.pl?label_element=layout" },
-                {text: _("New layout"), url: "/cgi-bin/koha/labels/label-edit-layout.pl?op=new" }
-        ];
-
-        var templates = [
-                {text: _("Manage templates"), url: "/cgi-bin/koha/labels/label-manage.pl?label_element=template" },
-                {text: _("New template"), url: "/cgi-bin/koha/labels/label-edit-template.pl?op=new" }
-        ];
-
-        var profiles = [
-                {text: _("Manage profiles"), url: "/cgi-bin/koha/labels/label-manage.pl?label_element=profile" },
-                {text: _("New profile"), url: "/cgi-bin/koha/labels/label-edit-profile.pl?op=new" }
-        ];
-
-        var batches = [
-                {text: _("Manage batches"), url: "/cgi-bin/koha/labels/label-manage.pl?label_element=batch" },
-                {text: _("New batch"), url: "/cgi-bin/koha/labels/label-edit-batch.pl?op=new" }
-        ];
-
-        new YAHOO.widget.Button({
-            type: "menu",
-            label: _("Layouts"),
-            name: "layouts",
-            menu: layouts,
-            container: "layoutsc"
-        });
-
-        new YAHOO.widget.Button({
-            type: "menu",
-            label: _("Templates"),
-            name: "templates",
-            menu: templates,
-            container: "templatesc"
-        });
-
-        new YAHOO.widget.Button({
-            type: "menu",
-            label: _("Profiles"),
-            name: "profiles",
-            menu: profiles,
-            container: "profilesc"
-        });
-
-        new YAHOO.widget.Button({
-            type: "menu",
-            label: _("Batches"),
-            name: "batches",
-            menu: batches,
-            container: "batchesc"
-        });
-    }
-//]]>
-</script>
-<div id="toolbar">
-    <ul class="toolbar">
-        <li id="layoutsc"><a id="layouts" href="#">Layouts</a></li>
-        <li id="templatesc"><a id="templates" href="#">Templates</a></li>
-        <li id="profilesc"><a id="profiles" href="#">Profiles</a></li>
-        <li id="batchesc"><a id="batches" href="#">Batches</a></li>
-    </ul>
-</div>
+<div id="toolbar" class="btn-toolbar">
+    <div class="btn-group">
+        <a class="btn btn-small" href="/cgi-bin/koha/labels/label-edit-layout.pl?op=new">New layout</a>
+    </div>
+
+    <div class="btn-group">
+            <a class="btn btn-small" href="/cgi-bin/koha/labels/label-edit-template.pl?op=new">New template</a>
+    </div>
+
+    <div class="btn-group">
+        <a class="btn btn-small" href="/cgi-bin/koha/labels/label-edit-profile.pl?op=new">New profile</a>
+    </div>
+
+    <div class="btn-group">
+        <a class="btn btn-small" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=new">New batch</a>
+    </div>
+</div>
\ No newline at end of file
-- 
1.7.9.5