@@ -, +, @@ OPAC - The modal should show the title of the list you're deleting. - If the list has titles on it, it show how many. - If the list has been shared with someone it should say so. - Test the "Delete list" link in the toolbar. - You should see the same information in the confirmation message as in the previous step. --- .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 64 +++++++++++++++------- 1 file changed, 44 insertions(+), 20 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -8,6 +8,22 @@ [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] +[% BLOCK delete_shelf %] +
+ + + + + +
+[% END %] + [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › [% IF op == 'view' %]Contents of [% shelf.shelfname | html %][% ELSE %]Your lists[% END %][% INCLUDE 'doc-head-close.inc' %] [% BLOCK cssinclude %][% END %] @@ -159,6 +175,8 @@ [% IF ( itemsloop ) %] + [% SET contents = shelf.get_contents %] + [% IF ( contents.count ) %]

This list contains [% contents.count | html %] titles

[% END %]
@@ -181,13 +199,8 @@ -
- - - - - -
+ [% PROCESS delete_shelf context = "details" %] + [% IF category == PRIVATE && Koha.Preference('OpacAllowSharingPrivateLists') %] Share list [% END %] @@ -504,12 +517,8 @@ -
- - - - -
+ [% PROCESS delete_shelf context = "details" %] + [% END %]
@@ -688,13 +697,7 @@ [% END %] [% IF s.can_be_deleted( loggedinusernumber ) %] -
- - - - - -
+ [% PROCESS delete_shelf shelf = s context = "list" %] [% END %] [% IF s.is_private AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %] Share @@ -966,6 +969,27 @@ $(function() { }); [% END %] + $(".deleteshelf").on("click", function(e){ + e.preventDefault(); + var shelf_name = $(this).data("shelfname"); + var shelf_number = $(this).data("shelfnumber"); + var is_shared = $(this).data("shared"); + var count = $(this).data("count"); + var message = "

" + shelf_name + "

"; + if( count ){ + message += "

" + _("Items on this list:") + " " + count + "

"; + } + if( is_shared ){ + message += "

" + _("This list is shared. Other users will lose access to it.") + "

"; + } + confirmModal( message, _("Are you sure you want to delete this list?"), _("Yes, delete"), _("No, do not delete"), function( result ){ + if( result ){ + $("#deleteshelf" + shelf_number ).submit(); + } + } + ); + }); + $(".remove_share").on("click", function(e){ e.preventDefault(); var shelf_name = $(this).data("shelfname"); --