From: senator Date: Wed, 16 Mar 2011 18:48:52 +0000 (-0400) Subject: "Add to my list" becomes "remove from my list", and X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6abbb515957102518457e0d07784b3219f20c15b;p=evergreen%2Fequinox.git "Add to my list" becomes "remove from my list", and it now works on the record detail page as well as the results page. Also, I fixed a bug by which an HTML form was rendered wrongly, totally breaking the display of the results page in IE and preventing the first result on any page of search results from adding to the anonymous list. --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm index a6e408dbe6..35e41fc313 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm @@ -187,7 +187,14 @@ sub get_records_and_facets { sub fetch_marc_xml_by_id { my ($self, $id_list) = @_; $id_list = [$id_list] unless ref($id_list); - return {} if scalar(grep { defined $_ } @$id_list) < 1; + + { + no warnings qw/numeric/; + $id_list = [map { int $_ } @$id_list]; + $id_list = [grep { $_ > 0} @$id_list]; + }; + + return {} if scalar(@$id_list) < 1; # I'm just sure there needs to be some more efficient way to get all of # this. diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index ce35479c64..219a3388b2 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -556,6 +556,10 @@ div.select-wrapper:hover { left:2px; } +.almost-content-wrapper { + background: white; +} + #content-wrapper { background: white; min-height: 260px; diff --git a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 index ab4da6455c..f151888b69 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 @@ -38,20 +38,24 @@
-
-
-
- Add to my list +
+ [% operation = ctx.mylist.grep(record.id).size ? "delete" : "add"; + label = (operation == "add") ? "Add to" : "Remove from"; %] +
+ +
+
+ +
-
- [% l('add to my list') %] + +
diff --git a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 index b4ef916fe4..4b14e04c75 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 @@ -185,15 +185,17 @@ style="position:relative;top:-3px;left:3px;">Place Hold
-
+ [% operation = ctx.mylist.grep(rec.bre.id).size ? "delete" : "add"; + label = (operation == "add") ? "Add to" : "Remove from"; %] +
- +
diff --git a/Open-ILS/web/templates/default/opac/results.tt2 b/Open-ILS/web/templates/default/opac/results.tt2 index 3b06cae3c2..db1f29899a 100644 --- a/Open-ILS/web/templates/default/opac/results.tt2 +++ b/Open-ILS/web/templates/default/opac/results.tt2 @@ -13,7 +13,7 @@ [% INCLUDE "default/opac/parts/utils.tt2" %] [% INCLUDE "default/opac/parts/searchbar.tt2" took_care_of_form=1 %]
-
+
@@ -59,6 +59,9 @@
+
+ +
[% path = "default/opac/parts/result/" _ @@ -68,5 +71,4 @@
- [% END %]