From 3ebfefa7de82a66991bf268a0083d6cc14750997 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Thu, 16 Feb 2017 16:49:07 -0500 Subject: [PATCH] Temporary Lists: Modifying code to re-show temporary list links that were disabled due to bug 1639236. Signed-off-by: Terran McCanna --- Open-ILS/src/templates/opac/parts/record/summary.tt2 | 12 ++++++++---- Open-ILS/src/templates/opac/parts/result/table.tt2 | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index b00f6633a3..a2734e5328 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -59,10 +59,14 @@ [% IF ctx.user; INCLUDE "opac/parts/bookbag_actions.tt2"; %] - - [% ELSE %] - - [% l('Log in to use Lists') %] + [% ELSE; + operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add"; + label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); + %] + + + [% label %] + Learn about lists [% END %] diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 2ba4d2ef00..883d59bea9 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -395,10 +395,20 @@ END; [% IF ctx.user; INCLUDE "opac/parts/bookbag_actions.tt2"; %] - - [% ELSE %] - - [% l('Log in to use Lists') %] + [% 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); + %] + + + [% label %] + Learn about lists [% END %] -- 2.11.0