LP1906855 Show Covers in My Account
authorTerran McCanna <tmccanna@georgialibraries.org>
Thu, 24 Jun 2021 19:26:36 +0000 (15:26 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 20 Sep 2021 16:06:20 +0000 (12:06 -0400)
Adds covers to current circs, circ history, current holds,
holds history, and list tables.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Mary Llewellyn <mllewell@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/templates-bootstrap/opac/css/mediaQuery.css.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/circ_history.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/circs.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/holds.tt2
Open-ILS/src/templates-bootstrap/opac/myopac/lists.tt2
Open-ILS/src/templates-bootstrap/opac/parts/misc_util.tt2

index 6105543..538087b 100644 (file)
@@ -100,19 +100,21 @@ only screen and (max-width: 650px)  {
     .chargesMainTable td:nth-of-type(7):before { content: "Returned/Renewed"; display: flex;}
 
     .activeHoldstable td:nth-of-type(1):before { content: "Select"; display: flex; }
-    .activeHoldstable td:nth-of-type(2):before { content: "Title"; display: flex; }
-    .activeHoldstable td:nth-of-type(3):before { content: "Author"; display: flex;}
-    .activeHoldstable td:nth-of-type(4):before { content: "Format"; display: flex;}
-    .activeHoldstable td:nth-of-type(5):before { content: "Pickup Location"; display: flex;}
-    .activeHoldstable td:nth-of-type(6):before { content: "Cancel If Not Filled By"; display: flex;}
-    .activeHoldstable td:nth-of-type(7):before { content: "Status"; display: flex;}
-    .activeHoldstable td:nth-of-type(8):before { content: "Notes"; display: flex;}
-
-    .holdHistoryTable td:nth-of-type(1):before { content: "Title"; display: flex; }
-    .holdHistoryTable td:nth-of-type(2):before { content: "Author"; display: flex; }
-    .holdHistoryTable td:nth-of-type(3):before { content: "Format"; display: flex; }
-    .holdHistoryTable td:nth-of-type(4):before { content: "Pickup Location"; display: flex; }
-    .holdHistoryTable td:nth-of-type(5):before { content: "Status"; display: flex; }
+    .activeHoldstable td:nth-of-type(2):before { content: "Cover"; display: flex; }
+    .activeHoldstable td:nth-of-type(3):before { content: "Title"; display: flex; }
+    .activeHoldstable td:nth-of-type(4):before { content: "Author"; display: flex;}
+    .activeHoldstable td:nth-of-type(5):before { content: "Format"; display: flex;}
+    .activeHoldstable td:nth-of-type(6):before { content: "Pickup Location"; display: flex;}
+    .activeHoldstable td:nth-of-type(7):before { content: "Cancel If Not Filled By"; display: flex;}
+    .activeHoldstable td:nth-of-type(8):before { content: "Status"; display: flex;}
+    .activeHoldstable td:nth-of-type(9):before { content: "Notes"; display: flex;}
+
+    .holdHistoryTable td:nth-of-type(1):before { content: "Cover"; display: flex; }
+    .holdHistoryTable td:nth-of-type(2):before { content: "Title"; display: flex; }
+    .holdHistoryTable td:nth-of-type(3):before { content: "Author"; display: flex; }
+    .holdHistoryTable td:nth-of-type(4):before { content: "Format"; display: flex; }
+    .holdHistoryTable td:nth-of-type(5):before { content: "Pickup Location"; display: flex; }
+    .holdHistoryTable td:nth-of-type(6):before { content: "Status"; display: flex; }
 
     .paymentTable td:nth-of-type(1):before { content: "Payment Date"; display: flex; }
     .paymentTable td:nth-of-type(2):before { content: "Payment For"; display: flex; }
@@ -126,29 +128,32 @@ only screen and (max-width: 650px)  {
     .messagesTable td:nth-of-type(5):before { content: ""; display: flex; }
 
     .circTable td:nth-of-type(1):before { content: "Select"; display: flex; }
-    .circTable td:nth-of-type(2):before { content: "Title"; display: flex; }
-    .circTable td:nth-of-type(3):before { content: "Author"; display: flex; }
-    .circTable td:nth-of-type(4):before { content: "Renewals Left"; display: flex; }
-    .circTable td:nth-of-type(5):before { content: "Due Date"; display: flex; }
-    .circTable td:nth-of-type(6):before { content: "Barcode"; display: flex; }
-    .circTable td:nth-of-type(7):before { content: "Call Number"; display: flex; }
+    .circTable td:nth-of-type(2):before { content: "Cover"; display: flex; }
+    .circTable td:nth-of-type(3):before { content: "Title"; display: flex; }
+    .circTable td:nth-of-type(4):before { content: "Author"; display: flex; }
+    .circTable td:nth-of-type(5):before { content: "Renewals Left"; display: flex; }
+    .circTable td:nth-of-type(6):before { content: "Due Date"; display: flex; }
+    .circTable td:nth-of-type(7):before { content: "Barcode"; display: flex; }
+    .circTable td:nth-of-type(8):before { content: "Call Number"; display: flex; }
 
     .circHistTable td:nth-of-type(1):before { content: "Select"; display: flex; }
-    .circHistTable td:nth-of-type(2):before { content: "Title"; display: flex; }
-    .circHistTable td:nth-of-type(3):before { content: "Author"; display: flex; }
-    .circHistTable td:nth-of-type(4):before { content: "Checkout Date"; display: flex; }
-    .circHistTable td:nth-of-type(5):before { content: "Due Date"; display: flex; }
-    .circHistTable td:nth-of-type(6):before { content: "Date Returned"; display: flex; }
-    .circHistTable td:nth-of-type(7):before { content: "Barcode"; display: flex; }
-    .circHistTable td:nth-of-type(8):before { content: "Call Number"; display: flex; }
-
-    .bookbagTable td:nth-of-type(1):before { content: ""; display: flex; }
-    .bookbagTable td:nth-of-type(2):before { content: "Title"; display: flex; }
-    .bookbagTable td:nth-of-type(3):before { content: "Author(s)"; display: flex; }
-    .bookbagTable td:nth-of-type(4):before { content: "Local Call number"; display: flex; }
-    .bookbagTable td:nth-of-type(5):before { content: "Publication Date"; display: flex; }
-    .bookbagTable td:nth-of-type(6):before { content: "Format"; display: flex; }
-    .bookbagTable td:nth-of-type(7):before { content: "Notes"; display: flex; }
+    .circHistTable td:nth-of-type(2):before { content: "Cover"; display: flex; }
+    .circHistTable td:nth-of-type(3):before { content: "Title"; display: flex; }
+    .circHistTable td:nth-of-type(4):before { content: "Author"; display: flex; }
+    .circHistTable td:nth-of-type(5):before { content: "Checkout Date"; display: flex; }
+    .circHistTable td:nth-of-type(6):before { content: "Due Date"; display: flex; }
+    .circHistTable td:nth-of-type(7):before { content: "Date Returned"; display: flex; }
+    .circHistTable td:nth-of-type(8):before { content: "Barcode"; display: flex; }
+    .circHistTable td:nth-of-type(9):before { content: "Call Number"; display: flex; }
+
+    .bookbagTable td:nth-of-type(1):before { content: "Select"; display: flex; }
+    .bookbagTable td:nth-of-type(2):before { content: "Cover"; display: flex; }
+    .bookbagTable td:nth-of-type(3):before { content: "Title"; display: flex; }
+    .bookbagTable td:nth-of-type(4):before { content: "Author(s)"; display: flex; }
+    .bookbagTable td:nth-of-type(5):before { content: "Local Call number"; display: flex; }
+    .bookbagTable td:nth-of-type(6):before { content: "Publication Date"; display: flex; }
+    .bookbagTable td:nth-of-type(7):before { content: "Format"; display: flex; }
+    .bookbagTable td:nth-of-type(8):before { content: "Notes"; display: flex; }
 
     .eholdsTable td:nth-of-type(1):before { content: "Title"; display: flex; }
     .eholdsTable td:nth-of-type(2):before { content: "Author"; display: flex; }
index 0c14daa..c057a4a 100755 (executable)
@@ -53,6 +53,7 @@
                     <td class="checkCell">
                         <input type="checkbox" onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ_id' && !inputs[i].disabled) inputs[i].checked = this.checked;}" aria-label="[% l('Click to (un)select all items') %]"/>
                     </td>
+                    <th>[% l("Cover") %]</th>
                     <th>[% sort_head("sort_title", l("Title")) %]</th>
                     <th>[% sort_head("author", l("Author")) %]</th>
                     <th>[% sort_head("callnum", l("Call Number")) %]</th>
             <td class="checkbox_column">
                 <input type="checkbox" name="circ_id" value="[% circ.circ.id %]" aria-label="Select Item"/>
             </td>
+                        [%  IF circ.ATTRS.issns.0;
+                                row_isbnissn = circ.ATTRS.issns.0;
+                            ELSIF circ.ATTRS.isbns.0;
+                                row_isbnissn = circ.ATTRS.isbns.0;
+                            ELSE;
+                                row_isbnissn = '';
+                            END;
+                            row_rec_id = circ.circ.target_copy.call_number.record.id;
+                            row_title = circ.ATTRS.title;
+                            PROCESS show_cover;
+                        %]
                         <td>
                           [% IF circ.circ.target_copy.call_number.id == -1 %]
                                 [% circ.circ.target_copy.dummy_title | html %]
index 91f8d33..a636cda 100755 (executable)
@@ -44,6 +44,7 @@
                         onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'circ' &amp;&amp; !inputs[i].disabled) inputs[i].checked = this.checked;}"
                     />
                 </td>
+                <th>[% l("Cover") %]</th>
                 <th>[% sort_head("sort_title", l("Title")) %]</th>
                 <th>[% sort_head("author", l("Author")) %]</th>
                 <th>[% sort_head("renews", l("Renewals Left")) %]</th>
                                 [% IF circ.circ.renewal_remaining < 1 %] disabled="disabled" [% END %]
                                 value="[% circ.circ.id %]" />
                         </td>
+                        [%  IF circ.ATTRS.issns.0;
+                                row_isbnissn = circ.ATTRS.issns.0;
+                            ELSIF circ.ATTRS.isbns.0;
+                                row_isbnissn = circ.ATTRS.isbns.0;
+                            ELSE;
+                                row_isbnissn = '';
+                            END;
+                            row_rec_id = circ.circ.target_copy.call_number.record.id;
+                            row_title = circ.ATTRS.title;
+                            PROCESS show_cover;
+                        %]
                         <td>
                             <span class="sr-only">Title</span>
                             [% IF circ.circ.target_copy.call_number.id == -1 %]
index 2683099..ff0b543 100755 (executable)
@@ -50,6 +50,7 @@
         <table id='acct_holds_hist_header' class='table table-hover table-bordered miniTable holdHistoryTable' title="[% l('History of items on hold') %]">
             <thead>
                 <tr>
+                    <th>[% l("Cover") %]</th>
                     <th><span>[% l('Title') %]</span></th>
                     <th><span>[% l('Author') %]</span></th>
                     <th> <span>[% l('Format') %]</span></th>
                     ahr = hold.hold.hold %]
 
                 <tr>
-
+                    [%  IF hold.ATTRS.issns.0;
+                            row_isbnissn = hold.ATTRS.issns.0;
+                        ELSIF hold.ATTRS.isbns.0;
+                            row_isbnissn = hold.ATTRS.isbns.0;
+                        ELSE;
+                            row_isbnissn = '';
+                        END;
+                        row_rec_id = hold.hold.bre_id;
+                        row_title = hold.ATTRS.title;
+                        PROCESS show_cover;
+                    %]
                     <td>
                     <span class="sr-only">Title</span>
                         <div>
index 07130d3..590253e 100755 (executable)
@@ -81,6 +81,7 @@
                     <input type="checkbox" aria-label="[% l('Select All Holds') %]"
                       onclick="var inputs=document.getElementsByTagName('input'); for (i = 0; i < inputs.length; i++) { if (inputs[i].name == 'hold_id' &amp;&amp; !inputs[i].disabled) inputs[i].checked = this.checked;}"/>
                 </td>
+                <th>[% l("Cover") %]</th>
                 <th>[% sort_head("sort_title", l('Title')) %]</th>
                 <th>[% sort_head("author", l('Author')) %]</th>
                 <th>[% sort_head("format", l('Format')) %]</th>
                         <input type="checkbox" name="hold_id" value="[% ahr.id %]"
                             [% html_text_attr('title', l('Select hold [_1]', attrs.title)) %]/>
                     </td>
+                    [%  IF hold.ATTRS.issns.0;
+                            row_isbnissn = hold.ATTRS.issns.0;
+                        ELSIF hold.ATTRS.isbns.0;
+                            row_isbnissn = hold.ATTRS.isbns.0;
+                        ELSE;
+                            row_isbnissn = '';
+                        END;
+                        row_rec_id = hold.hold.bre_id;
+                        row_title = hold.ATTRS.title;
+                        PROCESS show_cover;
+                    %]
                     <td>
                     <span class="sr-only">Title</span>
                         <div>
index 3735e18..4ddd11f 100755 (executable)
 
                     </th>
                     <th class="list_entry">
+                        [% l("Cover") %]
+                    </th>
+                    <th class="list_entry">
                         <a href="[% mkurl(ctx.opac_root _ '/myopac/lists', {sort=> (CGI.param('sort') == 'titlesort' ? 'titlesort.descending' : 'titlesort')}) %]">[% l('Title') %]</a>
                     </th>
                     <th class="list_entry">
                     <td class="list_checkbox">
                         <input type="checkbox" name="selected_item" value="[% item.id %]" bbag='[% bbag.id %]'/>
                     </td>
+                    [%  IF attrs.issns.0; 
+                            row_isbnissn = attrs.issns.0;
+                        ELSIF attrs.0;
+                            row_isbnissn = attrs.isbns.0;
+                        ELSE;
+                            row_isbnissn = '';
+                        END;
+                        row_rec_id = rec_id;
+                        row_title = attrs.title;
+                        PROCESS show_cover;
+                    %]
                     <td class="list_entry" data-label="[% l('Title') %]">
                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec_id, {}, ['edit_notes', 'bbid']) %]">[% attrs.title | html %]</a>
                     </td>
index a374902..86f267d 100755 (executable)
 </div>
 [% END -%]
 [% END -%]
+
+[% BLOCK show_cover %]
+    <td>
+    <span class="sr-only">[% l('Cover Image') %]</span>
+    [% IF obalkyknih_cz.enabled == 'true' %]
+        [% IF (matches = row_isbnissn.match('^(.+?)(\s.+)$'));
+            row_isbnissn = matches.0;
+        END %]
+        <a href='http://obalkyknih.cz/view?isbn=[% row_isbnissn %]'>
+    [% ELSE %]
+        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/medium/r/[% row_rec_id | uri %]'>
+    [% END %]
+    <img alt="[% row_title _ ' Cover Image' %]" class='my-2' style="max-width:70px;"
+            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/medium/r/[% row_rec_id | uri %]'/>
+    </a>
+    </td>
+[% END %]
+
+
+