From: senator Date: Fri, 11 Feb 2011 20:12:52 +0000 (-0500) Subject: A start with record detail page X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0a104ec9675eda52adb5884c88fe23930fbd3991;p=evergreen%2Fequinox.git A start with record detail page --- diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index 07eac9de57..6bb591895b 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -383,6 +383,7 @@ div.select-wrapper:hover { font-size: 18px; } +#rdetail_image { border: none; } #rdetail_image_cell { padding-top: 3px; padding-right: 10px; diff --git a/Open-ILS/web/templates/default/opac/parts/marc_misc.tt2 b/Open-ILS/web/templates/default/opac/parts/marc_misc.tt2 index 6f678b295c..f919ed8655 100644 --- a/Open-ILS/web/templates/default/opac/parts/marc_misc.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/marc_misc.tt2 @@ -1,34 +1,4 @@ [% - # Extract MARC fields from XML - # get_marc_attrs( { marc_xml => doc } ) - BLOCK get_marc_attrs; - xml = args.marc_xml; - args.isbn = xml.findnodes('//*[@tag="020"]/*[@code="a"]').shift.textContent; - args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent; - args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent; - args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent; - args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; - args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; - args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; - args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent || - xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent || - xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent; - phys = xml.findnodes( - '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]' - ); - phys_content = []; - FOR p IN phys; phys_content.push(p.textContent); END; - args.phys_desc = phys_content.join(""); - - # clean up the ISBN - args.isbn_clean = args.isbn.replace('\ .*', ''); - - # KCLS-specific stuff; needs to change - args.mattype = xml.findnodes('//*[@tag="998"]/*[@code="d"]').textContent; - args.kcls_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent; - - END; - icon_by_mattype = { # XXX KCLS-specific "a" => "media_book.jpg", "b" => "media_magazines.jpg", @@ -59,4 +29,38 @@ "2" => "media_cassettewithbook.jpg", "5" => "media_cdwithbook.jpg" }; + + # Extract MARC fields from XML + # get_marc_attrs( { marc_xml => doc } ) + BLOCK get_marc_attrs; + xml = args.marc_xml; + args.isbn = xml.findnodes('//*[@tag="020"]/*[@code="a"]').shift.textContent; + args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent; + args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent; + args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent; + args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; + args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; + args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; + args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent || + xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent || + xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent; + phys = xml.findnodes( + '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]' + ); + phys_content = []; + FOR p IN phys; phys_content.push(p.textContent); END; + args.phys_desc = phys_content.join(""); + + # clean up the ISBN + args.isbn_clean = args.isbn.replace('\ .*', ''); + + # KCLS-specific stuff; needs to change + args.mattype = xml.findnodes('//*[@tag="998"]/*[@code="d"]').textContent; + args.kcls_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent; + mattype = attrs.mattype; + args.format = ctx.find_citm(mattype).value; + args.format_icon = icon_by_mattype.$mattype; + + END; + %] diff --git a/Open-ILS/web/templates/default/opac/parts/record/body.tt2 b/Open-ILS/web/templates/default/opac/parts/record/body.tt2 index 719df27bb0..93d2bf79a8 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/body.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/body.tt2 @@ -1,6 +1,14 @@ +[% record = ctx.record; + attrs = {marc_xml => ctx.marc_xml}; + PROCESS "default/opac/parts/marc_misc.tt2"; + PROCESS get_marc_attrs args=attrs %]
-
+
[%# + XXX Does it make sense for now to even have this section? Why + should the record detail page be aware of the ongoing search? + The user can use the back button to go back to their search results + like on any other website. %]
Search Results    diff --git a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 index e1d5e358b5..f07c6a0aac 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 @@ -6,9 +6,11 @@ - Image of item + [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] + Image of item + [% END %]
[% l("Image provided by") %]
@@ -23,16 +25,21 @@
-
- [% l("Author") %]: - + [% attrs.title %]
+ [% IF attrs.author %] + [% l("Author") %]: + [% attrs.author %] + + [% END %]
@@ -59,32 +66,35 @@ - + - + - + - + @@ -92,11 +102,12 @@ - + @@ -167,7 +178,7 @@
- [% l("ISBN") %] + [% IF attrs.isbn %][% l("ISBN") %][% END %] [% attrs.isbn %] - [% l("Physical Description") %] + [% IF attrs.phys_desc %][% l("Physical Description") %][% END %] [% attrs.phys_desc %]
- [% l("Edition") %] + [% IF attrs.edition; l("Edition"); END %] [% attrs.edition %] - [% l("Format") %] + [% IF attrs.format; l("Format"); END %] - Format - + [% IF attrs.format %] + Format + [% END %]
- [% l("Publication Date") %] + [% IF attrs.pubdate; l("Publication Date"); END %] [% attrs.pubdate %] Summary
- [% l("Publisher") %] + [% IF attrs.publisher; l("Publisher"); END %] [% attrs.publisher %] - [% l("Subjects") %] + [%# XXX TODO see kcls' drawMarcSubjects() in rdetail.js %] + [% l("Subjects") %]
- Place HoldPlace Hold Reviews and More diff --git a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 index 9db6f3262b..b602af25c4 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 @@ -31,7 +31,7 @@ width="78" nowrap="nowrap" valign="top"> [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] Image of item
[% END %]