Bug 31861: Table controls on checkouts table are buttons
authorOwen Leonard <oleonard@myacpl.org>
Wed, 19 Oct 2022 15:36:37 +0000 (15:36 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 24 Oct 2022 14:13:50 +0000 (11:13 -0300)
This patch updates the style of DataTables buttons (columns, export, and
configure), in cases where the buttons are the only control being
displayed (no page controls, filter, etc).

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Go to Circulation and check an item out to a patron.
- If necessary, click the "Show checkouts" button to reveal the table of
  checkouts.
- The "Columns," "Export," and "Configure" controls should look the same
  as they do in other situations, with no button-style border.
- Go to Circulation -> Check in and check in the item. The table of
  checked-in items should show the same style controls.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
koha-tmpl/intranet-tmpl/prog/js/checkouts.js

index 6bbb978..c630cd1 100644 (file)
@@ -548,72 +548,73 @@ tbody {
         }
     }
 
-    button,
-    div,
-    a {
-        &.dt-button {
-            background: transparent none;
-            border: 0;
-            color: #000;
-            font-size: 1em;
-            line-height: 1.7em;
-            margin: 3px 3px 0;
-            padding: 0 .5em;
-
-            &::before {
-                content: "";
-            }
+    input {
+        &[type="search"] {
+            border: 1px solid #CCC;
+        }
+    }
 
-            &.disabled {
-                color: #999;
-                cursor: default;
+    &:empty {
+        border: 0;
+        padding: 0;
+    }
+} /* /.pager */
 
-                a,
-                span {
-                    background: transparent none;
-                }
-            }
+button,
+div,
+a {
+    &.dt-button {
+        background: transparent none;
+        border: 0;
+        color: #000;
+        font-size: 1em;
+        line-height: 1.7em;
+        margin: 3px 3px 0;
+        padding: 0 .5em;
 
-            &:active,
-            &:focus {
-                background: transparent none;
-                border: 0;
-                box-shadow: none;
-                text-shadow: none;
+        &::before {
+            content: "";
+        }
 
-                &:not( .disabled ):hover:not( .disabled ) {
-                    background: transparent none;
-                    box-shadow: none;
-                }
-            }
+        &.disabled {
+            color: #999;
+            cursor: default;
 
-            &:hover {
+            a,
+            span {
                 background: transparent none;
-                border: 0;
-
-                &:not( .disabled ) {
-                    background: transparent none;
-                }
             }
+        }
+
+        &:active,
+        &:focus {
+            background: transparent none;
+            border: 0;
+            box-shadow: none;
+            text-shadow: none;
 
-            &.active:not( .disabled ):hover:not( .disabled ) {
+            &:not( .disabled ):hover:not( .disabled ) {
                 background: transparent none;
                 box-shadow: none;
             }
         }
-    }
 
-    input {
-        &[type="search"] {
-            border: 1px solid #CCC;
+        &:hover {
+            background: transparent none;
+            border: 0;
+
+            &:not( .disabled ) {
+                background: transparent none;
+                border: 0;
+            }
         }
-    }
 
-    &:empty {
-        border: 0;
-        padding: 0;
+        &.active:not( .disabled ):hover:not( .disabled ) {
+            background: transparent none;
+            box-shadow: none;
+        }
     }
-} /* /.pager */
+}
 
 .toptabs {
     .pager {
@@ -781,6 +782,7 @@ div {
     border-top: 1px solid #EEE;
     display: flex;
     flex-grow: 1;
+    justify-content: flex-end;
     margin-top: .5em;
     padding-top: .5em;
 }
index 744b440..6065db7 100644 (file)
                     "bPaginate":false,
                     "bInfo":false,
                     "bSort":false,
-                    "dom": 'B<"clearfix">t',
+                    "dom": '<"table_controls"B>rt',
                     }, table_settings);
 
             $("#exemptcheck").change(function () {
index 60afab6..50349e3 100644 (file)
@@ -276,7 +276,7 @@ $(document).ready(function() {
                 "sProcessing": msg_loading,
             },
             "bAutoWidth": false,
-            "dom": 'B<"clearfix">rt',
+            "dom": '<"table_controls"B>rt',
             "aoColumns": [
                 {
                     "mDataProp": function( oObj ) {
@@ -708,7 +708,7 @@ $(document).ready(function() {
         if ( ! relativesIssuesTable ) {
             relativesIssuesTable = KohaTable("relatives-issues-table", {
                 "bAutoWidth": false,
-                "dom": 'B<"clearfix">rt',
+                "dom": '<"table_controls"B>rt',
                 "aaSorting": [],
                 "aoColumns": [
                     {