From: Galen Charlton Date: Mon, 15 Mar 2021 16:27:06 +0000 (-0400) Subject: Revert "LP#1424815: 'Read more' accordion in record view" X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9dcf8fb663302245959ed9629f97852b072f86a4;p=Evergreen.git Revert "LP#1424815: 'Read more' accordion in record view" This reverts commit 9561b5736eadfa9325015676bc64e628d9f72be4. Pushed by accident. --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm index fdb0da5aca..7f35d18835 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm @@ -4,8 +4,6 @@ use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERR use File::Spec; use Time::HiRes qw/time sleep/; use List::MoreUtils qw(uniq); -use HTML::TreeBuilder; -use HTML::Element; use OpenSRF::Utils::Cache; use OpenSRF::Utils::Logger qw/$logger/; use OpenILS::Utils::CStoreEditor qw/:funcs/; @@ -132,78 +130,6 @@ sub init_ro_object_cache { return (grep {$_->shortname eq $sn} @$list)[0]; }; - # Turns one string into two for long text strings - $locale_subs->{split_for_accordion} = sub { - my $html = shift; - my $trunc_length = shift; - - return unless defined $html && defined $trunc_length; - - my $html_string = ""; - my $trunc_str = "..."); - } - - if (@html_strings > 1) { - $html_string = join '', @html_strings; - } else { - $html_string = $html_strings[0]; - } - - return ($html_string, $truncated); - }; - $locale_subs->{aouct_tree} = sub { # fetch the org unit tree diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 18cb68808c..51aa7a6e4a 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -49,10 +49,6 @@ a { width: 12em; } -.truncated { - display: none; -} - .searchbar { font-weight: bold; padding-top: 10px; diff --git a/Open-ILS/src/templates/opac/i18n_strings.tt2 b/Open-ILS/src/templates/opac/i18n_strings.tt2 index 2a60c99b21..7d3b831d64 100644 --- a/Open-ILS/src/templates/opac/i18n_strings.tt2 +++ b/Open-ILS/src/templates/opac/i18n_strings.tt2 @@ -21,7 +21,4 @@ to js source files, via js blob. eg_opac_i18n.EG_INVALID_DATE = "[% l('That is not a valid date in the future.') %]"; // For multiple holds placement confirmation dialog. {0} is replaced by number of copies requested. eg_opac_i18n.EG_MULTIHOLD_MESSAGE = "[% l('Do you really want to place {0} holds for this title?') %]"; - // For Read More functionality - eg_opac_i18n.EG_READ_MORE = "[% l('Read More') %]"; - eg_opac_i18n.EG_READ_LESS = "[% l('Read Less') %]"; diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index eda51ad814..a1438b7171 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -276,13 +276,4 @@ ctx.max_cart_size = 500; ############################################################################## ctx.show_reservations_tab = 'false'; -############################################################################## -# Truncate fields in catalog -############################################################################## -truncate_contents = 1; -contents_truncate_length = 50; - -# Edit parts/record/contents.tt2 to designate character length on a field-by- -# field basis for notes. - %] diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index aa4e9f54da..15ff471eec 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -169,7 +169,7 @@ var aou_hash = { [%- IF ctx.max_cart_size; %] [%- END; %] - + diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index ee600a1b36..38f2995a0f 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -803,7 +803,6 @@ -%] - [%- BLOCK carousels; config = { animated => 0, @@ -877,20 +876,3 @@ [% END -%] [% END -%] -[% MACRO accordion(str, trunc_length, element) BLOCK; - IF truncate_contents != 1; - str; - ELSE; - UNLESS trunc_length; - trunc_length = contents_truncate_length || 100; - END; - IF str.length > trunc_length; - accordion_res = ctx.split_for_accordion(str, trunc_length); - str = accordion_res.0; - IF accordion_res.1; - str = str _ " " _ l('Read More') _ ""; - END; - END; - str; - END; -END; %] diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2 index 70620309cc..25dac9a5cc 100644 --- a/Open-ILS/src/templates/opac/parts/record/authors.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2 @@ -135,26 +135,17 @@ BLOCK build_author_links; END; iprop = iprop _ '"'; END; - desc_str = '(' _ author_type _ ').'; + link_term = link_term.replace('^\s+', ''); match_term = link_term _ ' ' _ birthdate _ ' ' _ deathdate; matching_author_hl = PROCESS find_hl_value needle=match_term f=attrs.hl_field; - authtml = ''; + + authtml = ' '; IF iprop; authtml = authtml _ ''; END; IF matching_author_hl; - IF type == 'cast'; - link_str = matching_author_hl _ ' ' _ desc_str _ ''; - authtml = authtml _ accordion(link_str, null, 'this.previousElementSibling'); - ELSE; - authtml = authtml _ matching_author_hl; - END; + authtml = authtml _ matching_author_hl; ELSE; - IF type == 'cast'; - link_str = link_term _ ' ' _ desc_str _ ''; - authtml = authtml _ accordion(link_str, null, 'this.previousElementSibling'); - ELSE; - authtml = authtml _ link_term; - END; + authtml = authtml _ link_term; END; IF iprop; authtml = authtml _ ''; END; IF birthdate AND !matching_author_hl; @@ -163,7 +154,7 @@ BLOCK build_author_links; IF deathdate AND !matching_author_hl; authtml = authtml _ '' _ deathdate _ ''; END; - IF type != 'cast'; authtml = authtml _ ''; END; # End search link + authtml = authtml _ ''; # End search link # Display supplemental terms (mostly about the author's work) IF supp_term; @@ -176,12 +167,12 @@ BLOCK build_author_links; IF link880.dir; diratt = ' dir="' _ link880.dir _ '"'; END; - authlist_graphical.push('' _ link880.value _ ''); - END; - IF type != 'cast'; - authtml = authtml _ desc_str; - authtml = authtml _ ''; # End author span + authtml = authtml _ ' '; + link880.value | html; + authtml = authtml _ ''; END; + authtml = authtml _ ' (' _ author_type _ '). '; + authtml = authtml _ ''; # End author span authlist.push(authtml); END; END; @@ -191,20 +182,14 @@ END; [%- FOREACH author IN authors; NEXT UNLESS author.xpath; authlist = []; - authlist_graphical = []; - authstr = ''; - graphical_string = ''; PROCESS build_author_links( xpath=author.xpath, label=author.label, type=author.type ); - IF authlist_graphical.size; - %]
[% - accordion(authlist_graphical.join()); - %]
[% END; IF authlist.size; - %]
[% - accordion(authlist.join()); - %]
[% END; + FOREACH authtml IN authlist; + authtml; + END; + END; END %] diff --git a/Open-ILS/src/templates/opac/parts/record/contents.tt2 b/Open-ILS/src/templates/opac/parts/record/contents.tt2 index c63b34c166..db80b475c2 100644 --- a/Open-ILS/src/templates/opac/parts/record/contents.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/contents.tt2 @@ -1,10 +1,8 @@ -[% USE Dumper %][%- -# You can supply a trunc_length parameter to override the default contents_truncate_length value +[%- contents = [ { display_field => 'general_note', label => l('General Note: '), - trunc_length => 100, xpath => '//*[@tag="500"]' }, { label => l('With Note: '), @@ -179,16 +177,10 @@ BLOCK render_contents; all_content.push(subfield.textContent); END; total_contents = all_content.join(" ").replace('\s+$', ''); - %] [% IF total_contents.size; - trunc_length = cont.trunc_length || contents_truncate_length || 100; - - "
"; accordion(total_contents, trunc_length); "
"; - ELSE; - "
"; accordion(total_contents); "
"; - END; + %] [% "
"; total_contents | html ; "
"; FOREACH link880 IN graphics; '
'; - accordion(link880.value); + link880.value | html; '
'; END; END; @@ -196,28 +188,21 @@ END; BLOCK render_all_contents; FOREACH cont IN contents; - note_arr = []; content = ''; df = cont.display_field; - trunc_length = cont.trunc_length || contents_truncate_length || 100; - IF df AND attrs.hl.$df.size; -%] - - [% cont.label %] - - [%- FOREACH note IN attrs.hl.$df; - "
"; accordion(note, trunc_length); "
"; - END -%] - - [%- ELSE; + IF df AND attrs.hl.$df.size; + content = '' _ attrs.hl.$df.join('
'); + ELSE; content = PROCESS render_contents(xpath=cont.xpath); - IF content.match('\S'); -%] - - [% cont.label %] - [% accordion(content, trunc_length) %] - - [%- END; END; - END; %] + IF content.match('\S'); +-%] + + [% cont.label %] + [% content %] + + [%- END; %] + [%- END; %] [%- END %] [%- content_html = PROCESS render_all_contents; diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index d3aed58394..be248abe38 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -3,7 +3,6 @@ ctx.page_title = attrs.title | html ctx.metalinks.push(''); %] - @@ -12,7 +11,7 @@ [%-# This holds the record summary information %]
-

[% IF attrs.hl.title; accordion(attrs.hl.title); ELSE; accordion(attrs.title_extended); END %]

+

[% IF attrs.hl.title; attrs.hl.title; ELSE; attrs.title_extended | html; END %]

[%- FOR link880 IN attrs.graphic_titles; FOR alt IN link880.graphic; @@ -20,7 +19,7 @@ IF alt.dir; ' dir="' _ alt.dir _ '"'; END; - '>'; accordion(alt.value); ''; + '>'; alt.value | html; ''; END; END; -%] @@ -360,25 +359,22 @@ END; [%- IF attrs.hl.physical_description.size %]
  • [% l("Physical Description:") %] - - [% FOREACH desc IN attrs.hl.physical_description %] - [% accordion(desc) %]
    - [% END %]
    + [% attrs.hl.physical_description.join('
    ') %]
  • [%- ELSIF attrs.phys_desc %]
  • [% l("Physical Description:") %] - [% accordion(attrs.phys_desc) %] + [% attrs.phys_desc | html %]
  • [%- END %] [%- IF attrs.hl.edition %]
  • [% l("Edition:") %] - [% accordion(attrs.hl.edition) %] + [% attrs.hl.edition %] [%- ELSIF attrs.edition %]
  • [% l("Edition:") %] - [% accordion(attrs.edition) %] + [% attrs.edition | html %] [%- FOR entry IN attrs.graphic_editions; FOR alt IN entry.graphic; @@ -388,7 +384,7 @@ END; END; -%]
    - [% accordion(alt.value); %] + [% alt.value | html %]
    [%- END; @@ -399,20 +395,19 @@ END; [%- IF attrs.hl.publisher %]
  • [% l("Publisher:") %] - [% accordion(attrs.hl.publisher) %] + [% attrs.hl.publisher %]
  • [%- ELSIF attrs.publisher %]
  • [% l("Publisher:") %] - [% pubstr = '' %] [%- IF attrs.pubplace; %] - [% attrs.pubplace %] + [% attrs.pubplace | html; %] [%- END; %] - [% attrs.publisher %] + [% attrs.publisher | html; %] [%- IF attrs.pubdate; %] - [% attrs.pubdate %] + [% attrs.pubdate | html; %] [%- END; %] [%- IF attrs.graphic_pubinfos.size > 0; @@ -424,7 +419,7 @@ END; END; -%]
    - [% accordion(alt.value) %] + [% alt.value | html %]
    [%- END; @@ -438,11 +433,11 @@ END; [% l("Producer:") %] [%- IF attrs.prodplace; %] - [% accordion(attrs.prodplace) %] + [% attrs.prodplace | html; %] [%- END; %] - [% accordion(attrs.producer) %] + [% attrs.producer | html; %] [%- IF attrs.proddate; %] - [% accordion(attrs.proddate) %] + [% attrs.proddate | html; %] [%- END; %]
  • @@ -452,11 +447,11 @@ END; [% l("Distributor:") %] [%- IF attrs.distplace; %] - [% accordion(attrs.distplace) %] + [% attrs.distplace | html; %] [%- END; %] - [% accordion(attrs.distributor) %] + [% attrs.distributor | html; %] [%- IF attrs.distdate; %] - [% accordion(attrs.distdate) %] + [% attrs.distdate | html; %] [%- END; %] @@ -466,11 +461,11 @@ END; [% l("Manufacturer:") %] [%- IF attrs.manplace; %] - [% accordion(attrs.manplace) %] + [% attrs.manplace | html; %] [%- END; %] - [% accordion(attrs.manufacturer) %] + [% attrs.manufacturer | html; %] [%- IF attrs.mandate; %] - [% accordion(attrs.mandate) %] + [% attrs.mandate | html; %] [%- END; %] @@ -478,7 +473,7 @@ END; [%- IF attrs.copyright %]