Bug 15932: Moving Authorities actions into a drop-down menu
authorAleisha <aleishaamohia@hotmail.com>
Tue, 1 Mar 2016 22:09:59 +0000 (22:09 +0000)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 24 Mar 2016 17:26:51 +0000 (17:26 +0000)
Edit: Removed datatables stuff and fixed merge conflict
Edit: Removed code from Comment 9 (no it wasn't intentional)
Edit: Putting <tr> line back

To test:
1) Go to Authorities and do an authority search (authorities-home.pl)
2) Confirm that the options (Edit, Merge, Delete) are there and behave
   as expected.
EDIT: 3) Click Delete then Cancel, confirm page does not scroll to the top

Sponsored-by: Catalyst IT
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt

index 18cea64..739d033 100644 (file)
@@ -2,8 +2,9 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Authorities &rsaquo; Authority search results</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" >
+<script type="text/javascript">
 //<![CDATA[
+
 function confirm_deletion(id) {
     var is_confirmed = confirm(_("Are you sure you want to delete this authority?"));
     if (is_confirmed) {
@@ -21,6 +22,7 @@ function confirm_deletion(id) {
           + "&resultsperpage=[% resultsperpage %]";
     }
 }
+
 function Help() {
     newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
 }
@@ -34,7 +36,6 @@ function searchauthority() {
     Y = document.forms[0].value.value;
     window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
 }
-
 //]]>
 </script>
 [% INCLUDE 'authorities_js.inc' %]
@@ -64,35 +65,41 @@ function searchauthority() {
 
 <div id="authorities_searchresultlist_results">
   <table>
-    <tr>
-      <th colspan="2">Summary</th>
-[% UNLESS ( isEDITORS ) %]
-      <th>Used in</th>
-[% END %]
-    [% IF ( CAN_user_editauthorities ) %]
-      <th>&nbsp;</th>
-    [% END %]
-    </tr>
-[% FOREACH resul IN result %]
+      <tr>
+        <th colspan="2">Summary</th>
+        [% UNLESS ( isEDITORS ) %]
+          <th>Used in</th>
+        [% END %]
+        [% IF ( CAN_user_editauthorities ) %]
+          <th>&nbsp;</th>
+        [% END %]
+      </tr>
+    [% FOREACH resul IN result %]
     <tr data-authid="[% resul.authid %]">
       <td>[% PROCESS authresult summary=resul.summary %]</td>
       <td><a href="detail.pl?authid=[% resul.authid %]">Details</a></td>
-  [% UNLESS ( resul.isEDITORS ) %]
+    [% UNLESS ( resul.isEDITORS ) %]
       <td>
         <a href="../catalogue/search.pl?type=intranet&amp;op=do_search&amp;idx=an,phr&amp;q=[% resul.authid %]" class="button">[% resul.used %] records(s)</a>
       </td>
-  [% END %]
-      [% IF ( CAN_user_editauthorities ) %]
-          <td>
-              <a href="/cgi-bin/koha/authorities/authorities.pl?authid=[% resul.authid %]">Edit</a>
-              | <a class="merge_auth" href="#merge">Merge</a>
-              [% UNLESS ( resul.used ) %]
-                   | <a href="javascript:confirm_deletion([% resul.authid %])">Delete</a>
-              [% END %]
-          </td>
-      [% END %]
+    [% END %]
+    [% IF ( CAN_user_editauthorities ) %]
+      <td>
+      <div class="dropdown">
+        <a class="btn btn-mini dropdown-toggle" id="authactions[% resul.authid %]" role="button" data-toggle="dropdown" href="#">
+        Actions <b class="caret"></b></a>
+        <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authactions[% resul.authid %]">
+          <li><a href="/cgi-bin/koha/authorities/authorities.pl?authid=[% resul.authid %]"><i class="fa fa-pencil"></i> Edit</a></li>
+          <li><a class="merge_auth" href="#merge"><i class="fa fa-compress"></i> Merge</a></li>
+          [% UNLESS ( resul.used ) %]
+            <li><a onclick='return confirm_deletion("[% resul.authid %]")'><i class="fa fa-trash"></i> Delete</a></li>
+          [% END %]
+        </ul>
+      </div>
+      </td>
+    [% END %]
     </tr>
-[% END %]
+    [% END %]
   </table>
 </div>