Bugzilla – Attachment 126949 Details for
Bug 29265
Can't pick editor to use when adding new news or HTML customization entries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29265: Add option to pick editor when creating a new content entry
Bug-29265-Add-option-to-pick-editor-when-creating-.patch (text/plain), 4.13 KB, created by
David Nind
on 2021-10-27 05:34:49 UTC
(
hide
)
Description:
Bug 29265: Add option to pick editor when creating a new content entry
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-10-27 05:34:49 UTC
Size:
4.13 KB
patch
obsolete
>From 40501b5a7d4872113dc66a04ef159a34c2c31c4d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <david@davidnind.com> >--- > .../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' %] > <title>Additional contents › Tools › Koha</title> > [% 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 %] > <style> >@@ -282,7 +285,20 @@ > [% BLOCK list %] > > <div id="toolbar" class="btn-toolbar"> >- <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=[% category | html %]"><i class="fa fa-plus"></i> New entry</a> >+ <div class="btn-group"> >+ <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&editmode=[% editmode | uri %]" class="btn btn-default" id="newentry"> <i class="fa fa-plus"></i> New entry</a><button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> >+ <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu pull-right"> >+ <li> >+ [% IF ( wysiwyg ) %] >+ <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&editmode=text">New entry using text editor</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&editmode=wysiwyg">New entry using WYSIWYG editor</a> >+ [% END %] >+ </li> >+ </ul> >+ </div> > </div> > > <h2>Additional contents ([% IF category == 'news' %]News[% ELSE %]HTML customizations[% END %])</h2> >@@ -358,11 +374,6 @@ > </div> > </td> > <td class="actions"> >- [% IF ( wysiwyg ) %] >- [% SET editmode = "wysiwyg" %] >- [% ELSE %] >- [% SET editmode = "text" %] >- [% END %] > <div class="btn-group dropup"> > <a href="/cgi-bin/koha/tools/additional-contents.pl?op=add_form&id=[% c.idnew | uri %]&editmode=[% editmode | uri %]" class="btn btn-default btn-xs"> <i class="fa fa-pencil"></i> Edit</a><button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"> > <span class="caret"></span> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29265
:
126844
|
126949
|
127118
|
127355
|
127357