LP#1433328: Add class attribute to e-resource links in TPAC
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Tue, 17 Mar 2015 21:53:05 +0000 (14:53 -0700)
committerBen Shum <bshum@biblio.org>
Mon, 17 Aug 2015 16:42:00 +0000 (12:42 -0400)
In the TPAC, links to electronic resources are not directly, uniquely
identifiable in the DOM. You can specify these links indirectly, with
something like '.result_table_title_cell > td > a' in search results
or '.rdetail_uri > a' on the record details page, but this is fragile
and a bit cumbersome. Adding a unique class attribute directly to the
link elements would make things easier for services built on top of
the TPAC, such as Overdrive API integration or JS-based analytics for
e-resources.

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index 618a887..76f45ff 100644 (file)
@@ -136,7 +136,7 @@ IF num_uris > 0;
         [%- ELSE -%]
             <li class="rdetail_uri" property="offers" vocab="http://schema.org/" typeof="Offer">
         [%- END -%]
-        <a href="[% uri.href %]" property="url">
+        <a href="[% uri.href %]" class="uri_link" property="url">
         [%- IF uri.href != uri.link;
                 '<span property="description">' _ uri.link _ '</span>';
             ELSE;
index bb9c472..06cf8b4 100644 (file)
@@ -302,7 +302,7 @@ END;
                                                                 <td valign='top'>
                                                                     <strong>[% l('Electronic resource') %]</strong>
                                                                 </td>
-                                                                <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
+                                                                <td><a href="[% uri.href %]" class="uri_link">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
                                                             </tr>
                                                             [% END %]
                                                          [% END %]