From 9f8f455ad638876ac87e7c76220ecf9a059c5cbe Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 8 Apr 2019 16:25:06 +0000 Subject: [PATCH] Bug 15326: (follow-up) Redindent new CMS page templates This patch is an opinionated reindent of new and changed templates related to the CMS feature. I think it would be nice for these templates to start out with good indentation. To test, apply the patch and test the CMS feature. There should be no visible change to the way it looks or the way it works. --- .../prog/en/modules/tools/cmspages.tt | 700 ++++++++++++--------- .../prog/en/modules/tools/tools-home.tt | 10 +- .../bootstrap/en/includes/html_helpers.inc | 22 +- .../bootstrap/en/modules/opac-cmspages.tt | 39 +- 4 files changed, 447 insertions(+), 324 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt index 32898d6354..af195e2a04 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt @@ -11,317 +11,427 @@ [% Asset.css("css/datatables.css") %] -[% INCLUDE 'header.inc' %] -[% INCLUDE 'cat-search.inc' %] - + [% INCLUDE 'header.inc' %] + [% INCLUDE 'cat-search.inc' %] + -[% IF ( form ) %]
[% ELSE %]
[% END %] -
-
-
-[% UNLESS ( link_opac_base && link_self) %] -
- [% UNLESS ( link_opac_base ) %] - Warning: Preference OPACBaseURL not set, some links might not work!
- [% END %] - [% UNLESS ( link_self ) %] - Warning: Variable link_self not set, some links might not work!
- [% END %] -[% END %] -[% UNLESS ( form || view ) %] - -[% END %] -[% IF ( failed_add ) %] -
- Failed to add page. Check that: -
    -
  • Your link title is unique
  • -
  • If specifying a parent page, the location is the same as your new page
  • -
-
-[% END %] -[% IF ( view ) %] -
-
- [% IF ( pages ) %] -
- -

Pages

- [% INCLUDE 'cms-pages-nav.inc' %] -
- [% END %] -
-
-

Pages: [% cms_page.title %]

-[% IF ( cms_page.publish == 1 ) %] - [% cms_page.content %] -[% ELSE %] -
This page has not been published.
- [% cms_page.content %] -[% END %] -
-
-[% ELSIF ( form ) %] -
- - -
- Page -
    -
  1. - - -
  2. -
  3. - - -
  4. -
  5. - - -
  6. -
  7. - - -
  8. -
  9. - - Required -
  10. -
  11. - - -
  12. -
  13. - - [% IF ( data.sortorder ) %][% ELSE %][% END %] -
  14. -
  15. - - [% IF ( data.publish ) %][% ELSE %][% END %] -
  16. -
  17. - -
  18. -
-
-
Cancel
-
+ [% IF ( form ) %] +
[% ELSE %] +
+ [% END %] -

Pages

-
-
- - +
+
+
+ [% UNLESS ( link_opac_base && link_self) %] +
+ [% UNLESS ( link_opac_base ) %] + Warning: Preference OPACBaseURL not set, some links might not work!
+ [% END %] + [% UNLESS ( link_self ) %] + Warning: Variable link_self not set, some links might not work!
+ [% END %] + [% END %] - - - - - - - -
- [% IF ( page_list.size ) %] -
- - - - - - - - - - - - - - [% FOREACH page IN page_list %] - - - - - - - - - - - - - [% END %] -
 PublishedParentInterfaceLibraryLanguageNumberLink titlePage title 
[% IF ( page.publish ) %]Yes[% ELSE %]No[% END %][% page.parent.title_link %][% SWITCH page.location %] - [% CASE "" %] - All - [% CASE "1" %] - Staff interface - [% CASE "2" %] - OPAC + + [% IF ( view ) %] +
+
+ [% IF ( pages ) %] +
+ +

Pages

+ [% INCLUDE 'cms-pages-nav.inc' %] +
+ [% END %] +
+
+

Pages: [% cms_page.title %]

+ [% IF ( cms_page.publish == 1 ) %] + [% cms_page.content %] + [% ELSE %] +
This page has not been published.
+ [% cms_page.content %] + [% END %] +
+
+ [% ELSIF ( form ) %] + + + +
+ Page +
    +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + +
  6. +
  7. + + +
  8. +
  9. + + + Required +
  10. +
  11. + + +
  12. +
  13. + + [% IF ( data.sortorder ) %] + + [% ELSE %] + + [% END %] +
  14. +
  15. + + [% IF ( data.publish ) %] + + [% ELSE %] + + [% END %] +
  16. +
  17. + + +
  18. +
+
+
+ + Cancel +
+ + + [% ELSE # IF view / form %] + +

Pages

+
+
+ +
[% IF ( page.branchcode == "" ) %]All[% ELSE %][% page.branchcode.branchname %][% END %][% IF ( page.lang == "" ) %]All[% ELSE %] - [% FOREACH lang IN lang_list %] - [% IF ( lang.rfc4646_subtag == page.lang ) %][% lang.native_description %] ([% lang.rfc4646_subtag %])[% END %] + [% IF ( disp == "1" ) %] + + [% ELSE %] + [% END %] - [% END %][% page.sortorder %][% page.title_link %][% page.title %] -
- - Actions - -
-
- -
- Select all | Clear all  - -
- - [% ELSE %] -
No pages exist. Create a new page?
+ [% IF ( disp == "2" ) %] + + [% ELSE %] + + [% END %] + + + + + + + + + + +
+ + [% IF ( page_list.size ) %] +
+ + + + + + + + + + + + + + + + + [% FOREACH page IN page_list %] + + + + + + + + + + + + + [% END %] + +
 PublishedParentInterfaceLibraryLanguageNumberLink titlePage title 
+ [% IF ( page.publish ) %] + Yes + [% ELSE %] + No + [% END %] + [% page.parent.title_link %] + [% SWITCH page.location %] + [% CASE "" %] + All + [% CASE "1" %] + Staff interface + [% CASE "2" %] + OPAC + [% END %] + + [% IF ( page.branchcode == "" ) %] + All + [% ELSE %] + [% page.branchcode.branchname %] + [% END %] + + [% IF ( page.lang == "" ) %] + All + [% ELSE %] + [% FOREACH lang IN lang_list %] + [% IF ( lang.rfc4646_subtag == page.lang ) %] + [% lang.native_description %] ([% lang.rfc4646_subtag %]) + [% END %] + [% END %] + [% END %] + [% page.sortorder %][% page.title_link %][% page.title %] +
+ + Actions + + +
+
+ +
+ Select all | Clear all  + +
+
+ [% ELSE %] +
+ No pages exist. Create a new page? +
+ [% END # IF page_list.size %] + [% END # IF view / form %] +
+
+ + [% UNLESS ( form ) %] +
+ [% INCLUDE 'tools-menu.inc' %] +
[% END %] - [% END %] -
-
-[% UNLESS ( form ) %] -
- [% INCLUDE 'tools-menu.inc' %]
-[% END %] -
+ [% MACRO jsinclude BLOCK %] -[% INCLUDE 'datatables.inc' %] -[% Asset.js("js/tools-menu.js") | $raw %] -[% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %] - -[% END %] + tinyMCE.baseURL = "[% interface %]/lib/tiny_mce"; + tinyMCE.init({ + mode : "textareas", + theme : "advanced", + convert_urls : false, + relative_urls : false, + content_css : "[% interface %]/[% theme %]/css/tinymce.css", + plugins : "table,save,advhr,advlink,searchreplace,print,contextmenu", + theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,search,replace,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,|,print", + theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap", + theme_advanced_buttons3 : "", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_path_location : "bottom", + theme_advanced_resizing : true, + plugin_insertdate_dateFormat : "%Y-%m-%d", + plugin_insertdate_timeFormat : "%H:%M:%S", + apply_source_formatting : true, + height : "300", + width : "700" + }); + //]]> + +[% END # jsinclude %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt index 06d3636b09..e1aa8d0ec9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -123,11 +123,11 @@ [% END %] [% IF ( CAN_user_tools_edit_pages ) %] -
Pages
-
Create and edit additional content pages
-
    - [% INCLUDE 'cms-pages-nav.inc' %] -
+
Pages
+
Create and edit additional content pages
+
    + [% INCLUDE 'cms-pages-nav.inc' %] +
[% END %] [% IF ( CAN_user_tools_schedule_tasks ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc index 7985a4d32a..e3644eb64b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc @@ -17,15 +17,23 @@ [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-cmspages.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-cmspages.tt index 2f9393adc1..f26036b666 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-cmspages.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-cmspages.tt @@ -13,7 +13,12 @@
  • Home
  • [% IF ( cms_page.parent ) %] [% FOREACH parent IN parents %] - [% IF parent.id == cms_page.parent %]
  • [% parent.title_link %]
  • [% END %] + [% IF parent.id == cms_page.parent %] +
  • + [% parent.title_link %] + +
  • + [% END %] [% END %] [% END %]
  • [% cms_page.title_link %]
  • @@ -30,27 +35,27 @@ [% END %]
    - [% IF ( OpacNav || OpacNavBottom ) %] -
    - - [% END %] - - [% IF ( OpacNav || OpacNavBottom ) %] -
    - [% ELSE %] -
    - [% END %] + [% END %] - [% IF ( cms_page.publish == 1 ) || ( cms_page.publish == 0 && CAN_user_tools_edit_pages ) %] - [% cms_page.content %] + [% IF ( OpacNav || OpacNavBottom ) %] +
    [% ELSE %] - This page has not been published. +
    [% END %] -
    + [% IF ( cms_page.publish == 1 ) || ( cms_page.publish == 0 && CAN_user_tools_edit_pages ) %] + [% cms_page.content %] + [% ELSE %] + This page has not been published. + [% END %] + +
    -- 2.11.0