From 21743636af9d4ae5c439df4250cc48db3589f3b6 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 6 Mar 2014 11:44:15 +0100 Subject: [PATCH] Bug 9032: (follow-up) add support for bootstrap theme Adds new template opac-shareshelf.tt. Modifies template opac-shelves.tt: Share button, Remove Share button, label "Your lists" instead of "Your private lists", list category Shared. Test plan: Verify if the Share a list-features work in bootstrap by: [1] Switch to bootstrap. Go to Lists. [2] Share one of your private lists. [3] Login as another user and accept the invitation. [4] Remove the share again. [5] Check if Share and Remove share do not popup for public lists. Signed-off-by: Dobrica Pavlinusic Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- .../bootstrap/en/modules/opac-shareshelf.tt | 90 +++++++++++++++++++ .../bootstrap/en/modules/opac-shelves.tt | 31 +++++-- 2 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt new file mode 100644 index 0000000000..433b17ab6c --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt @@ -0,0 +1,90 @@ +[% USE Koha %] +[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Share a list +[% INCLUDE 'doc-head-close.inc' %] +[% BLOCK cssinclude %][% END %] + + + +[% INCLUDE 'masthead.inc' %] +
+ + +
+
+ [% IF ( OpacNav ) %] +
+ +
+ [% END %] + +[%# This section contains the essential code for error messages and three operations: invite, confirm_invite and accept. %] +

Share a list with another patron

+
+
+ + [% IF errcode %] + [% IF errcode==1 && op %]
The operation [% op %] is not supported.
[% END %] + [% IF errcode==1 && !op %]
No operation parameter has been passed.
[% END %] + [% IF errcode==2 %]
Invalid shelf number.
[% END %] + [% IF errcode==3 %]
The feature of sharing lists is not in use in this library.
[% END %] + [% IF errcode==4 %]
You can only share a list if you are the owner.
[% END %] + [% IF errcode==5 %]
You cannot share a public list.
[% END %] + [% IF errcode==6 %]
Sorry, but you did not enter any valid email address.
[% END %] + [% IF errcode==7 %]
Sorry, but we could not accept this key. The invitation may have expired. Contact the patron who sent you the invitation.
[% END %] + [% IF errcode==8 %]
As owner of a list you cannot accept an invitation for sharing it.
[% END %] + + [% ELSIF op=='invite' %] +
+
+
+
    + + +
  1. [% shelfname %]
  2. +
  3. + + +
  4. +
+
+
+ +
+
+
+ + [% ELSIF op=='conf_invite' %] +
+ [% IF approvedaddress %] +

An invitation to share list [% shelfname %] has been sent to [% approvedaddress %].

+ [% END %] + [% IF failaddress %] +

Something went wrong while processing the following addresses. Please check them. These are: [% failaddress %]

+ [% END %] + [% IF approvedaddress %] +

You will receive an email notification if someone accepts your share within two weeks.

+ [% END %] +

Return to your lists

+
+ + [% ELSIF op=='accept' %] + [%# Nothing to do: we already display an error or we redirect. %] + [% END %] + +
+
+[%# End of essential part %] + +
+
+
+[% INCLUDE 'opac-bottom.inc' %] +[% BLOCK jsinclude %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 7d77432c38..8f2e1e2279 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -33,6 +33,13 @@  anyone to remove other contributed entries. [% END %] +[% BLOCK remove_share %] + [%# Use: add parameter shelfnumber and add end form tag %] +
+ + + +[% END %] [% INCLUDE 'masthead.inc' %]
@@ -173,6 +180,13 @@ [% END %] + [% IF showprivateshelves && Koha.Preference('OpacAllowSharingPrivateLists') %] + Share list + [% END %] + [% ELSIF showprivateshelves # not manageshelf and private means shared %] + [% INCLUDE remove_share %] + + [% END # / IF manageshelf %]
@@ -590,9 +604,9 @@
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] [% IF ( showprivateshelves ) %] -
  • Your private lists
  • +
  • Your lists
  • [% ELSE %] -
  • Your private lists
  • +
  • Your lists
  • [% END %] [% END %] [% IF ( showpublicshelves ) %] @@ -624,8 +638,7 @@ [% shelveslooppri.shelfname |html %] [% IF ( shelveslooppri.count ) %][% shelveslooppri.count %] [% IF ( shelveslooppri.single ) %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %] - [% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %] - [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %] + [% IF ( shelveslooppri.viewcategory1 ) %][% IF !shelveslooppri.shares %]Private[% ELSE %]Shared[% END %][% END %] [% IF ( shelveslooppri.mine ) %] @@ -647,6 +660,14 @@ [% END %] + [% IF Koha.Preference('OpacAllowSharingPrivateLists') %] + Share + [% END %] + [% ELSE # not shelveslooppri.mine, so shared %] + [% INCLUDE remove_share # if pref is off, you should still be able to remove shares %] + + + [% END %]  @@ -691,7 +712,6 @@ [% shelvesloo.shelfname |html %] [% shelvesloo.count %] [% IF ( shelvesloo.single ) %]item[% ELSE %]item(s)[% END %] - [% IF ( shelvesloo.viewcategory1 ) %]Private[% END %] [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %] @@ -796,6 +816,7 @@ var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?"); var MSG_REMOVE_ONE_FROM_LIST = _("Are you sure you want to remove this item from the list?"); var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?"); +var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'RequestOnOpac' ) == 1 ) ) %] function holdSelections() { -- 2.39.5