From 814bb1cf41f4de6ac1b6a5f93f1a7b6413ff13ae 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) Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- 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 a46c61d051..e250462415 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -3324,6 +3324,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.39.5