From 4d7bd6a60a56366120295c488d0e551203215568 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 12 Jan 2021 23:42:27 +0000 Subject: [PATCH] Bug 27321: Make disabled DB columns clearly disabled visually To test: 1. Apply patch and its dependency (bug 17364) 2. Rebuild the CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client) 3. Go the system pref BorroweUnwantedFields 4. branchcode should cleary stand out as disabled (#cccccc) --- koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss | 5 +++++ koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 6d03d1a310..13b86436e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -3305,6 +3305,11 @@ label { display: block; margin: .5em 0; } + + &.disabled { + color: #CCC; + cursor: not-allowed; + } } .radio { diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js index c25854b619..e7d8dad01a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -233,6 +233,7 @@ $( document ).ready( function () { $.getJSON( themelang + "/modules/admin/preferences/" + datasource + ".json", function( data ){ var items = []; var checked = ""; + var style = ""; $.each( data, function( key, val ){ if( prefs.indexOf( val ) >= 0 ){ checked = ' checked="checked" '; @@ -240,12 +241,14 @@ $( document ).ready( function () { checked = ""; } if( exclusions.indexOf( val ) >= 0 ){ + style = "disabled"; disabled = ' disabled="disabled" '; checked = ""; } else { + style = ""; disabled = ""; } - items.push(''); + items.push(''); }); $("
", { "class": "columns-2", -- 2.11.0