Bug 20568: Fix bad resolution conflict with bug 18403
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / authorities-toolbar.inc
index d734a0d..b42074a 100644 (file)
@@ -1,46 +1,47 @@
-<div id="toolbar">
-<script type="text/javascript">
-       //<![CDATA[
+[% INCLUDE 'blocking_errors.inc' %]
+[% IF ( authid || CAN_user_editauthorities) %]
 
-       // prepare DOM for YUI Toolbar
+<div id="toolbar" class="btn-toolbar">
 
-        $(document).ready(function() {
-           $("#newmenuc").empty();
-           yuiToolbar();
-        });
+[% IF ( authid ) %]
+    [% IF ( CAN_user_editauthorities ) %]
+        <div class="btn-group"><a class="btn btn-default btn-sm" id="editAuth" href="authorities.pl?authid=[% authid %]"><i class="fa fa-pencil"></i> Edit</a></div>
+        <div class="btn-group"><a class="btn btn-default btn-sm" id="dupAuth" href="authorities.pl?authid=[% authid %]&amp;op=duplicate"><i class="fa fa-copy"></i> Duplicate</a></div>
+        [% UNLESS ( count ) %]
+            <div class="btn-group"><a href="#" class="btn btn-default btn-sm" id="delAuth"><i class="fa fa-trash"></i> Delete</a></div>
+        [% END %]
+    [% END %]
 
-       // YUI Toolbar Functions
+    <div class="btn-group">
+        <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-download"></i> Save
+        <span class="caret"></span>
+        </a>
+        <ul class="dropdown-menu">
+            <li><a href="/cgi-bin/koha/authorities/export.pl?format=mads&amp;op=export&amp;authid=[% authid %]">MADS (XML)</a></li>
+            <li><a href="/cgi-bin/koha/authorities/export.pl?format=marcxml&amp;op=export&amp;authid=[% authid %]">MARCXML</a></li>
+            <li><a href="/cgi-bin/koha/authorities/export.pl?format=marc8&amp;op=export&amp;authid=[% authid %]">MARC (non-Unicode/MARC-8)</a></li>
+            <li><a href="/cgi-bin/koha/authorities/export.pl?format=utf8&amp;op=export&amp;authid=[% authid %]">MARC (Unicode/UTF-8)</a></li>
+        </ul>
+    </div>
+[% END %]
 
-       function yuiToolbar() {   
-       
-               var newmenu = [
-                       <!-- TMPL_LOOP name="authtypesloop" -->{ text: "<!-- TMPL_VAR name="authtypetext" -->", url: "/cgi-bin/koha/authorities/authorities.pl?authtypecode=<!-- TMPL_VAR name="value" -->"},
-<!-- /TMPL_LOOP -->
-               ]
-
-           new YAHOO.widget.Button({
-               type: "menu",
-               label: _("New Authority"),
-               name: "newmenubutton",
-               menu: newmenu,
-               container: "newmenuc"
-           });  
-       }
-
-       //]]>
-       </script>
-  <form name="f2" method="post" action="authorities.pl">       
-  <span id="newmenuc">
-       <label for="add_authtypecode">New: </label>
-        <select id="add_authtypecode" name="authtypecode">
-<!-- TMPL_LOOP name="authtypesloop" -->
-  <!-- TMPL_IF name="selected" -->
-        <option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="authtypetext" --></option>
-  <!-- TMPL_ELSE -->
-        <option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="authtypetext" --></option>
-  <!-- /TMPL_IF -->
-<!-- /TMPL_LOOP -->
-        </select>
-      <input type="submit" value="Add" class="button" />
-  </span></form>
+[% IF ( CAN_user_editauthorities ) %]
+    <div class="btn-group">
+        <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-plus"></i> New authority
+        <span class="caret"></span>
+        </a>
+        <ul class="dropdown-menu">
+            [% FOREACH authority_type IN authority_types %]
+                <li><a href="/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authority_type.authtypecode %]">[% authority_type.authtypetext %]</a></li>
+            [% END %]
+        </ul>
+    </div>
+    [% IF servers.count > 0 %]
+        <div class="btn-group">
+            <a class="btn btn-default btn-sm" id="z3950submit" href="#"><i class="fa fa-search"></i> New from Z39.50</a>
+        </div>
+    [% END %]
+[% END %]
 </div>
+
+[% END %]