Bugzilla – Attachment 87501 Details for
Bug 15326
Add CMS feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15326: (follow-up) Interface fixes
Bug-15326-follow-up-Interface-fixes.patch (text/plain), 7.35 KB, created by
Martin Renvoize (ashimema)
on 2019-04-08 11:16:44 UTC
(
hide
)
Description:
Bug 15326: (follow-up) Interface fixes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-04-08 11:16:44 UTC
Size:
7.35 KB
patch
obsolete
>From b04cc49e3e95b567357e17ed1feefbaf4168987f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 8 Apr 2019 12:14:54 +0100 >Subject: [PATCH] Bug 15326: (follow-up) Interface fixes > >This patch addresses the following: > >a) I feel we don't need the "Pages" heading. It only takes up space and >states the obvious. (non-blocker... but navigation needs work, see >below) > >b) OpacMainUserBlock should not show on the pages in my opinion. >Libraries use it to place text on the start page instead of using the >news feature, which means it repeats on all pages. I'd really like to >see this changed. > >c) Personally I'd change "Location" to "Interface" to avoid confusion >with the item value in translations. But I see it's the same on news. So >out of scope here. > >d) Parent pages can be deleted without warning. Childs will be moved to >top level. This is acceptable behaviour as they are not left orphaned. >But it might be something to improve on in the future. > >e) In the test plan and in the code I see there should be a confirmation >message on deleting a single or multiple entries, but this doesn't work. >(blocker) > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> >Rebased-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/tools/cmspages.tt | 22 ++++++++++++------- > .../bootstrap/en/includes/navigation.inc | 1 - > .../bootstrap/en/modules/opac-cmspages.tt | 1 - > tools/cmspages.pl | 4 ++++ > 4 files changed, 18 insertions(+), 10 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 4d76298edd..fb24bd7a3d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cmspages.tt >@@ -1,3 +1,4 @@ >+[% USE raw %] > [% USE KohaDates %] > [% USE Koha %] > [% USE Asset %] >@@ -8,7 +9,6 @@ > <title>Koha › Tools › Pages</title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.css("css/datatables.css") %] >-[% INCLUDE 'datatables.inc' %] > </head> > <body id="tools_koha-content" class="tools"> > [% INCLUDE 'header.inc' %] >@@ -98,7 +98,7 @@ > <legend>Page</legend> > <ol> > <li> >- <label for="disp">Display location:</label> >+ <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 %] >@@ -201,7 +201,7 @@ > <th> </th> > <th>Published</th> > <th>Parent</th> >- <th>Location</th> >+ <th>Interface</th> > <th>Library</th> > <th>Language</th> > <th>Number</th> >@@ -210,8 +210,8 @@ > <th> </th> > </tr></thead> > <tbody>[% FOREACH page IN page_list %] >- <tr> >- <td><input type="checkbox" name="ids" id="ids" value="[% page.id %]" /></td> >+ <tr id="[% page.id %]"> >+ <td><input type="checkbox" name="ids" id="ids" value="[% page.id %]"></td> > <td>[% IF ( page.publish ) %]Yes[% ELSE %]No[% END %]</td> > <td>[% page.parent.title_link %]</td> > <td>[% SWITCH page.location %] >@@ -238,7 +238,7 @@ > Actions <b class="caret"></b></a> > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="opencmspageactions[% page.id %]"> > <li><a href="[% link_self %]?op=form&id=[% page.id %]"><i class="fa fa-pencil"></i> Edit</a></li> >- <li><a href="[% link_self %]?op=delSingle&id=[% page.id %]" class="del_single"><i class="fa fa-trash"></i> Delete</a></li> >+ <li><a href="[% link_self %]?op=delSingle&id=[% page.id %]" class="del_single" data-isparent="[% page.isParent %]"><i class="fa fa-trash"></i> Delete</a></li> > [% IF ( page.location == "" ) %] > <li><a href="[% link_opac %]?id=[% page.id %]"><i class="fa fa-eye"></i> OPAC</a></li> > <li><a href="[% link_self %]?op=view&id=[% page.id %]"><i class="fa fa-eye"></i> Intranet</a></li> >@@ -272,9 +272,11 @@ > [% END %] > </div> > [% MACRO jsinclude BLOCK %] >-[% Asset.js("js/tools-menu.js") %] >-[% Asset.js("lib/tiny_mce/tiny_mce.js") %] >+[% INCLUDE 'datatables.inc' %] >+[% Asset.js("js/tools-menu.js") | $raw %] >+[% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %] > <script type="text/javascript">//<![CDATA[ >+ > $(document).ready(function() { > $("#pages_table").dataTable($.extend(true, {}, dataTablesDefaults, { > "aoColumnDefs": [ >@@ -293,6 +295,10 @@ $(document).ready(function() { > }); > > $(".del_single").on("click", function(){ >+ var isParent = $(this).attr('data-isparent'); >+ if (isParent == 1){ >+ return confirmDelete(_("This page is a parent page. Are you sure you want to delete this page?")); >+ } > return confirmDelete(_("Are you sure you want to delete this page?")); > }); > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/navigation.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/navigation.inc >index e70ef67a03..5d2d2b4d3f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/navigation.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/navigation.inc >@@ -1,7 +1,6 @@ > [% USE raw %] > <div id="opacnav"> > [% IF ( links ) %] >- <h4>Pages</h4> > <ul id="cms_nav"> > [% FOREACH link IN links %] > [% IF ( link.publish == '1' || link.publish == '0' && CAN_user_tools_edit_pages ) %] >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 88811eff34..2f9393adc1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-cmspages.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-cmspages.tt >@@ -50,7 +50,6 @@ > This page has not been published. > [% END %] > >- [% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock">[% OpacMainUserBlock %]</div>[% END %] > </div> <!-- / .span 7/9 --> > > </div> <!-- /.container-fluid --> >diff --git a/tools/cmspages.pl b/tools/cmspages.pl >index 0f7258bd4b..3a1f5977e5 100755 >--- a/tools/cmspages.pl >+++ b/tools/cmspages.pl >@@ -57,6 +57,10 @@ my $branches = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); > # List all pages, if id is set generate parent page list and data. > my ( $page_list, $parent_list, $page_data ) = Koha::CmsPages->list( $id ); > >+foreach my $p ( @$page_list ){ >+ $p->{isParent} = Koha::CmsPages->search({ parent => $p->{id} })->count ? 1 : 0; >+} >+ > $template->param( > branch_list => $branches, > page_list => $page_list, >-- >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 15326
:
45621
|
58272
|
58607
|
58608
|
58609
|
58787
|
63904
|
63905
|
64241
|
64941
|
64942
|
66255
|
70866
|
70867
|
70868
|
70869
|
70870
|
70871
|
76387
|
76388
|
76389
|
76390
|
76391
|
76392
|
78232
|
78233
|
78234
|
78235
|
78236
|
78237
|
78238
|
78240
|
79269
|
83318
|
83319
|
83320
|
83321
|
83322
|
83323
|
83324
|
83325
|
83326
|
83404
|
83405
|
83406
|
83407
|
83408
|
83409
|
83410
|
83411
|
83412
|
84682
|
84683
|
84684
|
84685
|
84686
|
84687
|
84688
|
84689
|
84690
|
84691
|
87494
|
87495
|
87496
|
87497
|
87498
|
87499
|
87500
|
87501
|
87502
|
87503
|
87608
|
87609
|
87610
|
87617
|
96084
|
96085
|
96086
|
96087
|
96088
|
96089
|
96090
|
96091
|
96092
|
96093
|
96094
|
96095
|
96096
|
96097
|
96098
|
97237
|
101565
|
101566
|
101567
|
101568
|
101569
|
101570
|
101571
|
101572
|
101573
|
101574
|
101575
|
101576
|
101577
|
101578
|
101579
|
101580
|
128341
|
128342
|
128343
|
128344
|
128345
|
128346
|
128347
|
128348
|
128349
|
128350
|
128351
|
128352
|
128353
|
128354
|
128355
|
128356
|
128357
|
128585
|
128642
|
136432
|
136757
|
136768
|
138489
|
138493
|
139028
|
139029
|
139030
|
139031
|
139111
|
139123
|
139124
|
139125
|
139172
|
139173
|
139174