From 850628743b05b8ba66b4485477d60745e3956c59 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 7 Oct 2013 10:33:03 -0400 Subject: [PATCH] Bug 10309: (follow-up) Updates for Bug 6594, Schema.org structured data This patch adds the changes from Bug 6594: "To support schema.org processors, such as Google, Bing, and Yandex, structure our data so that it has machine-readable attributes. This pass declares the CreativeWork sub-types as well as Product for the main bibliographic record details, and uses the Offer type for holdings information per the W3C Schema Bib Extend community group discussions." Signed-off-by: Bernardo Gonzalez Kriegel Tested against linter.structured-data.org, microdata present No errors. Signed-off-by: Galen Charlton --- .../en/includes/item-status-schema-org.inc | 11 + .../bootstrap/en/modules/opac-detail.tt | 189 ++++++++++-------- 2 files changed, 121 insertions(+), 79 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc new file mode 100644 index 0000000000..0c6450364c --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status-schema-org.inc @@ -0,0 +1,11 @@ +[% USE KohaAuthorisedValues %] + +[% IF ( item.damaged or item.datedue or item.itemlost or item.transfertwhen or item.waiting ) %] + +[% ELSIF ( item.withdrawn ) %] + +[% ELSIF ( item.itemnotforloan or item.notforloan_per_itemtype ) %] + +[% ELSE %] + +[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 57d46a484b..af896aeee0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1106,89 +1106,120 @@ [% BLOCK items_table %] - - [% IF ( item_level_itypes ) %][% END %] - - [% IF ( itemdata_ccode ) %][% END %] - - [% IF ( itemdata_enumchron ) %][% END %] - [% IF ( itemdata_uri ) %][% END %] - [% IF ( itemdata_copynumber ) %][% END %] - - [% IF ( itemdata_itemnotes ) %][% END %] - - [% IF ( OPACShowBarcode ) %][% END %] - [% IF holds_count.defined %] - - [% ELSIF show_priority %] - - [% END %] - [% IF ( ShowCourseReservesHeader ) %][% END %] - - [% FOREACH ITEM_RESULT IN items %] - [% IF ITEM_RESULT.this_branch %][% ELSE %][% END %] - [% IF ( item_level_itypes ) %][% END %] - - [% IF ( itemdata_ccode ) %][% END %] - - [% IF ( itemdata_enumchron ) %][% END %] - [% IF ( itemdata_uri ) %] - [% END %] - [% IF ( itemdata_copynumber ) %][% END %] - - [% IF ( itemdata_itemnotes ) %][% END %] - - [% IF ( OPACShowBarcode ) %][% END %] - [% IF holds_count.defined || show_priority %] - + + [% IF ( item_level_itypes ) %][% END %] + + [% IF ( itemdata_ccode ) %][% END %] + + [% IF ( itemdata_enumchron ) %][% END %] + [% IF ( itemdata_uri ) %][% END %] + [% IF ( itemdata_copynumber ) %][% END %] + + [% IF ( itemdata_itemnotes ) %][% END %] + + [% IF ( OPACShowBarcode ) %][% END %] [% IF holds_count.defined %] - (priority [% ITEM_RESULT.priority %]) + + [% ELSIF show_priority %] + + [% END %] + [% IF ( ShowCourseReservesHeader ) %][% END %] + + + + [% FOREACH ITEM_RESULT IN items %] + [% IF ITEM_RESULT.this_branch %] + [% ELSE %] - [% ITEM_RESULT.priority %] + [% END %] - [% END %] - - [% END %] - [% IF ShowCourseReservesHeader %] - [% END %] - [% END %] - - [% END %] - - [% END %] + + [% IF ( itemdata_ccode ) %] + + [% END %] + + [% IF ( itemdata_enumchron ) %] + + [% END %] + [% IF ( itemdata_uri ) %] + + [% END %] + [% IF ( itemdata_copynumber ) %][% END %] + + [% IF ( itemdata_itemnotes ) %][% END %] + + [% IF ( OPACShowBarcode ) %][% END %] + [% IF holds_count.defined || show_priority %] + + [% END %] + [% IF ShowCourseReservesHeader %] + + [% END # /IF ShowCourseReservesHeader %] + + [% END %] +
Item typeLocationCollectionCall numberVol infourlCopyStatusNotesDate dueBarcodeItem holdsItem hold queue priorityCourse reserves
[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %][% ITEM_RESULT.description %][% END %][% END %] [% ITEM_RESULT.description %] - [% UNLESS ( singleBranchMode ) %] -
- [% IF ( ITEM_RESULT.branchurl ) %] - [% ITEM_RESULT.branchname %] - [% ELSE %] - [% ITEM_RESULT.branchname %] - [% END %] -
[% ITEM_RESULT.branch_opac_info %]
-
- [% END %] - [% ITEM_RESULT.location_description %] -
[% ITEM_RESULT.ccode %][% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (Browse shelf)[% END %][% END %][% ITEM_RESULT.enumchron %] - [% IF ITEM_RESULT.uri %] - [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] - Link to resource - [% ELSE %] - [% ITEM_RESULT.uri %] - [% END %] - [% END %] - [% ITEM_RESULT.copynumber %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %][% ITEM_RESULT.itemnotes %][% ITEM_RESULT.datedue | $KohaDates %][% ITEM_RESULT.barcode %] - [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %] - [% IF ITEM_RESULT.priority %] +
Item typeLocationCollectionCall numberVol infourlCopyStatusNotesDate dueBarcodeItem holdsItem hold queue priorityCourse reserves
- [% IF ITEM_RESULT.course_reserves %] - [% FOREACH r IN ITEM_RESULT.course_reserves %] -

- - [% r.course.course_name %] - - [% IF r.course.section %] [% r.course.section %] [% END %] - [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %] - -

+ [% IF ( item_level_itypes ) %] +
+ [% UNLESS ( noItemTypeImages ) %] + [% IF ( ITEM_RESULT.imageurl ) %] + [% ITEM_RESULT.description %] + [% END %] + [% END %] + [% ITEM_RESULT.description %] +
+ + + [% UNLESS ( singleBranchMode ) %] +
+ [% IF ( ITEM_RESULT.branchurl ) %] + [% ITEM_RESULT.branchname %] + [% ELSE %] + [% ITEM_RESULT.branchname %] + [% END %] +
[% ITEM_RESULT.branch_opac_info %]
+
+ [% END %] + [% ITEM_RESULT.location_description %] +
[% ITEM_RESULT.ccode %] + [% IF ( ITEM_RESULT.itemcallnumber ) %] + [% ITEM_RESULT.itemcallnumber %] + [% IF ( OPACShelfBrowser ) %] + (Browse shelf) + [% END %] + [% END %] + [% ITEM_RESULT.enumchron %] + [% IF ITEM_RESULT.uri %] + [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] + Link to resource + [% ELSE %] + [% ITEM_RESULT.uri %] + [% END %] + [% END %] + [% ITEM_RESULT.copynumber %][% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %][% ITEM_RESULT.itemnotes %][% ITEM_RESULT.datedue | $KohaDates %][% ITEM_RESULT.barcode %] + [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %] + [% IF ITEM_RESULT.priority %] + [% IF holds_count.defined %] + (priority [% ITEM_RESULT.priority %]) + [% ELSE %] + [% ITEM_RESULT.priority %] + [% END %] + [% END %] + + [% IF ITEM_RESULT.course_reserves %] + [% FOREACH r IN ITEM_RESULT.course_reserves %] +

+ + [% r.course.course_name %] + + [% IF r.course.section %] [% r.course.section %] [% END %] + [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %] + +

+ [% END %] + [% END %] +
[% END %][%# end of items_table block %] -- 2.39.5