LP1909583 Bootstrap Opac: Cannot edit title and description
authorGarry Collum <gcollum@gmail.com>
Fri, 29 Jul 2022 22:03:18 +0000 (22:03 +0000)
committerMichele Morgan <mmorgan@noblenet.org>
Wed, 28 Sep 2022 20:46:58 +0000 (16:46 -0400)
Fixes the editing of the title and description in the Bootstrap Opac lists.
Adds and Edit List button with a collapsible form.

To Test:
1. Create several lists in the Opac.
2. Notice you are unable to edti the title or description.
3. Apply the patch
4. Use the Edit List button to display an editable form for each individual
list.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/templates-bootstrap/opac/css/mediaQuery.css.tt2
Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2

index e8db387..d98c372 100644 (file)
@@ -296,6 +296,7 @@ only screen and (max-width: 650px)  {
         margin-bottom:5px;
         padding:5px;
     }
+/*
     #bbag-edit-name {
         [% IF rtl == 't' -%]
         float: right;
@@ -308,6 +309,7 @@ only screen and (max-width: 650px)  {
         width: 220px;
         margin-top:5px;
     }
+*/
     .bbag-content {
         padding:5px;
         border:1px solid [% css_colors.accent_light %];
index b774292..7565e33 100755 (executable)
@@ -2539,6 +2539,7 @@ h2.bookbag-name { margin-bottom: 0em; padding-bottom: 0em; }
     font-style: italic;
     max-width: 40em;
 }
+/*
 .bbag-edit-desc-label {
     [% IF rtl == 't' -%]
     float:right;
@@ -2567,6 +2568,8 @@ h2.bookbag-name { margin-bottom: 0em; padding-bottom: 0em; }
     float: left;
     [% END -%]
 }
+*/
+
 .bbag-action {
     [% IF rtl == 't' -%]
     margin-right: 15px;
@@ -3226,6 +3229,7 @@ a.preflib_change {
         margin-bottom:5px;
         padding:5px;
     }
+/*
     #bbag-edit-name {
         [% IF rtl == 't' -%]
         float: right;
@@ -3238,6 +3242,7 @@ a.preflib_change {
         width: 220px;
         margin-top:5px;
     }
+*/
     .bbag-content {
         padding:5px;
         border:1px solid [% css_colors.accent_light %];
index 0cad483..45bba81 100755 (executable)
                         {page => '0', bookbag => bbag.id, depth => 0, locg => ctx.search_ou},
                         1
                     )
-                -%]'><i class="fas fa-glasses" aria-hidden="true"></i> [% l('View in Catalogue') %]</a>
+                -%]'><i class="fas fa-glasses" aria-hidden="true"></i> [% l('View in Catalog') %]</a>
 
             </div>
                [% END %]
 
+            <div class="bookbag-controls">
+                <button class="btn btn-action btn-sm m-1" data-toggle="collapse" data-target="#bbag-edit-div-[% bbag.id %]"><i class="fa fa-edit" aria-hidden="true"></i> [% l('Edit List') %]</button>
+            </div>
+
                     </div>
                 <div class="col-3">
                     <form action="[% mkurl(ctx.opac_root _ '/myopac/list/update') %]" method="post" onsubmit="return confirm('[% l('Do you really want to delete this list?') %]')">
             </div>
         </div>
 
+        <div id="bbag-edit-div-[% bbag.id %]" class="row collapse">
+            <div class="col-12 mt-3 p-2 bg-light">
+            <h5>[% l('Edit List Description') %]</h5>
+            <form method="post">
+                <div class="form-group">
+                    <label for="bbag-edit-name">[% l('Name:') %]</label>
+                    <input class="form-control" name="name" type="text" value="[% bbag.name | html %]" id="bbag-edit-name" />
+                </div>
+                <div class="form-group">
+                <label for="bbag-edit-description">[% l('Description:') %]</label>
+                <textarea name="description" class="form-control"
+                    id="bbag-edit-description">[% bbag.description | html %]
+                </textarea>
+                </div>
+                <input type="hidden" name="bbid" value="[% bbag.id %]" />
+                <input type="hidden" name="action" value="editmeta" />
+                <input type="hidden" name="limit" value="[% limit %]" />
+                <input type="hidden" name="offset" value="[% offset %]" /> 
+                [%- INCLUDE "opac/parts/preserve_params.tt2"; %]
+                <input type="submit" class="btn btn-action btn-sm" value="[% l('Save') %]" />
+            </form>
+            </div>
+        </div>
         
         [% IF CGI.param("bbid") == bbag.id %]