@@ -, +, @@
- Preview now shows side-by-side comparisons
- JavaScript has been movied out of template into separate file
- Validation of the add/edit form improved through use of validation
plugin
- Add a new notice.
- Confirm that the form can't be submitted without data in the "code"
and "name" fields.
- Confirm that the form can't be submitted without filling in at least
one message template (subject and body).
- Confirm that you cannot submit the form while using an
existing notice code.
- Follow Bug 17981's test plan for testing the preview function.
Confirm that the preview loads correctly and looks correct.
- Test both with old syntax messages which require conversion and
messages in template-toolkit syntax.
---
.../intranet-tmpl/prog/en/modules/tools/letter.tt | 224 ++-------------------
.../prog/en/modules/tools/preview_letter.tt | 56 ++++--
koha-tmpl/intranet-tmpl/prog/js/letter.js | 183 +++++++++++++++++
3 files changed, 238 insertions(+), 225 deletions(-)
create mode 100644 koha-tmpl/intranet-tmpl/prog/js/letter.js
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
@@ -6,6 +6,7 @@
Koha › Tools › Notices[% IF ( add_form or copy_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate or copy_validate) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %]
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.css("css/datatables.css") %]
+
@@ -446,213 +447,22 @@
[% INCLUDE 'datatables.inc' %]
[% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
[% Asset.js("lib/jquery/plugins/jquery.insertatcaret.js") %]
-
+
+ [% Asset.js("js/letter.js") %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/preview_letter.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/preview_letter.tt
@@ -29,27 +29,47 @@
[% END %]
[% IF rendered_message %]
-
-
-
+
+
+
Original version
+
+ [% FILTER html_line_break %]
+ [% original_content | html %]
+ [% END %]
+
+
+
+
Original message, rendered:
+
+ [% FILTER html_line_break %]
+ [% rendered_message.content | html %]
+ [% END %]
+
+
+
[% END %]
- [% IF rendered_tt_message %]
-
-
+ [% IF rendered_tt_message %]
+
+
+
+
Converted version
+
+ [% FILTER html_line_break %]
+ [% tt_content | html %]
+ [% END %]
+
+
+
+
Converted message, rendered:
+
+ [% FILTER html_line_break %]
+ [% rendered_tt_message.content | html %]
+ [% END %]
+
+
+
[% END %]
--- a/koha-tmpl/intranet-tmpl/prog/js/letter.js
+++ a/koha-tmpl/intranet-tmpl/prog/js/letter.js
@@ -0,0 +1,183 @@
+/* Variables defined in letter.tt: */
+/* global _ module add_form copy_form dataTablesDefaults no_op_set MSG_EMPTY_TITLE_AND_CONTENT MSG_EMPTY_TEMPLATES code MSG_CODE_EXISTS MSG_CODE_EXISTS_FOR_LIBRARY MSG_DT_LOADING_RECORDS interface theme */
+
+var modal_loading = "