From 207bc5ae579da07517571eae1659d6e7d9b6a2b9 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 9 Dec 2019 17:49:22 +0000 Subject: [PATCH] Bug 20930: (follow-up) Improve formatting of error message This patch makes a few changes to system preferences JavaScript so that the error message for invalid YAML is output on one line. CSS has been modified to improve the readability of multiple error messages. The order of CSS files loaded by preferences.tt has been changed to ensure that CSS in preferences.css overrides plugin-related CSS. Unrelated: An incorrect ";" has been replaced with ":" in preferences.tt. To test, apply the patch and repeat the previous test plan. Confirm that the error messages appear as expected. Signed-off-by: Michal Denar --- koha-tmpl/intranet-tmpl/prog/css/preferences.css | 8 +++++++- koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js | 5 +++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/css/preferences.css index 7ecce1be4d..5fb9435d7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/preferences.css +++ b/koha-tmpl/intranet-tmpl/prog/css/preferences.css @@ -62,9 +62,15 @@ h3.collapsed { padding-left : 12px; } +.humanMsg { + font-size: 20px; + line-height: 30px; +} + .humanMsg strong { display: block; font-weight: normal; + margin-bottom: 1em; } #yui-main { @@ -134,4 +140,4 @@ span.overridden { border: 1px solid #EEE; margin: 1em 1em 1em 0; resize: vertical; -} \ No newline at end of file +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index 75fa80f42e..7b9d7e13ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -5,10 +5,10 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › System preferences [% INCLUDE 'doc-head-close.inc' %] -[% Asset.css("css/preferences.css") | $raw %] -[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %] [% Asset.css("css/humanmsg.css") | $raw %] [% Asset.css("lib/codemirror/codemirror.css") | $raw %] +[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %] +[% Asset.css("css/preferences.css") | $raw %] [% INCLUDE 'header.inc' %] @@ -207,7 +207,7 @@ var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section"); var MSG_INTERNAL_SERVER_ERROR = _( "Internal Server Error, please reload the page" ); var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" ); - var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" ); + var MSG_DATA_NOT_SAVED = _( "Error: your data might not have been saved" ); var MSG_LOADING = _( "Loading..." ); var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values"); var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:"); diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js index f1fd280089..05190b66d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js @@ -55,11 +55,12 @@ KOHA.Preferences = { modified_pref = modified_pref.replace("pref_",""); if (modified_pref in form.sysprefs) { if (form.sysprefs[modified_pref].error === 'Koha::Exceptions::Config::InvalidSyntax') { - msg += ""+ MSG_INVALID_SYNTAX.format(modified_pref) + "\n"; + msg += ""+ MSG_INVALID_SYNTAX.format(modified_pref) + ". "; var location = form.sysprefs[modified_pref].message.match(/line (\d+), column (\d+)/); if (typeof location !== 'undefined' && Array.isArray(location) && location.length===3) { - msg += ""+ MSG_INVALID_SYNTAX_LOCATION.format(location[1], location[2]) + "\n"; + msg += MSG_INVALID_SYNTAX_LOCATION.format(location[1], location[2]); } + msg += "\n"; } else { msg += ""+ form.type + "\n"; } -- 2.11.0