From 6efaeea69bc73ce0a1e7b6285d9c40147fbda98a Mon Sep 17 00:00:00 2001 From: Owen Leonard <oleonard@myacpl.org> Date: Fri, 10 Jan 2020 20:01:35 +0000 Subject: [PATCH] Bug 15326: (follow-up) Template tweaks This patch makes some tweaks to the staff-side template: - Fix some indentation - Add some markup comments - Fix some HTML validation errors: Eliminate duplicate id attributes - Expand the descriptiveness of <title>, breadcrumbs, and form legend - Increase size of link and title fields; Add maxlength attribute to title field. - Move title and link fields to the second column of the table -- more consistent with other tables where the main link is in the first column. - Link parent page information to corresponding edit page - Correct incorrectly filtered action links - Correct default table sort - Fix TinyMCE configuration - I copied some configuration code from another page which was updated more recently. To test, apply the patch and test the process of adding, editing, and deleting pages. Test all the options in the "Actions" menu. --- .../prog/en/modules/tools/cmspages.tt | 662 +++++++++++---------- 1 file changed, 338 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 8ed52c10db..b55627bf18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt @@ -6,7 +6,23 @@ [% SET link_opac_base = Koha.Preference( 'OPACBaseURL' ) %] [% SET link_opac = link_opac_base _ '/cgi-bin/koha/opac-cmspages.pl' %] [% INCLUDE 'doc-head-open.inc' %] -<title>Koha › Tools › Pages</title> +<title> + Koha › Tools › Pages + [% IF ( form ) %] + [% IF ( id ) %] + › Edit page [% data.title | html %] + [% ELSE %] + › Add page + [% END %] + [% ELSIF ( view ) %] + [% IF ( cms_page.parent ) %] + [% FOREACH parent IN parent_list %] + › [% IF parent.id == cms_page.parent %][% parent.title_link | uri %][% END %] + [% END %] + [% END %] + › [% cms_page.title_link | html %] + [% END %] +</title> [% INCLUDE 'doc-head-close.inc' %] </head> <body id="tools_koha-content" class="tools"> @@ -17,7 +33,7 @@ <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( form ) %] <a href="[% link_self | url %]">Pages</a> › - [% IF ( id ) %]Edit page[% ELSE %]Add page[% END %] + [% IF ( id ) %]Edit page <em>[% data.title | html %]</em>[% ELSE %]Add page[% END %] [% ELSIF ( view ) %] <a href="[% link_self | url %]">Pages</a> › [% IF ( cms_page.parent ) %] @@ -40,336 +56,342 @@ <div class="row"> <div class="col-sm-10 col-sm-push-2"> [% END %] - <main> - - [% UNLESS ( link_opac_base ) %] - <div class="dialog alert"> - [% UNLESS ( link_opac_base ) %] - Warning: Preference <em>OPACBaseURL</em> not set, some links might not work!</div> - [% END %] - [% END %] - - [% UNLESS ( form || view ) %] - <div id="toolbar" class="btn-toolbar"> - <a class="btn btn-default" id="newentry" href="[% link_self | url %]?op=form"><i class="fa fa-plus"></i> New page</a> - </div> - [% END %] + <main> - [% IF ( failed_add ) %] - <div class="dialog alert"> - Failed to add page. Check that: - <ul> - <li>Your link title is unique</li> - <li>If specifying a parent page, the location is the same as your new page</li> - </ul> - </div> - [% END %] + [% UNLESS ( link_opac_base ) %] + <div class="dialog alert"> + Warning: Preference <em>OPACBaseURL</em> not set. Some links might not work! + </div> + [% END %] - [% IF ( view ) %] - <div class="row"> - <div id="cms-page" class="col-sm-8"> - <h1>Pages: [% cms_page.title | html %]</h1> - [% IF ( cms_page.publish == 1 ) %] - [% cms_page.content | $raw %] - [% ELSE %] - <div class="dialog message">This page has not been published.</div> - [% cms_page.content | $raw %] + [% UNLESS ( form || view ) %] + <div id="toolbar" class="btn-toolbar"> + <a class="btn btn-default" id="newentry" href="[% link_self | url %]?op=form"><i class="fa fa-plus"></i> New page</a> + </div> [% END %] - </div> - <div id="cms-nav" class="col-sm-4"> - [% IF ( pages ) %] - <fieldset> + + [% IF ( failed_add ) %] + <div class="dialog alert"> + Failed to add page. Check that: <ul> - <li><a href="[% link_self | url %]">Pages home</a></li> + <li>Your link title is unique</li> + <li>If specifying a parent page, the location is the same as your new page</li> </ul> - <h4>Pages</h4> - [% INCLUDE 'cms-pages-nav.inc' %] - </fieldset> + </div> [% END %] - </div> - </div> - [% ELSIF ( form ) %] - <form name="form" method="post" enctype="multipart/form-data" action="[% link_self | url %]" > - <input type="hidden" name="op" value="[% op | html%]" /> - <input type="hidden" name="id" value="[% id | html %]" /> - <fieldset class="rows"> - <legend>Page</legend> - <ol> - <li> - <label for="disp">Interface:</label> - <select id="disp" name="disp"> - [% IF ( data.location == "" ) %] - <option value="" selected="selected">All</option> - [% ELSE %] - <option value="">All</option> - [% END %] - [% IF ( data.location == "1" ) %] - <option value="1" selected="selected">Staff interface</option> + + [% IF ( view ) %] + <div class="row"> + <div id="cms-page" class="col-sm-8"> + <h1>Pages: [% cms_page.title | html %]</h1> + [% IF ( cms_page.publish == 1 ) %] + [% cms_page.content | $raw %] [% ELSE %] - <option value="1">Staff interface</option> + <div class="dialog message">This page has not been published.</div> + [% cms_page.content | $raw %] [% END %] - [% IF ( data.location == "2" ) %] - <option value="2" selected="selected">OPAC</option> - [% ELSE %] - <option value="2">OPAC</option> + </div> <!-- /#cms-page --> + <div id="cms-nav" class="col-sm-4"> + [% IF ( pages ) %] + <fieldset> + <ul> + <li><a href="[% link_self | url %]">Pages home</a></li> + </ul> + <h4>Pages</h4> + [% INCLUDE 'cms-pages-nav.inc' %] + </fieldset> [% END %] - </select> - </li> - <li> - <label for="branch">Library:</label> - <select id="branch" name="branch"> - [% IF ( data.branchcode.branchcode == "" ) %] - <option value="" selected="selected">All libraries</option> + </div> <!-- /#cms-nav --> + </div> + [% ELSIF ( form ) %] + <form name="form" method="post" enctype="multipart/form-data" action="[% link_self | url %]" > + <input type="hidden" name="op" value="[% op | html%]" /> + <input type="hidden" name="id" value="[% id | html %]" /> + <fieldset class="rows"> + [% IF ( id ) %] + <legend>Edit page <em>[% data.title | html %]</em></legend> [% ELSE %] - <option value="">All libraries</option> + <legend>Add page</legend> [% END %] - [% FOREACH branch IN branch_list %] - [% IF ( branch.branchcode == data.branchcode.branchcode ) %] - <option value="[% branch.branchcode | html %]" selected="selected">[% branch.branchname | html %]</option> + <ol> + <li> + <label for="disp">Interface:</label> + <select id="disp" name="disp"> + [% IF ( data.location == "" ) %] + <option value="" selected="selected">All</option> + [% ELSE %] + <option value="">All</option> + [% END %] + [% IF ( data.location == "1" ) %] + <option value="1" selected="selected">Staff interface</option> + [% ELSE %] + <option value="1">Staff interface</option> + [% END %] + [% IF ( data.location == "2" ) %] + <option value="2" selected="selected">OPAC</option> + [% ELSE %] + <option value="2">OPAC</option> + [% END %] + </select> + </li> + <li> + <label for="branch">Library:</label> + <select id="branch" name="branch"> + [% IF ( data.branchcode.branchcode == "" ) %] + <option value="" selected="selected">All libraries</option> + [% ELSE %] + <option value="">All libraries</option> + [% END %] + [% FOREACH branch IN branch_list %] + [% IF ( branch.branchcode == data.branchcode.branchcode ) %] + <option value="[% branch.branchcode | html %]" selected="selected">[% branch.branchname | html %]</option> + [% ELSE %] + <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> + [% END %] + [% END %] + </select> + </li> + <li> + <label for="lang">Language:</label> + <select id="lang" name="lang"> + [% IF ( data.lang == "" ) %] + <option value="" selected="selected">All</option> + [% ELSE %] + <option value="">All</option> + [% END %] + [% FOREACH lang IN lang_list %] + [% IF ( lang.rfc4646_subtag == data.lang ) %] + <option value="[% lang.rfc4646_subtag | html %]" selected="selected">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option> + [% ELSE %] + <option value="[% lang.rfc4646_subtag | html %]">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option> + [% END %] + [% END %] + </select> + </li> + <li> + <label for="parent">Parent page: </label> + <select id="parent" name="parent"> + [% IF ( data.id == "" ) %] + <option value="" selected="selected">No parent</option> + [% ELSE %] + <option value="">No parent</option> + [% END %] + [% FOREACH parent IN parent_list %] + [% IF ( data.parent.id == parent.id ) %] + <option value="[% parent.id | html %]" selected="selected">[% parent.title_link | html %]</option> + [% ELSE %] + <option value="[% parent.id | html %]">[% parent.title_link | html %]</option> + [% END %] + [% END %] + </select> + </li> + <li> + <label for="title_link" class="required">Link title: </label> + <input id="title_link" size="64" maxlength="64" type="text" name="title_link" value="[% data.title_link | html %]" required="required" class="required" /> + <span class="required">Required</span> + </li> + <li> + <label for="title">Page title: </label> + <input id="title" size="64" maxlength="255" type="text" name="title" value="[% data.title | html %]" /> + </li> + <li> + <label for="number">Appear in position: </label> + [% IF ( data.sortorder ) %] + <input id="number" size="3" name="number" type="text" value="[% data.sortorder | html %]" /> + [% ELSE %] + <input id="number" size="3" name="number" type="text" value="0" /> + [% END %] + </li> + <li> + <label for="publish">Publish: </label> + [% IF ( data.publish ) %] + <input type="checkbox" id="publish" name="publish" checked="checked" /> + [% ELSE %] + <input type="checkbox" id="publish" name="publish" /> + [% END %] + </li> + <li> + <label for="content">Content: </label> + <textarea name="content" id="content" cols="75" rows="10">[% data.content | $raw %]</textarea> + </li> + </ol> + </fieldset> <!-- /.rows --> + <fieldset class="action"> + <input class="button" type="submit" value="Save" /> + <a class="cancel" href="[% link_self | url %]">Cancel</a> + </fieldset> + </form> + + [% ELSE # IF view / form %] + + <h1>Pages</h1> + <div style="margin-bottom:5px;"> + <form name="filter" method="post" action="[% link_self | url %]"> + <label for="disp">Display location:</label> + <select name="disp" id="disp"> + [% IF ( disp == "" ) %] + <option value="" selected="selected">All</option> [% ELSE %] - <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> + <option value="">All</option> [% END %] - [% END %] - </select> - </li> - <li> - <label for="lang">Language:</label> - <select id="lang" name="lang"> - [% IF ( data.lang == "" ) %] - <option value="" selected="selected">All</option> - [% ELSE %] - <option value="">All</option> - [% END %] - [% FOREACH lang IN lang_list %] - [% IF ( lang.rfc4646_subtag == data.lang ) %] - <option value="[% lang.rfc4646_subtag | html %]" selected="selected">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option> + [% IF ( disp == "1" ) %] + <option value="1" selected="selected">Staff interface</option> [% ELSE %] - <option value="[% lang.rfc4646_subtag | html %]">[% lang.native_description | html %] ([% lang.rfc4646_subtag | html %])</option> + <option value="1">Staff interface</option> [% END %] - [% END %] - </select> - </li> - <li> - <label for="parent">Parent page: </label> - <select id="parent" name="parent"> - [% IF ( data.id == "" ) %] - <option value="" selected="selected">No parent</option> - [% ELSE %] - <option value="">No parent</option> - [% END %] - [% FOREACH parent IN parent_list %] - [% IF ( data.parent.id == parent.id ) %] - <option value="[% parent.id | html %]" selected="selected">[% parent.title_link | html %]</option> + [% IF ( disp == "2" ) %] + <option value="2" selected="selected">OPAC</option> [% ELSE %] - <option value="[% parent.id | html %]">[% parent.title_link | html %]</option> + <option value="2">OPAC</option> [% END %] - [% END %] - </select> - </li> - <li> - <label for="title_link" class="required">Link title: </label> - <input id="title_link" size="30" type="text" name="title_link" value="[% data.title_link | html %]" required="required" class="required" /> - <span class="required">Required</span> - </li> - <li> - <label for="title">Page title: </label> - <input id="title" size="30" type="text" name="title" value="[% data.title | html %]" /> - </li> - <li> - <label for="number">Appear in position: </label> - [% IF ( data.sortorder ) %] - <input id="number" size="3" name="number" type="text" value="[% data.sortorder | html %]" /> - [% ELSE %] - <input id="number" size="3" name="number" type="text" value="0" /> - [% END %] - </li> - <li> - <label for="publish">Publish: </label> - [% IF ( data.publish ) %] - <input type="checkbox" id="publish" name="publish" checked="checked" /> - [% ELSE %] - <input type="checkbox" id="publish" name="publish" /> - [% END %] - </li> - <li> - <label for="content">Content: </label> - <textarea name="content" id="content" cols="75" rows="10">[% data.content | $raw %]</textarea> - </li> - </ol> - </fieldset> - <fieldset class="action"> - <input class="button" type="submit" value="Save" /> - <a class="cancel" href="[% link_self | url %]">Cancel</a> - </fieldset> - </form> - - [% ELSE # IF view / form %] + </select> - <h1>Pages</h1> - <div style="margin-bottom:5px;"> - <form name="filter" method="post" action="[% link_self | url %]"> - <label for="disp">Display location:</label> - <select name="disp" id="disp"> - [% IF ( disp == "" ) %] - <option value="" selected="selected">All</option> - [% ELSE %] - <option value="">All</option> - [% END %] - [% IF ( disp == "1" ) %] - <option value="1" selected="selected">Staff interface</option> - [% ELSE %] - <option value="1">Staff interface</option> - [% END %] - [% IF ( disp == "2" ) %] - <option value="2" selected="selected">OPAC</option> - [% ELSE %] - <option value="2">OPAC</option> - [% END %] - </select> - - <label for="branch">Library:</label> - <select id="branch" name="branch"> - [% IF ( branch == "" ) %] - <option value="" selected="selected">All libraries</option> - [% ELSE %] - <option value="">All libraries</option> - [% END %] - [% FOREACH br IN branch_list %] - [% IF ( br.branchcode == branch ) %] - <option value="[% br.branchcode | html %]" selected="selected">[% br.branchname | html %]</option> - [% ELSE %] - <option value="[% br.branchcode | html %]">[% br.branchname | html %]</option> - [% END %] - [% END %] - </select> - - <label for="lang">Language:</label> - <select name="lang" id="lang"> - [% IF ( lang == "" ) %] - <option value="" selected="selected">All</option> - [% ELSE %] - <option value="">All</option> - [% END %] - [% FOREACH language IN lang_list %] - [% IF ( language.rfc4646_subtag == lang ) %] - <option value="[% language.rfc4646_subtag | html %]" selected="selected">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option> - [% ELSE %] - <option value="[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option> - [% END %] - [% END %] - </select> - <input type="hidden" name="op" value="filter" /> - <input type="submit" class="button" value="Filter" /> - </form> - </div> - - [% IF ( page_list.size ) %] - <form name="del_form" method="post" action="[% link_self | url %]"> - <p><a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a></p> - <table id="pages_table"> - <thead> - <tr> - <th class="NoSort"> </th> - <th>Published</th> - <th>Parent</th> - <th>Interface</th> - <th>Library</th> - <th>Language</th> - <th>Number</th> - <th>Link title</th> - <th>Page title</th> - <th class="NoSort"> </th> - </tr> - </thead> - <tbody> - [% FOREACH page IN page_list %] - <tr id="[% page.id | html %]"> - <td><input type="checkbox" name="ids" id="ids" value="[% page.id | html %]"></td> - <td> - [% IF ( page.publish ) %] - Yes + <label for="branch">Library:</label> + <select id="branch" name="branch"> + [% IF ( branch == "" ) %] + <option value="" selected="selected">All libraries</option> + [% ELSE %] + <option value="">All libraries</option> + [% END %] + [% FOREACH br IN branch_list %] + [% IF ( br.branchcode == branch ) %] + <option value="[% br.branchcode | html %]" selected="selected">[% br.branchname | html %]</option> [% ELSE %] - No - [% END %] - </td> - <td>[% page.parent.title_link | html %]</td> - <td> - [% SWITCH page.location %] - [% CASE "" %] - All - [% CASE "1" %] - Staff interface - [% CASE "2" %] - OPAC + <option value="[% br.branchcode | html %]">[% br.branchname | html %]</option> [% END %] - </td> - <td> - [% IF ( page.branchcode == "" ) %] - All + [% END %] + </select> + + <label for="lang">Language:</label> + <select name="lang" id="lang"> + [% IF ( lang == "" ) %] + <option value="" selected="selected">All</option> + [% ELSE %] + <option value="">All</option> + [% END %] + [% FOREACH language IN lang_list %] + [% IF ( language.rfc4646_subtag == lang ) %] + <option value="[% language.rfc4646_subtag | html %]" selected="selected">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option> [% ELSE %] - [% page.branchcode.branchname | html %] + <option value="[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</option> [% END %] - </td> - <td> - [% IF ( page.lang == "" ) %] - All - [% ELSE %] - [% FOREACH lang IN lang_list %] - [% IF ( lang.rfc4646_subtag == page.lang ) %] - [% lang.native_description | html %] ([% lang.rfc4646_subtag | html %]) - [% END %] - [% END %] + [% END %] + </select> + <input type="hidden" name="op" value="filter" /> + <input type="submit" class="button" value="Filter" /> + </form> + </div> + + [% IF ( page_list.size ) %] + <form name="del_form" method="post" action="[% link_self | url %]"> + <p><a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a></p> + <table id="pages_table"> + <thead> + <tr> + <th class="NoSort"> </th> + <th>Link title</th> + <th>Page title</th> + <th>Published</th> + <th>Parent</th> + <th>Interface</th> + <th>Library</th> + <th>Language</th> + <th>Number</th> + <th class="NoSort"> </th> + </tr> + </thead> + <tbody> + [% FOREACH page IN page_list %] + <tr id="[% page.id | html %]"> + <td><input type="checkbox" name="ids" id="ids_[% page.id | html %]" value="[% page.id | html %]"></td> + <td><a href="[% link_self | url %]?op=form&id=[% page.id | uri %]">[% page.title_link | html %]</a></td> + <td>[% page.title | html %]</td> + <td> + [% IF ( page.publish ) %] + Yes + [% ELSE %] + No + [% END %] + </td> + <td> + <a href="[% link_self | url %]?op=form&id=[% page.parent.id | uri %]">[% page.parent.title_link | html %]</a> + </td> + <td> + [% SWITCH page.location %] + [% CASE "" %] + All + [% CASE "1" %] + Staff interface + [% CASE "2" %] + OPAC + [% END %] + </td> + <td> + [% IF ( page.branchcode == "" ) %] + All + [% ELSE %] + [% page.branchcode.branchname | html %] + [% END %] + </td> + <td> + [% IF ( page.lang == "" ) %] + All + [% ELSE %] + [% FOREACH lang IN lang_list %] + [% IF ( lang.rfc4646_subtag == page.lang ) %] + [% lang.native_description | html %] ([% lang.rfc4646_subtag | html %]) + [% END %] + [% END %] + [% END %] + </td> + <td>[% page.sortorder | html %]</td> + <td class="actions"> + <div class="btn-group"> + <a class="btn btn-default btn-xs dropdown-toggle" id="opencmspageactions[% page.id | html %]" role="button" data-toggle="dropdown" href="#"> + Actions <b class="caret"></b> + </a> + <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="opencmspageactions[% page.id | html %]"> + <li><a href="[% link_self | url %]?op=form&id=[% page.id | uri %]"><i class="fa fa-pencil"></i> Edit</a></li> + <li><a href="[% link_self | url %]?op=delSingle&id=[% page.id | uri %]" class="del_single" data-isparent="[% page.isParent | html %]"><i class="fa fa-trash"></i> Delete</a></li> + [% IF ( page.location == "" ) %] + <li><a href="[% link_self | url %]?op=view&id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li> + <li><a target="_blank" href="[% link_opac | url %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li> + [% ELSIF ( page.location == "1" ) %] + <li><a href="[% link_self | url %]?op=view&id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li> + [% ELSIF ( page.location == "2" ) %] + <li><a target="_blank" href="[% link_opac | url %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li> + [% END %] + </ul> + </div> + </td> + </tr> [% END %] - </td> - <td>[% page.sortorder | html %]</td> - <td><a href="[% link_self | url %]?op=form&id=[% page.id | uri %]">[% page.title_link | html %]</a></td> - <td>[% page.title | html %]</td> - <td class="actions"> - <div class="btn-group"> - <a class="btn btn-default btn-xs dropdown-toggle" id="opencmspageactions[% page.id | html %]" role="button" data-toggle="dropdown" href="#"> - Actions <b class="caret"></b> - </a> - <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="opencmspageactions[% page.id | html %]"> - <li><a href="[% link_self | url %]?op=form&id=[% page.id | uri %]"><i class="fa fa-pencil"></i> Edit</a></li> - <li><a href="[% link_self | url %]?op=delSingle&id=[% page.id | uri %]" class="del_single" data-isparent="[% page.isParent | html %]"><i class="fa fa-trash"></i> Delete</a></li> - [% IF ( page.location == "" ) %] - <li><a href="[% link_self | url %]?op=view&id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li> - <li><a target="_blank" href="[% link_opac | uri %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li> - [% ELSIF ( page.location == "1" ) %] - <li><a href="[% link_self | url %]?op=view&id=[% page.id | uri %]"><i class="fa fa-eye"></i> View</a></li> - [% ELSIF ( page.location == "2" ) %] - <li><a target="_blank" href="[% link_opac | uri %]?id=[% page.id | uri %]"><i class="fa fa-eye"></i> View in OPAC</a></li> - [% END %] - </ul> - </div> - </td> - </tr> - [% END %] - </tbody> - </table> - <input type="hidden" name="op" value="del" /> - <fieldset class="action"> - <input type="submit" class="button" id="del_button" value="Delete selected" /> - </fieldset> - </form> - [% ELSE %] - <div class="dialog message"> - No pages exist. <a href="[% link_self | url %]?op=form">Create a new page?</a> - </div> - [% END # IF page_list.size %] - [% END # IF view / form %] + </tbody> + </table> <!-- /#pages_table --> + <input type="hidden" name="op" value="del" /> + <fieldset class="action"> + <input type="submit" class="button" id="del_button" value="Delete selected" /> + </fieldset> + </form> + [% ELSE %] + <div class="dialog message"> + No pages exist. <a href="[% link_self | url %]?op=form">Create a new page?</a> + </div> + [% END # IF page_list.size %] + [% END # IF view / form %] - </main> - [% UNLESS ( form ) %] - </div> <!-- /.col-sm-10.col-sm-push-2 --> + </main> - <div class="col-sm-2 col-sm-pull-10"> - <aside> - [% INCLUDE 'tools-menu.inc' %] - </aside> - </div> <!-- /.col-sm-2.col-sm-pull-10 --> - [% END %] -</div> <!-- /.row --> + [% UNLESS ( form ) %] + </div> <!-- /.col-sm-10.col-sm-push-2 --> + + <div class="col-sm-2 col-sm-pull-10"> + <aside> + [% INCLUDE 'tools-menu.inc' %] + </aside> + </div> <!-- /.col-sm-2.col-sm-pull-10 --> + [% END %] + </div> <!-- /.row --> [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] @@ -379,6 +401,7 @@ <script> $(document).ready(function() { $("#pages_table").dataTable($.extend(true, {}, dataTablesDefaults, { + "sorting": [[ 1, "asc" ]], "aoColumnDefs": [ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, ], @@ -414,24 +437,15 @@ }); tinyMCE.init({ - mode : "textareas", - theme : "advanced", - convert_urls : false, - relative_urls : false, + branding : false, content_css : "[% interface | html %]/[% theme | html %]/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" + menubar : "file edit view insert format tools table", + mode : "specific_textareas", + plugins : "autoresize table hr link image charmap lists code emoticons", + toolbar : [ + "formatselect | bold italic | cut copy paste | alignleft aligncenter alignright | outdent indent | image link unlink anchor cleanup hr", + "table | bullist numlist | undo redo | removeformat | emoticons charmap | forecolor backcolor | code visualaid help" + ], }); </script> [% END # jsinclude %] -- 2.11.0