Temporary Lists: Modifying code to re-show temporary list links
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 16 Feb 2017 21:49:07 +0000 (16:49 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 1 Mar 2017 13:38:10 +0000 (08:38 -0500)
that were disabled due to bug 1639236.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index b00f663..a2734e5 100644 (file)
             [%  IF ctx.user;
                 INCLUDE "opac/parts/bookbag_actions.tt2";
             %]
-<!-- PINES Customization: remove Temporary List block if not logged in -->
-            [% ELSE %]
-                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
-                <i>[% l('Log in to use Lists') %]</i>
+            [%  ELSE;
+                operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add";
+                label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); 
+            %]
+                 <a href="[% mkurl(ctx.opac_root _ '/mylist/' _ operation, {record => ctx.bre_id}, stop_parms) %]" class="no-dec" rel="nofollow" vocab="">
+                    <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+                    [% label %]
+                </a>    
                                <a href="http://pines.georgialibraries.org/catalog-help#my_list" target="_blank">
                                <img src="[% ctx.media_prefix %]/images/question-mark.png" alt="Learn about lists" border=0></a>
             [% END %]
index 2ba4d2e..883d59b 100644 (file)
@@ -395,10 +395,20 @@ END;
                                                             [%  IF ctx.user;
                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";
                                                             %]
-                                                            <!-- PINES Customization: remove Temporary List block if not logged in -->
-                                                            [% ELSE %]
-                                                            <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
-                                                            <i>[% l('Log in to use Lists') %]</i>
+                                                            [%  ELSE;
+                                                                operation = ctx.mylist.grep(rec.id).size ? "delete" : "add";
+                                                                label = (operation == "add") ?  l("Add to my list") : l("Remove from my list");
+                                                                title_label = (operation == "add") ? 
+                                                                  l("Add [_1] to my list", attrs.title) : 
+                                                                  l("Remove [_1] from my list", attrs.title);
+                                                                href = mkurl(ctx.opac_root _ '/mylist/' _ operation, 
+                                                                        {record => rec.id, anchor => 'record_' _ rec.id}, 1);
+                                                            %]      
+                                                            <a href="[% href %]" class="no-dec" 
+                                                                [% html_text_attr('title', title_label) %] rel="nofollow" vocab="">
+                                                                <img src="[% ctx.media_prefix %]/images/clipboard.png" alt="" />
+                                                                [% label %]
+                                                            </a>
                                                                                                                        <a href="http://pines.georgialibraries.org/catalog-help#my_list" target="_blank">
                                                                                                                            <img src="[% ctx.media_prefix %]/images/question-mark.png" alt="Learn about lists" border=0></a>
                                                             [% END %]