From bfa3e07d161290483a63ad02ee27d53cfc793d46 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 29 Oct 2014 17:07:29 -0400 Subject: [PATCH] KMAIN-392 - Updating my lists Cross-port: 02a9b2c Conflicts: Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm --- .../var/templates_kcls/opac/myopac/lists.tt2 | 605 +++++++++++++-------- .../templates_kcls/opac/myopac/prefs_my_lists.tt2 | 17 + KCLS/sql/kmain-392/kmain392.sql | 41 ++ .../lib/OpenILS/WWW/EGCatLoader/Account.pm | 4 +- Open-ILS/web/css/skin/default/opac/style.css | 71 +++ 5 files changed, 510 insertions(+), 228 deletions(-) create mode 100644 KCLS/sql/kmain-392/kmain392.sql diff --git a/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 b/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 index 8b51401bce..ce9e49296b 100644 --- a/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 @@ -1,41 +1,42 @@ [% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; WRAPPER "opac/parts/myopac/base.tt2"; - myopac_page = "lists" - limit = ctx.bookbags_limit; offset = ctx.bookbags_offset; - itemPage = ctx.bookbags_itemPage; - + item_page = ctx.bookbags_item_page; %]
- -
- - -
-

[% l('Create new list') %]

+ + +

[% l('Create New List') %]

+ - +
+ + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + [% IF ctx.add_rec %] + + [% END %] + [% IF ctx.where_from %] + + [% END %] @@ -46,34 +47,33 @@ [% l('Sharing Help') %]       - [% l('Cancel') %]
+

[% l("My Existing Lists") %]

[% INCLUDE "opac/parts/anon_list.tt2" %] [% IF ctx.bookbags.size %] - +
[% l('Saved Lists') %] [% IF limit < ctx.bookbag_count; %] @@ -83,7 +83,6 @@ offset => (offset - limit) }) %]'>[% l('Previous') %] [%- END; -%] - [%- IF (offset - (limit * 3)) >= 0 -%] (offset - (limit * 3)) @@ -99,28 +98,25 @@ offset => (offset - limit) }) %]'>[% ((offset - limit) / limit) + 1 %] [%- END; -%] - [% (offset / limit) + 1 %] - - [%- IF (ctx.bookbag_count - offset) > limit; -%] + [%- IF (offset + limit) <= ctx.bookbag_count -%] (offset + limit) }) %]'>[% ((offset + limit) / limit) + 1 %] [%- END; -%] - [%- IF (ctx.bookbag_count - offset) > limit * 2; -%] + [%- IF (offset + (limit * 2)) <= ctx.bookbag_count -%] (offset + (limit * 2)) }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %] [%- END; -%] - [%- IF (ctx.bookbag_count - offset) > limit * 3; -%] + [%- IF (offset + (limit * 3)) <= ctx.bookbag_count -%] (offset + (limit * 3)) }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %] [%- END; -%] - [%- IF (ctx.bookbag_count - offset) > limit; -%] (offset + limit) + limit => limit, offset => (offset + limit) }) %]'>[% l('Next') %] [%- END; -%] @@ -128,178 +124,373 @@
+
[% FOR bbag IN ctx.bookbags %] -
-
-
-
+
+ [% IF ctx.add_rec %] + +
+ - [% IF bbag.pub != 't' %] - - - [% ELSE %] - - + + [% IF ctx.where_from %] + [% END %] +
-
+ [% END %] + + +
+ + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + [% IF bbag.pub != 't' %] + + + [% ELSE %] + + + [% END %] +
+
+ +
+
+ + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+
+ + + + + + + +
+ [% baseurl = ctx.opac_root _ '/myopac/lists'; + IF bbag.id != CGI.param("bbid"); + url = mkurl(baseurl,{bbid => bbag.id, item_page => 1},['edit_notes','sort']); + ltitle = l("Show items in list"); + ELSE; + url = mkurl(baseurl, {}, ['bbid', 'edit_notes', 'sort']); + ltitle = l("Hide items in list"); + END %] +

[% bbag.name | html %]

+ [% IF bbag.description %]
[% bbag.description | html %]
[% END %]
- -
- - - [% IF CGI.param("bbid") == bbag.id %] - - - - + + [%- setting = 'opac.list_items_per_page' -%] + + + +
- - + +
+ [% IF bbag.pub == 't'; %] + [% l('RSS Feed') %] + [% END %] +
+
+ + [% IF CGI.param("bbid") == bbag.id %] + + + + + + + + + + + + + + + + + + + + + + + + [% UNLESS bbag.items.size %] + + [% END %] + [% FOR item IN bbag.items; + rec_id = item.target_biblio_record_entry.id; + attrs = {marc_xml => ctx.bookbags_marc_xml.$rec_id}; + PROCESS get_marc_attrs args=attrs %] + + + + + + - + --> + + + + + + + + [% END %] + [% IF CGI.param("edit_notes") == bbag.id %] + + + + + [% END %] + +
+ + + + [% l('Title') %] + + [% l('Author(s)') %] + + + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + +
+ [% l("This list contains no items.") %] +
+ + + [% attrs.title | html %] + + [% attrs.author | html %] +
+ [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + + +
+ [% IF ctx.bb_page_count > 1; %] +
+ [% l('Navigate Selected List ') %] + + [%- IF item_page > 1 -%] + item_page - 1 + }) %]'>[% l('Previous') %] + [%- END; -%] + + [%- IF (item_page - 3) >= 1 -%] + item_page - 3 + }) %]'>[% item_page - 3 %] + [%- END; -%] + [%- IF (item_page - 2) >= 1 -%] + item_page - 2 + }) %]'>[% item_page - 2 %] + [%- END; -%] + [%- IF (item_page - 1) >= 1 -%] + item_page - 1 + }) %]'>[% item_page - 1%] + [%- END; -%] + [% item_page %] + [%- IF (item_page + 1) <= ctx.bb_page_count -%] + item_page + 1 + }) %]'>[% item_page + 1 %] + [%- END; -%] + [%- IF (item_page + 2) <= ctx.bb_page_count -%] + item_page + 2 + }) %]'>[% item_page + 2 %] + [%- END; -%] + [%- IF (item_page + 3) <= ctx.bb_page_count -%] + item_page + 3 + }) %]'>[% item_page + 3 %] + [%- END; -%] + + [%- IF (item_page + 1) <= ctx.bb_page_count; -%] + item_page + 1 + }) %]'>[% l('Next') %] + [%- END; -%] + +
+
+ [% END %] +
- + + [% END %] [% END %] - +
+
[% l('Saved Lists') %] [% IF limit < ctx.bookbag_count; %] [%- IF offset > 0 -%] (offset - limit) + limit => limit, offset => (offset - limit) }) %]'>[% l('Previous') %] [%- END; -%] - [%- IF (offset - (limit * 3)) >= 0 -%] (offset - (limit * 3)) @@ -315,75 +506,37 @@ offset => (offset - limit) }) %]'>[% ((offset - limit) / limit) + 1 %] [%- END; -%] - [% (offset / limit) + 1 %] - - [%- IF (ctx.bookbag_count - offset) > limit; -%] + [%- IF (offset + limit) <= ctx.bookbag_count -%] (offset + limit) }) %]'>[% ((offset + limit) / limit) + 1 %] [%- END; -%] - [%- IF (ctx.bookbag_count - offset) > limit * 2; -%] + [%- IF (offset + (limit * 2)) <= ctx.bookbag_count -%] (offset + (limit * 2)) }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %] [%- END; -%] - [%- IF (ctx.bookbag_count - offset) > limit * 3; -%] + [%- IF (offset + (limit * 3)) <= ctx.bookbag_count -%] (offset + (limit * 3)) }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %] [%- END; -%] - [%- IF (ctx.bookbag_count - offset) > limit; -%] (offset + limit) + limit => limit, offset => (offset + limit) }) %]'>[% l('Next') %] [%- END; -%] [% END %]
-
- - - - [% END %] -
- [% l("This will remove the selected bookbag and all items contained within the bookbag. Are you sure you wish to continue?") %] -
-
[% l("You have not created any bookbags") %]
-
- -
[% |l %]Sharing a Bookbag means that the contents of the Bookbag will be visible to others. To see the public view of a shared Bookbag, click on the Bookbag's name in the Bookbag list.[% END %] - - [% l("Are you sure you wish to remove this bookbag item?") %] - - - [% l("Sharing this bookbag will allow the contents of the bookbag to be seen by others. Are you sure you wish to share this bookbag?") %] - - - [% l("Are you sure you wish to hide this bookbag?") %] - - - [% l("The Bookbag was successfully updated.") %] - - - [% l("Warning: Adding items to a bookbag creates a link between you and the items in the database. The contents of the bookbag are NOT publicly viewable unless the bookbag is shared. However, if you prefer not to have any link between your patron record and a particular item or items, we suggest that you do not place said items in a bookbag or that you avoid using bookbags all together. Thank you.") %] - - - [% l("Bookbags are...") %] - - - [% l("Bookbag successfully updated") %] - - [% END %] diff --git a/KCLS/openils/var/templates_kcls/opac/myopac/prefs_my_lists.tt2 b/KCLS/openils/var/templates_kcls/opac/myopac/prefs_my_lists.tt2 index 99e7799f9f..960297af42 100644 --- a/KCLS/openils/var/templates_kcls/opac/myopac/prefs_my_lists.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/myopac/prefs_my_lists.tt2 @@ -33,6 +33,23 @@
+ +
diff --git a/KCLS/sql/kmain-392/kmain392.sql b/KCLS/sql/kmain-392/kmain392.sql new file mode 100644 index 0000000000..08f1489e05 --- /dev/null +++ b/KCLS/sql/kmain-392/kmain392.sql @@ -0,0 +1,41 @@ +BEGIN; + + INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype) + VALUES ( + 'opac.lists_per_page', + TRUE, + oils_i18n_gettext( + 'opac.lists_per_page', + 'Lists per Page', + 'cust', + 'label' + ), + oils_i18n_gettext( + 'opac.lists_per_page', + 'A number designating the amount of lists displayed per page.', + 'cust', + 'description' + ), + 'string' + ); + +INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype) + VALUES ( + 'opac.list_items_per_page', + TRUE, + oils_i18n_gettext( + 'opac.list_items_per_page', + 'List Items per Page', + 'cust', + 'label' + ), + oils_i18n_gettext( + 'opac.list_items_per_page', + 'A number designating the amount of list items displayed per page of a selected list.', + 'cust', + 'description' + ), + 'string' + ); + +COMMIT; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index d78b59bf5f..0e06a12ef9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -709,7 +709,7 @@ sub load_myopac_prefs_my_lists { my @user_prefs = qw/ opac.lists_per_page - opac.list_items_per_page + opac.lists_per_page, /; my $stat = $self->_load_user_with_prefs; @@ -2317,7 +2317,7 @@ sub load_myopac_bookbags { my $self = shift; my $e = $self->editor; my $ctx = $self->ctx; - my $limit = $self->_get_lists_per_page || 10; + my $limit = $self->_get_lists_per_page; my $offset = $self->cgi->param('offset') || 0; $ctx->{bookbags_limit} = $limit; diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index a8fee6de87..b12fac803e 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -1152,3 +1152,74 @@ a.dash-link:hover { text-decoration: underline !important; } .result_item_circulated { padding-top: 4px; } + +/* Popmenu styles used for making css menus. */ +.popmenu { + margin: 0; + padding: 0; +} +.popmenu li { + list-style: none; +} +.popmenu li a { + display: block; + padding: 3px 5px; +} +.popmenu li ul { + display: none; + width: 10em; /* Width to help Opera out */ + background-color: [% css_colors.primary %]; +} +.popmenu li:hover ul { + display: block; + position: absolute; + margin: 0; + padding: 0; + border-color: [% css_colors.border_dark %]; + border-width: 1px; + border-style: solid; +} +.popmenu li:hover li { + float: none; +} +.popmenu li:hover li a { + background-color: [% css_colors.primary %]; + color: [% css_colors.accent_ultralight %]; +} +.popmenu li li a:hover { + background-color: [% css_colors.accent_ultralight %]; + color: [% css_colors.primary %]; +} +/* Styles for the temporary list entry. */ +.popmenu li:hover li[class~="temporary"] a { + background-color: [% css_colors.primary %]; + color: [% css_colors.accent_ultralight %]; +} +.popmenu li li[class~="temporary"] a:hover { + background-color: [% css_colors.accent_ultralight %]; + color: [% css_colors.primary %]; +} +/* Styles for the default list entry. */ +.popmenu li:hover li[class~="default"] a { + background-color: [% css_colors.primary %]; + color: [% css_colors.accent_ultralight %]; +} +.popmenu li li[class~="default"] a:hover { + background-color: [% css_colors.accent_ultralight %]; + color: [% css_colors.primary %]; +} +/* Styles for the new list entry. */ +.popmenu li:hover li[class~="new"] a { + background-color: [% css_colors.primary %]; + color: [% css_colors.accent_ultralight %]; +} +.popmenu li li[class~="new"] a:hover { + background-color: [% css_colors.accent_ultralight %]; + color: [% css_colors.primary %]; +} +/* Style to add a divider on the menu. */ +.popmenu li li[class~="divider"] { + border-bottom-width: 1px; + border-bottom-color: [% css_colors.border_dark %]; + border-bottom-style: solid; +} -- 2.11.0