From f5c6bffd3645e538d6908d5967004b5648b5478f Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Wed, 10 Jan 2018 14:44:48 -0500 Subject: [PATCH] LP#1744385: Allow highlight disabling globally via config.tt2 Also, add CC0 highlighter icon from https://pixabay.com/en/highlight-highlighter-highlighting-2022407/ and provide highlight en/dis-able. Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier Signed-off-by: Dan Wells --- Open-ILS/src/templates/opac/parts/config.tt2 | 3 +++ Open-ILS/src/templates/opac/parts/misc_util.tt2 | 2 +- Open-ILS/src/templates/opac/parts/record/summary.tt2 | 12 ++++++++++++ Open-ILS/src/templates/opac/parts/searchbar.tt2 | 12 ++++++++++-- Open-ILS/web/images/highlight.png | Bin 0 -> 928 bytes 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 Open-ILS/web/images/highlight.png diff --git a/Open-ILS/src/templates/opac/parts/config.tt2 b/Open-ILS/src/templates/opac/parts/config.tt2 index 28f730cdeb..ac731cd28b 100644 --- a/Open-ILS/src/templates/opac/parts/config.tt2 +++ b/Open-ILS/src/templates/opac/parts/config.tt2 @@ -181,6 +181,9 @@ search.basic_config = { # Make metarecord search the default. #search.metarecord_default = 1; +# Disable search term highlighting +#search.no_highlight = 1; + ############################################################################## # Show Google Book Previews # Set to 1 or 'true' to enable diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 2d48ccc53f..ba507bd6eb 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -108,7 +108,7 @@ args.display_fields = {}; args.hl = {}; - IF !CGI.param('no_highlight'); + IF !CGI.param('no_highlight') && !search.no_highlight; args.display_field_list = ctx.fetch_display_fields(args.df_bib_list.list); FOR df IN args.display_field_list; diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index 20b7d368a3..15d2a37fb0 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -138,6 +138,18 @@ [% END %] + [% IF !search.no_highlight %] + + [% END %] [%- IF ctx.is_staff %] [% IF ctx.bookbag %]
diff --git a/Open-ILS/web/images/highlight.png b/Open-ILS/web/images/highlight.png new file mode 100644 index 0000000000000000000000000000000000000000..d550b46c8dc0846809d321309feced6621172e08 GIT binary patch literal 928 zcmV;R17G}!P)Dluu|JRUF4ZZ<9^Z>`=mNi;dfYITS4(a%iB0^ss^i zA_>*dg%J}=S_*0pg&uk-l~Rir6{(;Y6t5yG9z>4;Ew-iBlO7_?WwT`MY_fl{vpa9* z&7app63xclw9OB`%w^tZK78lBC)ndmOic8q)9JIvkN@3bD46wn9VsPB zxg0o9uJGaW@hGp9aj ze<&7Cb6o2L0yrBZpZR;&GMw*wl5VfY#F0T2P~ zTE*1VRDULu`M6fAWlN<}J4>XL1VQjM@ZJ^_pri5l_;@Ol$$YxLzW%Ch+hXV6-%PBO z`Wd(Y)VHs13mzRE-8VEebX_U+=E};7=+LQFO8o+y-3jej#qjX(#VCs2DHIA~Ya8v1 zQtD6OZD6$>qs2Iv%XJxsF_%art`rJ|zW?@StEuOC%UbIq<>n%4RvaA!AYi?QQ4P0#ZN z9mi=4)!Nf%&O|@nxWVB5{k#u68^Z+(U?IdaVHk>JGKo^E<#d4; zU%nhA=H{3U0%ptQjWtT4U6;68B_TGhv)5o7IGfEHz!g9QL4cH!N~J;=hJF}^m64I~ zcgteRFc1KnhJ+y^kwC;TvFEWGMJxaU(A@xrVaxzo&+}MYTVr)~HFg~5zSjCGu#(B( z#4*3wHiJPxpAhtDO)`!N7Z+K+caOa9v!WCaw!i{lcJ}38OQpoghYxL0EEXH(a{2o> zj^6_O%@=px+j?8tPM6j^f8!K@i+z