From c7ba9148610582fb772cf4e2cc7e35227e1aac8f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 25 Oct 2021 18:55:53 +0000 Subject: [PATCH] Bug 29265: Add option to pick editor when creating a new content entry This patch changes the "New entry" button on the additional contents page to be a split button which offers the alternative of the non-default editor (as defined by AdditionalContentsEditor). Also changed: I moved some of the template logic around to consolidate handling of the editor variables. To test, apply the patch and go to Tools -> HTML customizations. - At the top of the page there should be a split button. The dropdown option should offer the non-default editor. - If AdditionalContentsEditor is set to "text editor," clicking the "main" part of the button should take you to an entry page which uses the text editor. - The dropdown part of the button should say "New entry using WYSIWYG editor." - Switch the AdditionalContentsEditor preference and confirm that the button reflects the change. - Confirm that the individual "Edit" buttons for each existing content entry still works correctly according to the system preference. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- .../en/modules/tools/additional-contents.tt | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt index 8f43afc707..589b8c3ce5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -7,7 +7,10 @@ [% INCLUDE 'doc-head-open.inc' %] Additional contents › Tools › Koha [% INCLUDE 'doc-head-close.inc' %] -[% UNLESS ( wysiwyg ) %] +[% IF ( wysiwyg ) %] + [% SET editmode = "wysiwyg" %] +[% ELSE %] + [% SET editmode = "text" %] [% Asset.css("lib/codemirror/codemirror.css") | $raw %] [% Asset.css("lib/codemirror/lint.min.css") | $raw %]