From 4f1a4030660e52282722a2b22165535bf4af7c44 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Thu, 15 Apr 2021 15:50:55 -0400 Subject: [PATCH] LP1907863 Bootstrap Opac: My Lists formatting This patch moves the buttons for each list row underneath the title and descriptions fields. It makes the create list form collapsible using a button. If there are lists, the create form is collapsed. The create form is expanded on load, if the user selects move bucket to new list, or add rec to new list from a menu or button from another page. The "Move contents of basket to this list?" in the creation form now defaults to 'yes' if an option to move a basket to a new list is chosen from a menu. It adds localization functions to the button texts and removes a dangling in anon-list.tt2 It moves the create form from a design and uses Bootstrap elements instead. To Test. 1. After applying the patch view the list page and notice that the form is expanded. 2. Create a list. The form is now collapse. 3. Perform a search and add some of the titles to a basket. 4. From one of the result rows drop-down the Add to My List menu and select 'Add to New List'. The form is expanded and the "Move contents of basket to this list" should be 'yes'. 5. From the basket screen or from the lists screen click on the 'Add to New List' button. The results should be the same as step 4. 6. After creating a few lists, notice that the buttons for each list are now displayed under the list title and description and each row is distinguished by a bottom border. Signed-off-by: Garry Collum Signed-off-by: Michele Morgan --- .../src/templates-bootstrap/opac/myopac/lists.tt2 | 224 ++++++++++----------- .../templates-bootstrap/opac/parts/anon_list.tt2 | 13 +- .../opac/parts/bookbag_actions.tt2 | 2 +- 3 files changed, 117 insertions(+), 122 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2 index 4ddd11f4b8..0cad4832dc 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2 @@ -5,6 +5,7 @@ limit = ctx.bookbags_limit; offset = ctx.bookbags_offset; item_page = ctx.bookbags_item_page; + move_cart_by_default = CGI.param('move_cart_by_default') || 0; bb_publish_text = l( "Sharing a list means that the contents " _ "of the list will be visible to others. " _ @@ -13,85 +14,72 @@ %] -

[% l('My Lists') %]

-
+
-
-

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

-
- - - - - - - - - - - - +
+ +
+
+ + [%- INCLUDE "opac/parts/preserve_params.tt2"; %] + + [% IF ctx.add_rec %] + + [% END %] + [% IF ctx.where_from %] + + [% END %] +
+ + +
+
+ + +
+
+ + + + + +
[% IF ctx.mylist.size %] -
- - - +
+ + +
[% END %] - - - - -
- - - [%- INCLUDE "opac/parts/preserve_params.tt2"; %] - - - [% IF ctx.add_rec %] - - [% END %] - [% IF ctx.where_from %] - - [% END %] -
- - - -
- - - - - - -
- - - -
  - - - -
- + + + + +
[% IF (CGI.param('from_basket') && ctx.mylist.size) %]

[% l("... from basket") %]

[% INCLUDE "opac/parts/anon_list.tt2" %] [% ELSE %] -

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

[% INCLUDE "opac/parts/anon_list.tt2" %] +
+ +
+

[% l('Saved Lists') %]

+ - [% IF ctx.bookbags.size %] -
- [% l('Saved Lists') %] + [% IF !ctx.bookbags.size %] +
+

[% l("You don't have any lists yet") %]

+ [% l('Create a list with the form above') %] + + [% ELSE %] [% IF limit < ctx.bookbag_count; %] [%- IF offset > 0 -%] @@ -141,40 +129,40 @@
[% FOR bbag IN ctx.bookbags %] -
- - - - - -
-
- [% 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.pub == 't'; %] - - - [% END %]

- [% IF bbag.description %]
[% bbag.description | html %]
[% END %] +
+
+ [% 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.pub == 't'; %] + + + [% END %]

-
- [% IF ctx.add_rec %] -
-
- - - - [% IF ctx.where_from %] - +
+ [% bbag.description | html %] +
+
+
+ [% IF ctx.add_rec %] + +
+ + + + [% IF ctx.where_from %] + + [% END %] + +
+ [% END %] - -
- - [% END %] +
@@ -197,6 +185,7 @@
+ [% setting = 'opac.default_list'; %]
@@ -211,6 +200,8 @@ [% END %]
+ + [% IF ctx.is_staff %]
[% END %] + [% IF bbag.pub == 't'; %]
+
+ + [% IF CGI.param("bbid") == bbag.id %]
@@ -266,10 +262,10 @@
[% IF bbag.items.size %]
- - - - + + + +
[% END %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/anon_list.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/anon_list.tt2 index 5aa31810f0..aa28996d18 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/anon_list.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/anon_list.tt2 @@ -10,12 +10,12 @@
- - - - + + + + - + 1, from_basket => 1}) %]> [% l('Add to New List') %]
[% l('Add to new list') %] -- 2.11.0