From e1ebabf3ec488bc742b6926a64b758f7f6912989 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 26 Jan 2012 15:00:36 -0500 Subject: [PATCH] Bug 7127 - Follow-up - Templates must be valid XHTML Corrections to OPAC search results and lists pages for validity errors: duplicate ids, invalidly placed elements, unescaped ampersands. The change to localcovers.js adds a check for in addition to
so that the results template can use a The
tag has been removed from the inline tag entry markup in order to correct a display error in Internet Explorer 8. Removing it doesn't affect functionality or validity. To test: Validate the HTML of the OPAC results page and an OPAC list contents page (/cgi-bin/koha/opac-shelves.pl?viewshelf=XX). Verify the functinality of adding tags on both pages with the TagsInputOnList system preference enabled. Verify that local cover images are display on search results and detail pages. Includes fixes for errors spotted by QA Revisions Signed-off-by: Ian Walls Signed-off-by: Paul Poulain --- .../prog/en/includes/page-numbers.inc | 6 +++--- koha-tmpl/opac-tmpl/prog/en/js/localcovers.js | 2 +- .../opac-tmpl/prog/en/modules/opac-results.tt | 13 +++++-------- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 18 ++++++------------ 4 files changed, 15 insertions(+), 24 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc b/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc index 1bf914301e..738c0c979e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc @@ -1,7 +1,7 @@ [% IF ( PAGE_NUMBERS ) %]
- [% IF ( previous_page_offset ) %]<< Previous[% END %] - [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %][% PAGE_NUMBER.pg %][% ELSE %] [% PAGE_NUMBER.pg %][% END %] + [% IF ( previous_page_offset ) %]<< Previous[% END %] + [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %][% PAGE_NUMBER.pg %][% ELSE %] [% PAGE_NUMBER.pg %][% END %] [% END %] - [% IF ( next_page_offset ) %]Next >>[% END %] + [% IF ( next_page_offset ) %]Next >>[% END %]
[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js index 298a20e430..f2808ef6f9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js @@ -18,7 +18,7 @@ KOHA.LocalCover = { * olCallBack(). */ GetCoverFromBibnumber: function(uselink) { - $("div [id^=local-thumbnail]").each(function(i) { + $("div[id^=local-thumbnail],span[id^=local-thumbnail]").each(function(i) { var mydiv = this; var message = document.createElement("span"); $(message).attr("class","no-image"); diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index cd8915e449..2f3c7d519e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -417,15 +417,15 @@ $(document).ready(function(){ [% ELSE %] [% END %] [% END %] - [% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield %][% END %] + [% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield|html %][% END %] [% IF ( SEARCH_RESULT.author ) %]by [% SEARCH_RESULT.author %] [% ELSE %]  [% END %] Publication: - [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear %] + [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place %] [% END %][% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode|html %][% END %][% IF ( SEARCH_RESULT.publicationyear ) %] [% SEARCH_RESULT.publicationyear %] [% ELSE %][% IF ( SEARCH_RESULT.copyrightdate ) %] [% SEARCH_RESULT.copyrightdate %][% END %][% END %] [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages %][% END %] - [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes %][% END %] + [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes|html %][% END %] [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size %][% END %] [% IF ( SEARCH_RESULT.timestamp ) %] (modified on [% SEARCH_RESULT.timestamp %])[% END %] @@ -480,20 +480,17 @@ $(document).ready(function(){ [% IF ( LibraryThingForLibrariesID ) %]
[% END %] [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %] [% IF ( TagsShowOnList ) %] -
[% IF ( SEARCH_RESULT.TagLoop.size ) %] - Tags: +
Tags:
    [% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]
  • [% TagLoo.term %] ([% TagLoo.weight_total %])
  • [% END %]
[% END %] [% IF ( TagsInputOnList ) %] [% IF ( loggedinusername ) %] - New tag: - @@ -528,7 +525,7 @@ $(document).ready(function(){ - [% IF ( OPACLocalCoverImages ) %]
[% END %] + [% IF ( OPACLocalCoverImages ) %][% END %] [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %][% ELSE %]No cover image available[% END %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt index 391037f6dd..908eb94e16 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt @@ -257,15 +257,15 @@ $(function() { [% ELSE %]
[% END %] [% END %] - [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield %][% END %] + [% IF ( itemsloo.title ) %][% itemsloo.title |html %][% ELSE %]No title[% END %] [% FOREACH subtitl IN itemsloo.subtitle %][% subtitl.subfield|html %][% END %] [% IF ( itemsloo.author ) %]by [% itemsloo.author %] [% ELSE %]  [% END %] Publication: - [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %] + [% IF ( itemsloo.place ) %][% itemsloo.place %] [% END %][% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode|html %][% END %][% IF ( itemsloo.publicationyear ) %] [% itemsloo.publicationyear %] [% ELSE %][% IF ( itemsloo.copyrightdate ) %] [% itemsloo.copyrightdate %][% END %][% END %] [% IF ( itemsloo.pages ) %]. [% itemsloo.pages %][% END %] - [% IF ( itemsloo.notes ) %], [% itemsloo.notes %][% END %] + [% IF ( itemsloo.notes ) %], [% itemsloo.notes|html %][% END %] [% IF ( itemsloo.size ) %] [% itemsloo.size %][% END %] Holdings:[% IF ( itemsloo.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN itemsloo.ITEM_RESULTS %] @@ -288,20 +288,19 @@ $(function() { [% END %] [% IF ( TagsInputOnList ) %] [% IF ( loggedinusername ) %] -
-
[% ELSIF ( loop.first ) %]Log in to add tags. [% END %] - [% END %] + [% ELSE %] [% IF ( loggedinusername ) %] - + [% END %] + [% END %] [% END %] Actions: @@ -325,12 +324,7 @@ $(function() { [% IF ( opacbookbag ) %]Add to Cart[% ELSE %]nocart[% END %] - - - - [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
- [% END %][% END %][% END %] -- 2.20.1