TPAC: Change title tooltip in results table to useful message
authorBill Erickson <berick@esilibrary.com>
Mon, 19 Dec 2011 17:57:08 +0000 (12:57 -0500)
committerDan Scott <dan@coffeecode.net>
Wed, 21 Dec 2011 21:28:23 +0000 (16:28 -0500)
From dbs's original commit:

The tooltip that would display when hovering over the title of a result
in the results table was simply the URI-escaped version of the title
text - not particularly helpful. Change this to say "Display record
details" as an actual hint about what action will occur when the user
clicks on a title in the results list.

This modified commit changes the title to 'Display record details for
"<title>"'

This commit also introduces the HTML plugin as a new
loaded-by-default template plugin.  Among other things, it's useful for
ensuring HTML attributes are safely encoded, moresoe than |html, which
does not escape quotes.

https://bugs.launchpad.net/evergreen/+bug/902979

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dan@coffeecode.net>
Open-ILS/src/templates/opac/parts/header.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index e6addc8..ce51900 100644 (file)
@@ -2,6 +2,7 @@
     USE date;
     USE CGI = CGI_utf8;
     USE POSIX;
+    USE HTML;
     SET DATE_FORMAT = l('%m/%d/%Y');
 
     # Don't wrap in l() here; do that where this format string is actually used.
index 1ae2b17..6be3122 100644 (file)
@@ -46,8 +46,9 @@
                                                 name='result_table_title_cell'
                                                 valign="top">
                                                 <div class="bold">
-                                                    <a name='record_[% rec.id %]' title="[% attrs.title | uri %]" name='item_title'
+                                                    <a name='record_[% rec.id %]' name='item_title'
                                                         href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
+                                                        [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
                                                         class='search_link'>[% attrs.title | html %]</a>
                                                 </div>
                                                 <div>