From 5d91930058fbf7e169e3f1a85d0f565b7defc98e 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 Content-Type: text/plain; charset="utf-8" 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. --- .../opac-tmpl/prog/en/includes/page-numbers.inc | 6 +++--- koha-tmpl/opac-tmpl/prog/en/js/localcovers.js | 3 ++- .../opac-tmpl/prog/en/modules/opac-results.tt | 13 +++++-------- .../opac-tmpl/prog/en/modules/opac-shelves.tt | 18 ++++++------------ 4 files changed, 16 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 1bf9143..384ea31 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 298a20e..6f166b8 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/localcovers.js @@ -18,8 +18,9 @@ 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; + console.log($(mydiv).attr("class")); var message = document.createElement("span"); $(message).attr("class","no-image"); $(message).html(NO_LOCAL_JACKET); 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 5359dbc..399be8a 100755 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -418,15 +418,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 %] @@ -481,20 +481,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: - @@ -529,7 +526,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 391037f..908eb94 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 %] -- 1.7.3