From 9ef3269da39a90f941940249697189f736ae21a0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 19 Mar 2025 11:50:26 +0000 Subject: [PATCH] Bug 39398: Improve style and layout of staff interface advanced search form This patch updates the staff interface advanced search form to make it more responsive and to style it similarly to the item search form. To test, apply the patch and rebuild the staff interface CSS. - Go to the advanced search page in the staff interface. - Test the layout at various widths. Everything should adjust well. - Test in the "More options" view. - Test that adding and removing fields works correctly. - Test when using Zebra and Elasticsearch (SearchEngine system preference). - With Elasticsearch, test with ElasticsearchMARCFormat set to "Searchable array". - Test with IncludeSeeFromInSearches enabled. - Test using both MARC21 and UNIMARC. - Confirm that searching works correctly in all cases. Sponsored-by: Athens County Public Libraries --- .../prog/css/src/_variables.scss | 4 +- .../prog/css/src/staff-global.scss | 36 +- .../prog/en/includes/search_indexes.inc | 368 ++++----- .../prog/en/includes/subtype_limits.inc | 514 ++++++------ .../prog/en/includes/subtypes_unimarc.inc | 19 +- .../prog/en/modules/catalogue/advsearch.tt | 732 +++++++++++------- .../bootstrap/en/modules/opac-advsearch.tt | 14 +- 7 files changed, 953 insertions(+), 734 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_variables.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_variables.scss index 4f460c9cb72..adb97e1678b 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/_variables.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/_variables.scss @@ -906,7 +906,7 @@ $input-padding-y-lg: $input-btn-padding-y-lg; $input-padding-x-lg: $input-btn-padding-x-lg; $input-font-size-lg: $input-btn-font-size-lg; -$input-bg: var(--#{$prefix}body-bg); +$input-bg: $white; // var(--#{$prefix}body-bg); $input-disabled-color: null; $input-disabled-bg: var(--#{$prefix}secondary-bg); $input-disabled-border-color: null; @@ -920,7 +920,7 @@ $input-border-radius: .375rem; // var(--#{$prefix}border-radiu $input-border-radius-sm: var(--#{$prefix}border-radius-sm); $input-border-radius-lg: var(--#{$prefix}border-radius-lg); -$input-focus-bg: $input-bg; +$input-focus-bg: $white; // $input-bg; $input-focus-border-color: tint-color($component-active-bg, 50%); $input-focus-color: $input-color; $input-focus-width: $input-btn-focus-width; diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index d8a1d8aca37..7cb53cdedf6 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -78,6 +78,23 @@ $enable-dark-mode: false; ) } +.label-btn { + @include button-variant( + $default-bs-btn-bg, + transparent, // $default-bs-btn-border-color, + $default-bs-btn-color, + transparent, // $default-bs-btn-hover-bg, + #EEE, // $default-bs-btn-hover-border-color, + $default-bs-btn-hover-color, + #EEE, // $default-bs-btn-active-bg, + #BCBCBC, // $default-bs-btn-active-border-color, + $default-bs-btn-active-color, + $default-bs-btn-disabled-bg, + $default-bs-btn-disabled-border-color, + $default-bs-btn-disabled-color + ) +} + .text-bg-primary { background-color: shift-color( $primary, -55% ); color: $black; @@ -2654,25 +2671,6 @@ td.bundle { width: 50%; } -#advsearches { - margin-bottom: 1em; - - .tab-pane { - margin: 0 1em 1em 0; - - table { - border-collapse: separate; - border-spacing: 5px; - border-width: 0; - } - - td { - border: 1px solid #EEE; - padding: .3em .4em; - } - } -} - #circ_circulation_issue { position: relative; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc index 69a7ae3fb83..59710d1560b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc @@ -1,186 +1,188 @@ [% USE Koha %] [% SET select_id = refiner ? 'refiner_idx_' _ index : 'idx_' _ index %] - + [% IF ms_kw %] + + [% ELSE %] + + [% END %] + [% IF ms_kwcommaphr %] + + [% ELSE %] + + [% END %] + [% IF ms_au %] + + [% ELSE %] + + [% END %] + [% IF ms_aucommaphr %] + + [% ELSE %] + + [% END %] + [% IF ms_cpn %] + + [% ELSE %] + + [% END %] + [% IF ms_cfn %] + + [% ELSE %] + + [% END %] + [% IF ms_cpncommaphr %] + + [% ELSE %] + + [% END %] + [% IF ms_cfncommaphr %] + + [% ELSE %] + + [% END %] + [% IF ms_pn %] + + [% ELSE %] + + [% END %] + [% IF ms_pncommaphr %] + + [% ELSE %] + + [% END %] + [% IF ms_ti %] + + [% ELSE %] + + [% END %] + [% IF ms_ticommaphr %] + + [% ELSE %] + + [% END %] + [% IF ms_se %] + + [% ELSE %] + + [% END %] + [% IF ms_su %] + + [% ELSE %] + + [% END %] + [% IF ms_sucommaphr %] + + [% ELSE %] + + [% END %] + [% IF ( expanded_options ) %] + [% IF ms_sudashbr %] + + [% ELSE %] + + [% END %] + [% IF ms_sudashna %] + + [% ELSE %] + + [% END %] + [% IF ms_sudashrl %] + + [% ELSE %] + + [% END %] + [% END %] + [% IF ms_bc %] + + [% ELSE %] + + [% END %] + [% IF ms_locationcommawrdl %] + + [% ELSE %] + + [% END %] + [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] + [% IF ms_identcommaphr %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ms_ident %] + + [% ELSE %] + + [% END %] + [% END %] + [% IF ms_nb %] + + [% ELSE %] + + [% END %] + [% IF ms_ns %] + + [% ELSE %] + + [% END %] + [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] + [% IF ms_callnumcommaphr %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ms_callnum %] + + [% ELSE %] + + [% END %] + [% END %] + [% IF ms_lncommartrn %] + + [% ELSE %] + + [% END %] + [% IF ms_nt %] + + [% ELSE %] + + [% END %] + [% IF (marcflavour != 'UNIMARC' ) %] + [% IF ms_curriculum %] + + [% ELSE %] + + [% END %] + [% END %] + [% IF ms_pb %] + + [% ELSE %] + + [% END %] + [% IF ms_pl %] + + [% ELSE %] + + [% END %] - [%# Use non-normalized st-year instead of st-numeric, %] - [%# since pubdate can include 'u' to signify unknown %] - [%# dates. See "Legal Characters" at: %] - [%# http://www.loc.gov/marc/bibliographic/bd008a.html %] - [%# This search is also for date ranges due to the %] - [%# special Zebra r=r CCL mapping for 'yr' %] - [% IF ms_yrcommastdashyear %] - - [% ELSE %] - - [% END %] - [% IF ms_acqdatecommastdashdatedashnormalized %] - - [% ELSE %] - - [% END %] - + [%# Use non-normalized st-year instead of st-numeric, %] + [%# since pubdate can include 'u' to signify unknown %] + [%# dates. See "Legal Characters" at: %] + [%# http://www.loc.gov/marc/bibliographic/bd008a.html %] + [%# This search is also for date ranges due to the %] + [%# special Zebra r=r CCL mapping for 'yr' %] + [% IF ms_yrcommastdashyear %] + + [% ELSE %] + + [% END %] + [% IF ms_acqdatecommastdashdatedashnormalized %] + + [% ELSE %] + + [% END %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc index 01712ec06c7..9b88e09a349 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subtype_limits.inc @@ -1,256 +1,268 @@ [%- BLOCK subtype_dropdowns -%] - +

+ + +

- +

+ + +

- [% SET lformat = 'l-format' %] - +

+ [% SET lformat = 'l-format' %] + + +

- +

+ + +

[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc index 3e543b5c8ff..6107e2ecc7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc @@ -1,9 +1,5 @@ -

- Show coded information filters - -

- @@ -383,20 +565,35 @@ [% Asset.css("css/humanmsg.css") | $raw %] [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt index 71f4b91c742..49da06668fc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ -604,23 +604,23 @@ }); /* This function allows to display a new field to search. */ - $(document).on("click", '.ButtonPlus', function(e) { + $(document).on("click", ".ButtonPlus", function(e) { e.preventDefault(); - $('.ButtonLess').show(); + $(".ButtonLess").show(); var thisLine = $(this).parent().parent(); var newLine = thisLine.clone(); - $(newLine).find('.search-term-input select[name="op"]').first().prop("disabled",false).show(); - newLine.find('input').val(''); + $(newLine).find(".search-term-input select[name='op']").first().prop("disabled",false).show(); + newLine.find("input").val(""); thisLine.after(newLine); }); - $(document).on("click", '.ButtonLess', function(e) { + $(document).on("click", ".ButtonLess", function(e) { e.preventDefault(); if( $("a.ButtonLess").length <= 2 ) { - $('.ButtonLess').hide(); + $(".ButtonLess").hide(); } $(this).parent().parent().remove(); - $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide(); + $(".search-term-row .search-term-input select[name='op']").first().prop("disabled",true).hide(); }); [% END %] -- 2.39.5