From: Bill Erickson Date: Wed, 29 Oct 2014 21:06:17 +0000 (-0400) Subject: KMAIN-348 - Add Page Number Navigation to My Lists X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7ed134b218e5f4b437a951fbafc69bf6ef8e84c8;p=working%2FEvergreen.git KMAIN-348 - Add Page Number Navigation to My Lists Cross-port: 6e75f1b Conflicts: Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm --- diff --git a/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 b/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 index b37c99377c..8b51401bce 100644 --- a/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/myopac/lists.tt2 @@ -80,12 +80,47 @@ [%- IF offset > 0 -%] limit, offset => (offset - limit) + offset => (offset - limit) }) %]'>[% l('Previous') %] [%- END; -%] + + [%- IF (offset - (limit * 3)) >= 0 -%] + (offset - (limit * 3)) + }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %] + [%- END; -%] + [%- IF (offset - (limit * 2)) >= 0 -%] + (offset - (limit * 2)) + }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %] + [%- END; -%] + [%- IF (offset - limit) >= 0 -%] + (offset - limit) + }) %]'>[% ((offset - limit) / limit) + 1 %] + [%- END; -%] + + [% (offset / limit) + 1 %] + + [%- IF (ctx.bookbag_count - offset) > limit; -%] + (offset + limit) + }) %]'>[% ((offset + limit) / limit) + 1 %] + [%- END; -%] + [%- IF (ctx.bookbag_count - offset) > limit * 2; -%] + (offset + (limit * 2)) + }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %] + [%- END; -%] + [%- IF (ctx.bookbag_count - offset) > limit * 3; -%] + (offset + (limit * 3)) + }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %] + [%- END; -%] + [%- IF (ctx.bookbag_count - offset) > limit; -%] limit, offset => (offset + limit) + offset => (offset + limit) }) %]'>[% l('Next') %] [%- END; -%] @@ -261,12 +296,47 @@ [%- IF offset > 0 -%] limit, offset => (offset - limit) + offset => (offset - limit) }) %]'>[% l('Previous') %] [%- END; -%] + + [%- IF (offset - (limit * 3)) >= 0 -%] + (offset - (limit * 3)) + }) %]'>[% ((offset - (limit * 3)) / limit) + 1 %] + [%- END; -%] + [%- IF (offset - (limit * 2)) >= 0 -%] + (offset - (limit * 2)) + }) %]'>[% ((offset - (limit * 2)) / limit) + 1 %] + [%- END; -%] + [%- IF (offset - limit) >= 0 -%] + (offset - limit) + }) %]'>[% ((offset - limit) / limit) + 1 %] + [%- END; -%] + + [% (offset / limit) + 1 %] + + [%- IF (ctx.bookbag_count - offset) > limit; -%] + (offset + limit) + }) %]'>[% ((offset + limit) / limit) + 1 %] + [%- END; -%] + [%- IF (ctx.bookbag_count - offset) > limit * 2; -%] + (offset + (limit * 2)) + }) %]'>[% ((offset + (limit * 2)) / limit) + 1 %] + [%- END; -%] + [%- IF (ctx.bookbag_count - offset) > limit * 3; -%] + (offset + (limit * 3)) + }) %]'>[% ((offset + (limit * 3)) / limit) + 1 %] + [%- END; -%] + [%- IF (ctx.bookbag_count - offset) > limit; -%] limit, offset => (offset + limit) + offset => (offset + limit) }) %]'>[% l('Next') %] [%- 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 new file mode 100644 index 0000000000..99e7799f9f --- /dev/null +++ b/KCLS/openils/var/templates_kcls/opac/myopac/prefs_my_lists.tt2 @@ -0,0 +1,41 @@ +[% PROCESS "opac/parts/header.tt2"; + WRAPPER "opac/parts/myopac/prefs_base.tt2"; + myopac_page = "prefs_my_lists"; + prefs_page = 'my_lists' %] + + +
+ + + + + [% IF ctx.updated_user_settings %] + + [% END %] + + [%- setting = 'opac.lists_per_page' -%] + + + + + +
+
+ [% l('Account Successfully Updated') %] +
+
+ +
+ +
+ [% INCLUDE "opac/parts/myopac/prefs_hints.tt2" %] +[% END %] \ No newline at end of file diff --git a/KCLS/openils/var/templates_kcls/opac/parts/myopac/prefs_base.tt2 b/KCLS/openils/var/templates_kcls/opac/parts/myopac/prefs_base.tt2 index 1b641a6001..f350c73126 100644 --- a/KCLS/openils/var/templates_kcls/opac/parts/myopac/prefs_base.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/parts/myopac/prefs_base.tt2 @@ -15,6 +15,9 @@ [% END %]
+ +
+
[% ELSIF prefs_page == 'notify' %] @@ -24,10 +27,13 @@
+
+ +
- [% ELSE %] + [% ELSIF prefs_page == 'settings' %]
@@ -36,9 +42,27 @@ [% END %] +
+ +
+ [% ELSE %] +
+ +
+ [% IF ctx.opt_in_settings.size > 0 %] +
+ +
+ [% END %] +
+ +
+
+ +
[% END %] diff --git a/KCLS/sql/add_setting_for_selecting_lists_per_page_for_my_list.sql b/KCLS/sql/add_setting_for_selecting_lists_per_page_for_my_list.sql new file mode 100644 index 0000000000..aeeb5cc00b --- /dev/null +++ b/KCLS/sql/add_setting_for_selecting_lists_per_page_for_my_list.sql @@ -0,0 +1,23 @@ +-- Adds a setting for selecting the number of lists per page for my list. + +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' + ); +COMMIT; \ No newline at end of file diff --git a/Open-ILS/web/images/sub_prefs_my_lists_off.jpg b/Open-ILS/web/images/sub_prefs_my_lists_off.jpg new file mode 100644 index 0000000000..7a0a85ba1b Binary files /dev/null and b/Open-ILS/web/images/sub_prefs_my_lists_off.jpg differ diff --git a/Open-ILS/web/images/sub_prefs_my_lists_on.jpg b/Open-ILS/web/images/sub_prefs_my_lists_on.jpg new file mode 100644 index 0000000000..5669e3c9e8 Binary files /dev/null and b/Open-ILS/web/images/sub_prefs_my_lists_on.jpg differ