From eded25f1cf35684b55544a6ab35cdf5763c43f59 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 30 Jul 2020 12:38:22 +0000 Subject: [PATCH] Bug 26431: Use split button to offer choice of WYSIWYG or code editor for news This patch modifies the news interface so that the user is offered a choice of editing news items using the default editor as defined by the NewsToolEditor system preference or the non-default one. To test, apply the patch and go to Tools -> News. - In the list of news items you should see an "Edit" split button in each row. - Clicking the "Edit" part of the button should open the edit view with the correct editor as defined by the NewsToolEditor preference. - Clicking the menu arrow on the button should offer the other editing method: - If NewsToolEditor is set to "WYSIWYG," the menu should offer "text editor." - If NewsToolEditor is set to "text editor," the menu should offer "WYSIWYG editor." - Test the button with the NewsToolEditor preference set to both options and confirm that the button and menu work correctly. --- .../prog/en/modules/tools/koha-news.tt | 28 ++++++++++++++++++---- tools/koha-news.pl | 11 ++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index c37983b0d2..c210a5b707 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -9,7 +9,7 @@ [% INCLUDE 'doc-head-close.inc' %] [% IF ( opac_news_count ) %] [% END %] -[% IF Koha.Preference('NewsToolEditor') == 'codemirror' %] +[% UNLESS ( wysiwyg ) %] [% Asset.css("lib/codemirror/codemirror.css") | $raw %] [% Asset.css("lib/codemirror/lint.min.css") | $raw %]