From f286433d9fb2039e7adb174caeb2ce07bbd090ae Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Wed, 21 Dec 2011 01:06:06 -0500 Subject: [PATCH] TPAC: Improve display of holds/copy counts on record details Based on some suggestions from Thomas Berezansky in LP 906168: * Change the "Copies" header to "Available copies" * Simplify the copy language to "# copies at " (we still need the noun "copies" but "available" has been factored out) * Create a "Holds" header and move the holds information under that * Put the "Available copies" and "Holds" into inline-block elements so that they can take less vertical space on a wide screen but will wrap on a narrow screen. * Fix the line spacing between LI elements In addition, break up the lengthy summary TT2 file into a few smaller parts. In particular, make a copy_counts.tt2 file as sites are very likely to customize this to, in some cases, not show the consortial counts, or in other cases to only show the consortial count and current search library. Also fix some horrible CSS issues in the header in which the "Place hold" and "Add to list" buttons were above the title / image, as well as remove some of the CSS manipulation to plain H2 elements that gave them no top margin. Signed-off-by: Dan Scott Signed-off-by: Thomas Berezansky --- .../templates/opac/parts/record/copy_counts.tt2 | 16 ++ .../src/templates/opac/parts/record/copy_table.tt2 | 117 +++++++++++ .../src/templates/opac/parts/record/summary.tt2 | 221 +++++---------------- Open-ILS/web/css/skin/default/opac/style.css | 26 ++- 4 files changed, 195 insertions(+), 185 deletions(-) create mode 100644 Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 create mode 100644 Open-ILS/src/templates/opac/parts/record/copy_table.tt2 diff --git a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 new file mode 100644 index 0000000000..905789d2e7 --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 @@ -0,0 +1,16 @@ + +

[% l('Available copies') %]

+
    + [%- depths = ctx.copy_summary.size; + depth = 0; + WHILE depth < depths; + %] +
  • + [% l('[quant,_1,copy,copies] at [_2].', + ctx.copy_summary.$depth.available, + ctx.get_aou(ctx.copy_summary.$depth.org_unit).name) + | html %] +
  • + [%- depth = depth + 1; END %] +
+
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 new file mode 100644 index 0000000000..4255e13322 --- /dev/null +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -0,0 +1,117 @@ + + + + + + + + [%- IF ctx.is_staff %] + + + + [%- END %] + + + + + + [%- last_cn = 0; + FOR copy_info IN ctx.copies; + callnum = copy_info.call_number_label; + NEXT IF callnum == '##URI##'; + + callnum_prefix = copy_info.call_number_prefix_label; + IF callnum_prefix != ""; + callnum = callnum_prefix _ " " _ callnum; + END; + + callnum_suffix = copy_info.call_number_suffix_label; + IF callnum_suffix != ""; + callnum = callnum _ " " _ callnum_suffix; + END; + -%] + + + + + + [%- IF ctx.is_staff %] + + + + [%- END %] + + + + [%- END %] + + [%- IF ctx.copy_offset > 0; + new_offset = ctx.copy_offset - ctx.copy_limit; + IF new_offset < 0; new_offset = 0; END %] + + [%- END %] + [%- IF ctx.copies.size >= ctx.copy_limit %] + + [%- END %] + + + + + +
[% l("Location") %][% l("Call Number") %][% l("Barcode") %][% l("Shelving Location") %][% l("Age Hold Protection") %][% l("Create Date") %][% l("Holdable?") %][% l("Status") %][% l("Due Date") %]
+ [%- + org_name = ctx.get_aou(copy_info.circ_lib).name; + org_name | html + -%] + [% callnum | html %][% copy_info.barcode | html %][% copy_info.copy_location | html %] + [% copy_info.age_protect ? + ctx.get_crahp(copy_info.age_protect).name : l('None') | html %] + [% date.format( + ctx.parse_datetime(copy_info.create_date), + DATE_FORMAT + ) %][% # Show copy/volume hold links to staff (without + # checking whether they have permissions to do those). + overall_holdable = (copy_info.holdable == 't' AND + copy_info.location_holdable == 't' AND + copy_info.status_holdable == 't'); + IF overall_holdable; + l("Place on"); %] + [% l("copy") %] + [%- IF copy_info.call_number != last_cn; + last_cn = copy_info.call_number; + l(" / "); %] + [% l("volume") %] + [%- END; + ELSE; + l("No"); + END %][% copy_info.copy_status | html %][% + IF copy_info.due_date; + date.format( + ctx.parse_datetime(copy_info.due_date), + DATE_FORMAT + ); + ELSE; + '-'; + END %]
+ « [% + l('Previous [_1]', ctx.copy_offset - new_offset) %] + + [% + l('Next [_1]', ctx.copy_limit) %] » +
+ [%- more_copies_limit = 50 %] [%# TODO: config %] + [%- IF ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %] + + [%- ELSIF ctx.copy_limit == more_copies_limit %] + + [%- END %] +
+ diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index ca5f1ba224..e21b08650f 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -12,42 +12,43 @@
[%- # This holds the record summary information %] -
- [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] - [% l('Image of item') %] - [% END %] -
-
- -
- -
- [%- - operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add"; - label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); - %] - - - [% label %] - +
+
+ [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] + [% l('Image of item') %] + [% END %] +
-
-
- [%- IF attrs.format_icon %] -
- [% attrs.format_label %] +
+ +
+ [%- + operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add"; + label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); + %] + + + [% label %] + +
+
+
+ [%- IF attrs.format_icon %] +
+ [% attrs.format_label %] +
+ [%- END %] +

[% attrs.title_extended | html %]

+ [%- INCLUDE "opac/parts/record/authors.tt2" %]
- [%- END %] -

[% attrs.title_extended | html %]

- [%- INCLUDE "opac/parts/record/authors.tt2" %]
[%- IF openurl.enabled == 'true'; @@ -88,149 +89,19 @@ IF num_uris > 0; [%- IF num_uris > 1 %][% END %]
[%- END %] -[%- # hold/copy summary %] -[%- IF ctx.copy_summary.0.count %] -
-

[% l('Copies') %]

-
    -
  • - - [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", - ctx.record_hold_count, ctx.copy_summary.0.count) %] - - [% l('[quant,_1,copy,copies] currently available at [_2].', - ctx.copy_summary.0.available, - ctx.get_aou(ctx.copy_summary.$depth.org_unit).name) | html %] - -
  • -[%- depths = ctx.copy_summary.size; - depth = 1; - WHILE depth < depths; +[%- # Hold/copy summary + IF ctx.copy_summary.0.count %] -
  • -[% l('[quant,_1,copy,copies] currently available at [_2].', - ctx.copy_summary.$depth.available, - ctx.get_aou(ctx.copy_summary.$depth.org_unit).name) - | html %] -
  • -[%- depth = depth + 1; END %] -
- - - - - - - - [%- IF ctx.is_staff %] - - - - [%- END %] - - - - - - [%- last_cn = 0; - FOR copy_info IN ctx.copies; - callnum = copy_info.call_number_label; - NEXT IF callnum == '##URI##'; - - callnum_prefix = copy_info.call_number_prefix_label; - IF callnum_prefix != ""; - callnum = callnum_prefix _ " " _ callnum; - END; - - callnum_suffix = copy_info.call_number_suffix_label; - IF callnum_suffix != ""; - callnum = callnum _ " " _ callnum_suffix; - END; - -%] - - - - - - [%- IF ctx.is_staff %] - - - - [%- END %] - - - - [%- END %] - - [%- IF ctx.copy_offset > 0; - new_offset = ctx.copy_offset - ctx.copy_limit; - IF new_offset < 0; new_offset = 0; END %] - - [%- END %] - [%- IF ctx.copies.size >= ctx.copy_limit %] - - [%- END %] - - - - - -
[% l("Location") %][% l("Call Number") %][% l("Barcode") %][% l("Shelving Location") %][% l("Age Hold Protection") %][% l("Create Date") %][% l("Holdable?") %][% l("Status") %][% l("Due Date") %]
- [%- - org_name = ctx.get_aou(copy_info.circ_lib).name; - org_name | html - -%] - [% callnum | html %][% copy_info.barcode | html %][% copy_info.copy_location | html %] - [% copy_info.age_protect ? - ctx.get_crahp(copy_info.age_protect).name : l('None') | html %] - [% date.format( - ctx.parse_datetime(copy_info.create_date), - DATE_FORMAT - ) %][% # Show copy/volume hold links to staff (without - # checking whether they have permissions to do those). - overall_holdable = (copy_info.holdable == 't' AND - copy_info.location_holdable == 't' AND - copy_info.status_holdable == 't'); - IF overall_holdable; - l("Place on"); %] - [% l("copy") %] - [%- IF copy_info.call_number != last_cn; - last_cn = copy_info.call_number; - l(" / "); %] - [% l("volume") %] - [%- END; - ELSE; - l("No"); - END %][% copy_info.copy_status | html %][% - IF copy_info.due_date; - date.format( - ctx.parse_datetime(copy_info.due_date), - DATE_FORMAT - ); - ELSE; - '-'; - END %]
- « [% - l('Previous [_1]', ctx.copy_offset - new_offset) %] - - [% - l('Next [_1]', ctx.copy_limit) %] » -
- [%- more_copies_limit = 50 %] [%# TODO: config %] - [%- IF ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %] - - [%- ELSIF ctx.copy_limit == more_copies_limit %] - - [%- END %] -
+
+[%- INCLUDE "opac/parts/record/copy_counts.tt2" %] + +

[% l('Current holds') %]

+

+ [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", + ctx.record_hold_count, ctx.copy_summary.0.count) %] +

+
+[%- INCLUDE "opac/parts/record/copy_table.tt2" %]
[%- END %] diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index 27eb9d8b97..2d03d68ef2 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -46,8 +46,6 @@ h1 { } h2 { - margin:0; - margin-bottom: 5px; font-size: 16px; font-weight:bold; } @@ -365,14 +363,26 @@ div.rdetail_show_copies { margin-top: 1em; } -#rdetail_image_div { - float: left; +div#rdetail_actions_div { + float: right; +} + +span#rdetail_copy_counts { + display: inline-block; + border-right: thin; + vertical-align: top; margin-right: 1em; + padding-right: 1em; +} + +span#rdetail_hold_counts { + display: inline-block; + vertical-align: top; } #rdetail_image_div { - float: right; - margin-left: 1em; + float: left; + margin-right: 1em; } .rdetail_aux_utils { @@ -1195,10 +1205,6 @@ a.opac-button { width: 100%; } -.rdetail_copy_counts { - margin-top: 1em; -} - #rdetail_record_details { clear: both; margin-top: 1em; -- 2.11.0