LP1916936-Bootstrap opac: item tags display as separate copies on small screen.
authorGarry Collum <gcollum@gmail.com>
Thu, 25 Feb 2021 21:02:50 +0000 (16:02 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 26 May 2021 19:05:33 +0000 (15:05 -0400)
This fixes the display of item tags and item notes in the bootstrap opac.
It also cleans up some <a> tags that had class defined twice.

To test.
1. Add an item tag and an item note to an item.
2. In the bootstrap opac make the screen as small as possible.
   Notice that the display shows the tags and items as copies.
3. Apply the patch and repeat.  The tags and notes should be displayed with the item that they are associated with.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Mary Llewellyn <mllewell@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2

index 74faa1e..bc9cad1 100755 (executable)
@@ -1146,6 +1146,14 @@ div.format_icon {
     margin:0;
 }
 
+span.copy_note_label {
+    font-weight: bold;
+}
+
+span.copy_tag_type_label {
+    font-weight: bold;
+}
+
 #gbp_extra, #gbp_arrow_down_link {
     display: none;
 }
index dad40fd..489c3f2 100755 (executable)
@@ -154,7 +154,31 @@ END; # FOREACH bib
             </td>[% END %]
             <td><span property="sku">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc')
                 OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn',
-               {copy_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]</td>
+               {copy_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]
+
+       [% IF copy_info.notes; %]
+            [% FOREACH note IN copy_info.notes; %]
+                <div><span class="copy_note_label">[% note.title _ ": " | html %]</span><span class="copy_note_value">[% note.value | html %]</span></div>
+            [% END %]
+        [% END %]
+
+       [% IF copy_info.tags; %]
+            [% FOREACH tag IN copy_info.tags; %]
+                    <div>
+                    <span class="copy_tag_type_label">[% tag.tag_type.label _ ": " | html %]</span>
+                        <span class="copy_tag_value">
+                        [% IF tag.url %]
+                            <a href="[% tag.url | html %]">
+                            [% END %]
+                                [% tag.value | html %]
+                            [% IF tag.url %]
+                            </a>
+                            [% END %]
+                        </span>
+                    </div>
+            [% END %]
+        [% END %]
+        </td>
             [%- IF has_parts == 'true' %]
             <td>[% copy_info.part_label | html %]</td>
             [%- END %]
@@ -286,33 +310,6 @@ END; # FOREACH bib
             [%- END %]
         </tr>
 
-        [% IF copy_info.notes; %]
-            [% FOREACH note IN copy_info.notes; %]
-                <tr><td>&nbsp;</td><td class="copy_note" colspan="4" property="description"><strong>[% note.title | html %]:</strong> [% note.value | html %]</td></tr>
-            [% END %]
-        [% END %]
-
-        [% IF copy_info.tags; %]
-            [% FOREACH tag IN copy_info.tags; %]
-                <tr class="copy_tag_row">
-                    <td>&nbsp;</td>
-                    <td class="copy_tag" colspan="4">
-                    <span class="copy_tag_type_label">[% tag.tag_type.label _ ": " | html %]</span>
-                        <span class="copy_tag_value">
-                        [% IF tag.url %]
-                            <a href="[% tag.url | html %]">
-                            [% END %]
-                                [% tag.value | html %]
-                            [% IF tag.url %]
-                            </a>
-                            [% END %]
-                        </span>
-                    </td>
-                </tr>
-            [% END %]
-        [% END %]
-
-
 [%- IF copy_info.peer_bib_marc.size > 0;
 '<tr><td><ul>';
     FOREACH bib IN copy_info.peer_bib_marc;
index 851e3bd..2396e6f 100755 (executable)
@@ -356,9 +356,8 @@ ctx.metalinks.push('
                 )
                 %]
                 
-                    <a class="btn btn-action" role="button" href="[% mkurl(ctx.opac_root _ '/place_hold',
-                    {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]"
-                        class="no-dec">
+                    <a class="btn btn-action no-dec" role="button" href="[% mkurl(ctx.opac_root _ '/place_hold',
+                    {hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]">
                         <span class="place_hold"><i class="fas fa-check" aria-hidden="true"></i> [% l('Place Hold') %]</span></a>
               
                 [%- END -%]
@@ -366,17 +365,17 @@ ctx.metalinks.push('
                 [%- IF ebook_api.enabled == 'true' && args.ebook %]
               
                     <div id="[%- ctx.bre_id -%]_ebook_checkout" class="rdetail_aux_utils ebook_action hidden">
-                        <a class="btn btn-action" role="button" href="[% mkurl(ctx.opac_root _ '/myopac/ebook_checkout',
+                        <a class="btn btn-action no-dec" role="button" href="[% mkurl(ctx.opac_root _ '/myopac/ebook_checkout',
                     {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'checkout'}, stop_parms) %]"
-                            class="no-dec" rel="nofollow" vocab="">
+                            rel="nofollow" vocab="">
                             <span class="place_hold"><i class="fas fa-check" aria-hidden="true"></i> [% l('Check Out E-Item') %]</span></a>
                     </div>
                
                
                     <div id="[%- ctx.bre_id -%]_ebook_place_hold" class="rdetail_aux_utils ebook_action hidden">
-                        <a class="btn btn-action" role="button" href="[% mkurl(ctx.opac_root _ '/myopac/ebook_place_hold',
+                        <a class="btn btn-action no-dec" role="button" href="[% mkurl(ctx.opac_root _ '/myopac/ebook_place_hold',
                     {title => args.ebook.ebook_id, vendor => args.ebook.vendor, action => 'place_hold'}, stop_parms) %]"
-                            class="no-dec" rel="nofollow" vocab="">
+                             rel="nofollow" vocab="">
                             <span class="place_hold"><i class="fas fa-check" aria-hidden="true"></i> [% l('Place Hold on E-Item') %]</span></a>
                     </div>
                
@@ -442,7 +441,7 @@ ctx.metalinks.push('
                 [% IF !search.no_highlight %]
                
                     [% IF CGI.param('no_highlight') %]
-                    <a class="btn btn-action" role="button" href="[% mkurl('', {}, ['no_highlight']) %]" class="no-dec">
+                    <a class="btn btn-action no-dec" role="button" href="[% mkurl('', {}, ['no_highlight']) %]">
                         [% ELSE %]
                         <a href="[% mkurl('', {no_highlight => '1'}) %]" class="btn btn-action" role="button">
                             [% END %]