LP#1442260: include unread message count in page title
authorGalen Charlton <gmc@esilibrary.com>
Tue, 31 Mar 2015 21:03:14 +0000 (21:03 +0000)
committerBen Shum <bshum@biblio.org>
Fri, 10 Apr 2015 01:54:57 +0000 (21:54 -0400)
If a patron is logged in and has at least one unread message,
the count of unread messages is prepended to the page title
for all TPAC pages.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/base.tt2

index 540525d..8c24507 100644 (file)
         [%- libname = ctx.get_aou(ctx.search_ou).name;
             libname = libname | html;
             libsname = ctx.get_aou(ctx.search_ou).shortname; %]
-        <title>[% l('[_1] - [_2]', ctx.page_title, libname) %]</title>
+        <title>[%- IF ctx.user_stats.messages.unread;
+                      l('([_1])', ctx.user_stats.messages.unread);
+                   END;
+               -%]
+               [% l('[_1] - [_2]', ctx.page_title, libname) %]</title>
         <link rel="unapi-server" type="application/xml" title="unAPI" href="/opac/extras/unapi" />
         <link type="application/opensearchdescription+xml" rel='search' title="[% l('[_1] OpenSearch', libname) %]" href="/opac/extras/opensearch/1.1/[% libsname | uri %]/-/osd.xml" />
         [%-# Hook for page-specific metadata such as <meta name="robots" content="noindex"> %]