Bugzilla – Attachment 179833 Details for
Bug 39398
Improve style and layout of staff interface advanced search form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39398: Improve style and layout of staff interface advanced search form
Bug-39398-Improve-style-and-layout-of-staff-interf.patch (text/plain), 90.86 KB, created by
Owen Leonard
on 2025-03-28 12:41:08 UTC
(
hide
)
Description:
Bug 39398: Improve style and layout of staff interface advanced search form
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-03-28 12:41:08 UTC
Size:
90.86 KB
patch
obsolete
>From 9ef3269da39a90f941940249697189f736ae21a0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 %] >-<select class="advsearch" name="idx" id="[% select_id | html %]"> >- [% IF ms_kw %] >- <option selected="selected" value="kw">Keyword</option> >- [% ELSE %] >- <option value="kw">Keyword</option> >- [% END %] >- [% IF ms_kwcommaphr %] >- <option selected="selected" value="kw,phr"> Keyword as phrase</option> >- [% ELSE %] >- <option value="kw,phr"> Keyword as phrase</option> >- [% END %] >- [% IF ms_au %] >- <option selected="selected" value="au">Author</option> >- [% ELSE %] >- <option value="au">Author</option> >- [% END %] >- [% IF ms_aucommaphr %] >- <option selected="selected" value="au,phr"> Author as phrase</option> >- [% ELSE %] >- <option value="au,phr"> Author as phrase</option> >- [% END %] >- [% IF ms_cpn %] >- <option selected="selected" value="cpn"> Corporate name</option> >- [% ELSE %] >- <option value="cpn"> Corporate name</option> >- [% END %] >- [% IF ms_cfn %] >- <option selected="selected" value="cfn"> Conference name</option> >- [% ELSE %] >- <option value="cfn"> Conference name</option> >- [% END %] >- [% IF ms_cpncommaphr %] >- <option selected="selected" value="cpn,phr"> Corporate name as phrase</option> >- [% ELSE %] >- <option value="cpn,phr"> Corporate name as phrase</option> >- [% END %] >- [% IF ms_cfncommaphr %] >- <option selected="selected" value="cfn,phr"> Conference name as phrase</option> >- [% ELSE %] >- <option value="cfn,phr"> Conference name as phrase</option> >- [% END %] >- [% IF ms_pn %] >- <option selected="selected" value="pn"> Personal name</option> >- [% ELSE %] >- <option value="pn"> Personal name</option> >- [% END %] >- [% IF ms_pncommaphr %] >- <option selected="selected" value="pn,phr"> Personal name as phrase</option> >- [% ELSE %] >- <option value="pn,phr"> Personal name as phrase</option> >- [% END %] >- [% IF ms_ti %] >- <option selected="selected" value="ti">Title</option> >- [% ELSE %] >- <option value="ti">Title</option> >- [% END %] >- [% IF ms_ticommaphr %] >- <option selected="selected" value="ti,phr"> Title as phrase</option> >- [% ELSE %] >- <option value="ti,phr"> Title as phrase</option> >- [% END %] >- [% IF ms_se %] >- <option selected="seleced" value="se"> Series title</option> >- [% ELSE %] >- <option value="se"> Series title</option> >- [% END %] >- [% IF ms_su %] >- <option selected="selected" value="su">Subject</option> >- [% ELSE %] >- <option value="su">Subject</option> >- [% END %] >- [% IF ms_sucommaphr %] >- <option selected="selected" value="su,phr"> Subject as phrase</option> >- [% ELSE %] >- <option value="su,phr"> Subject as phrase</option> >- [% END %] >- [% IF ( expanded_options ) %] >- [% IF ms_sudashbr %] >- <option selected="selected" value="su-br"> Subject and broader terms</option> >- [% ELSE %] >- <option value="su-br"> Subject and broader terms</option> >- [% END %] >- [% IF ms_sudashna %] >- <option selected="selected" value="su-na"> Subject and narrower terms</option> >- [% ELSE %] >- <option value="su-na"> Subject and narrower terms</option> >- [% END %] >- [% IF ms_sudashrl %] >- <option selected="selected" value="su-rl"> Subject and related terms</option> >- [% ELSE %] >- <option value="su-rl"> Subject and related terms</option> >- [% END %] >- [% END %] >- [% IF ms_bc %] >- <option selected="selected" value="bc">Barcode</option> >- [% ELSE %] >- <option value="bc">Barcode</option> >- [% END %] >- [% IF ms_locationcommawrdl %] >- <option selected="selected" value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option> >- [% ELSE %] >- <option value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option> >- [% END %] >- [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] >- [% IF ms_identcommaphr %] >- <option selected="selected" value="ident,phr">Standard number</option> >- [% ELSE %] >- <option value="ident,phr">Standard number</option> >- [% END %] >- [% ELSE %] >- [% IF ms_ident %] >- <option selected="selected" value="ident">Standard number</option> >- [% ELSE %] >- <option value="ident">Standard number</option> >- [% END %] >- [% END %] >- [% IF ms_nb %] >- <option selected="selected" value="nb"> ISBN</option> >- [% ELSE %] >- <option value="nb"> ISBN</option> >- [% END %] >- [% IF ms_ns %] >- <option selected="selected" value="ns"> ISSN</option> >- [% ELSE %] >- <option value="ns"> ISSN</option> >- [% END %] >- [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] >- [% IF ms_callnumcommaphr %] >- <option selected="selected" value="callnum,phr"> Call number</option> >- [% ELSE %] >- <option value="callnum,phr"> Call number</option> >- [% END %] >- [% ELSE %] >- [% IF ms_callnum %] >- <option selected="selected" value="callnum"> Call number</option> >- [% ELSE %] >- <option value="callnum"> Call number</option> >- [% END %] >- [% END %] >- [% IF ms_lncommartrn %] >- <option selected="selected" value="ln,rtrn">Language</option> >- [% ELSE %] >- <option value="ln,rtrn">Language</option> >- [% END %] >- [% IF ms_nt %] >- <option selected="selected" value="nt">Notes/Comments</option> >- [% ELSE %] >- <option value="nt">Notes/Comments</option> >- [% END %] >- [% IF (marcflavour != 'UNIMARC' ) %] >- [% IF ms_curriculum %] >- <option selected="selected" value="curriculum">Curriculum</option> >- [% ELSE %] >- <option value="curriculum">Curriculum</option> >- [% END %] >- [% END %] >- [% IF ms_pb %] >- <option selected="selected" value="pb">Publisher</option> >- [% ELSE %] >- <option value="pb">Publisher</option> >- [% END %] >- [% IF ms_pl %] >- <option selected="selected" value="pl">Publisher location</option> >- [% ELSE %] >- <option value="pl">Publisher location</option> >- [% END %] >+<div class="search-term-input"> >+ <select class="advsearch" name="idx" id="[% select_id | html %]"> >+ [% IF ms_kw %] >+ <option selected="selected" value="kw">Keyword</option> >+ [% ELSE %] >+ <option value="kw">Keyword</option> >+ [% END %] >+ [% IF ms_kwcommaphr %] >+ <option selected="selected" value="kw,phr"> Keyword as phrase</option> >+ [% ELSE %] >+ <option value="kw,phr"> Keyword as phrase</option> >+ [% END %] >+ [% IF ms_au %] >+ <option selected="selected" value="au">Author</option> >+ [% ELSE %] >+ <option value="au">Author</option> >+ [% END %] >+ [% IF ms_aucommaphr %] >+ <option selected="selected" value="au,phr"> Author as phrase</option> >+ [% ELSE %] >+ <option value="au,phr"> Author as phrase</option> >+ [% END %] >+ [% IF ms_cpn %] >+ <option selected="selected" value="cpn"> Corporate name</option> >+ [% ELSE %] >+ <option value="cpn"> Corporate name</option> >+ [% END %] >+ [% IF ms_cfn %] >+ <option selected="selected" value="cfn"> Conference name</option> >+ [% ELSE %] >+ <option value="cfn"> Conference name</option> >+ [% END %] >+ [% IF ms_cpncommaphr %] >+ <option selected="selected" value="cpn,phr"> Corporate name as phrase</option> >+ [% ELSE %] >+ <option value="cpn,phr"> Corporate name as phrase</option> >+ [% END %] >+ [% IF ms_cfncommaphr %] >+ <option selected="selected" value="cfn,phr"> Conference name as phrase</option> >+ [% ELSE %] >+ <option value="cfn,phr"> Conference name as phrase</option> >+ [% END %] >+ [% IF ms_pn %] >+ <option selected="selected" value="pn"> Personal name</option> >+ [% ELSE %] >+ <option value="pn"> Personal name</option> >+ [% END %] >+ [% IF ms_pncommaphr %] >+ <option selected="selected" value="pn,phr"> Personal name as phrase</option> >+ [% ELSE %] >+ <option value="pn,phr"> Personal name as phrase</option> >+ [% END %] >+ [% IF ms_ti %] >+ <option selected="selected" value="ti">Title</option> >+ [% ELSE %] >+ <option value="ti">Title</option> >+ [% END %] >+ [% IF ms_ticommaphr %] >+ <option selected="selected" value="ti,phr"> Title as phrase</option> >+ [% ELSE %] >+ <option value="ti,phr"> Title as phrase</option> >+ [% END %] >+ [% IF ms_se %] >+ <option selected="seleced" value="se"> Series title</option> >+ [% ELSE %] >+ <option value="se"> Series title</option> >+ [% END %] >+ [% IF ms_su %] >+ <option selected="selected" value="su">Subject</option> >+ [% ELSE %] >+ <option value="su">Subject</option> >+ [% END %] >+ [% IF ms_sucommaphr %] >+ <option selected="selected" value="su,phr"> Subject as phrase</option> >+ [% ELSE %] >+ <option value="su,phr"> Subject as phrase</option> >+ [% END %] >+ [% IF ( expanded_options ) %] >+ [% IF ms_sudashbr %] >+ <option selected="selected" value="su-br"> Subject and broader terms</option> >+ [% ELSE %] >+ <option value="su-br"> Subject and broader terms</option> >+ [% END %] >+ [% IF ms_sudashna %] >+ <option selected="selected" value="su-na"> Subject and narrower terms</option> >+ [% ELSE %] >+ <option value="su-na"> Subject and narrower terms</option> >+ [% END %] >+ [% IF ms_sudashrl %] >+ <option selected="selected" value="su-rl"> Subject and related terms</option> >+ [% ELSE %] >+ <option value="su-rl"> Subject and related terms</option> >+ [% END %] >+ [% END %] >+ [% IF ms_bc %] >+ <option selected="selected" value="bc">Barcode</option> >+ [% ELSE %] >+ <option value="bc">Barcode</option> >+ [% END %] >+ [% IF ms_locationcommawrdl %] >+ <option selected="selected" value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option> >+ [% ELSE %] >+ <option value="location,wrdl" title="Enter location code value for search">Shelving location (code)</option> >+ [% END %] >+ [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] >+ [% IF ms_identcommaphr %] >+ <option selected="selected" value="ident,phr">Standard number</option> >+ [% ELSE %] >+ <option value="ident,phr">Standard number</option> >+ [% END %] >+ [% ELSE %] >+ [% IF ms_ident %] >+ <option selected="selected" value="ident">Standard number</option> >+ [% ELSE %] >+ <option value="ident">Standard number</option> >+ [% END %] >+ [% END %] >+ [% IF ms_nb %] >+ <option selected="selected" value="nb"> ISBN</option> >+ [% ELSE %] >+ <option value="nb"> ISBN</option> >+ [% END %] >+ [% IF ms_ns %] >+ <option selected="selected" value="ns"> ISSN</option> >+ [% ELSE %] >+ <option value="ns"> ISSN</option> >+ [% END %] >+ [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] >+ [% IF ms_callnumcommaphr %] >+ <option selected="selected" value="callnum,phr"> Call number</option> >+ [% ELSE %] >+ <option value="callnum,phr"> Call number</option> >+ [% END %] >+ [% ELSE %] >+ [% IF ms_callnum %] >+ <option selected="selected" value="callnum"> Call number</option> >+ [% ELSE %] >+ <option value="callnum"> Call number</option> >+ [% END %] >+ [% END %] >+ [% IF ms_lncommartrn %] >+ <option selected="selected" value="ln,rtrn">Language</option> >+ [% ELSE %] >+ <option value="ln,rtrn">Language</option> >+ [% END %] >+ [% IF ms_nt %] >+ <option selected="selected" value="nt">Notes/Comments</option> >+ [% ELSE %] >+ <option value="nt">Notes/Comments</option> >+ [% END %] >+ [% IF (marcflavour != 'UNIMARC' ) %] >+ [% IF ms_curriculum %] >+ <option selected="selected" value="curriculum">Curriculum</option> >+ [% ELSE %] >+ <option value="curriculum">Curriculum</option> >+ [% END %] >+ [% END %] >+ [% IF ms_pb %] >+ <option selected="selected" value="pb">Publisher</option> >+ [% ELSE %] >+ <option value="pb">Publisher</option> >+ [% END %] >+ [% IF ms_pl %] >+ <option selected="selected" value="pl">Publisher location</option> >+ [% ELSE %] >+ <option value="pl">Publisher location</option> >+ [% 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 %] >- <option selected="selected" value="yr,st-year">Publication date (yyyy-yyyy)</option> >- [% ELSE %] >- <option value="yr,st-year">Publication date (yyyy-yyyy)</option> >- [% END %] >- [% IF ms_acqdatecommastdashdatedashnormalized %] >- <option selected="selected" value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >- [% ELSE %] >- <option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >- [% END %] >-</select> >+ [%# 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 %] >+ <option selected="selected" value="yr,st-year">Publication date (yyyy-yyyy)</option> >+ [% ELSE %] >+ <option value="yr,st-year">Publication date (yyyy-yyyy)</option> >+ [% END %] >+ [% IF ms_acqdatecommastdashdatedashnormalized %] >+ <option selected="selected" value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >+ [% ELSE %] >+ <option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >+ [% END %] >+ </select> >+</div> >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 -%] >- <select name="limit" class="subtype"> >- [% IF ( limits.aud.size ) %] >- <option value="" class="menuheader">Any audience</option> >- [% ELSE %] >- <option value="" selected="selected" class="menuheader">Any audience</option> >- [% END %] >- [% IF (limits.aud.0 == 'a' ) %] >- <option selected="selected" value="aud:a">Preschool</option> >- [% ELSE %] >- <option value="aud:a">Preschool</option> >- [% END %] >- [% IF (limits.aud.0 == 'b' ) %] >- <option value="aud:b" selected="selected">Primary</option> >- [% ELSE %] >- <option value="aud:b">Primary</option> >- [% END %] >- [% IF (limits.aud.0 == 'c' ) %] >- <option value="aud:c" selected="selected">Pre-adolescent</option> >- [% ELSE %] >- <option value="aud:c">Pre-adolescent</option> >- [% END %] >- [% IF (limits.aud.0 == 'd' ) %] >- <option value="aud:d" selected="selected">Adolescent</option> >- [% ELSE %] >- <option value="aud:d">Adolescent</option> >- [% END %] >- [% IF (limits.aud.0 == 'e' ) %] >- <option value="aud:e" selected="selected">Adult</option> >- [% ELSE %] >- <option value="aud:e">Adult</option> >- [% END %] >- [% IF (limits.aud.0 == 'f' ) %] >- <option value="aud:f" selected="selected">Specialized</option> >- [% ELSE %] >- <option value="aud:f">Specialized</option> >- [% END %] >- [% IF (limits.aud.0 == 'g' ) %] >- <option value="aud:g" selected="selected">General</option> >- [% ELSE %] >- <option value="aud:g">General</option> >- [% END %] >- [% IF (limits.aud.0 == 'j' ) %] >- <option value="aud:j" selected="selected">Juvenile</option> >- [% ELSE %] >- <option value="aud:j">Juvenile</option> >- [% END %] >- [% limits.delete( 'aud' ) %] >- </select> >+ <p> >+ <label for="subtype_limit">Audience</label> >+ <select id="audience_limit" name="limit" class="subtype"> >+ [% IF ( limits.aud.size ) %] >+ <option value="" class="menuheader">Any audience</option> >+ [% ELSE %] >+ <option value="" selected="selected" class="menuheader">Any audience</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'a' ) %] >+ <option selected="selected" value="aud:a">Preschool</option> >+ [% ELSE %] >+ <option value="aud:a">Preschool</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'b' ) %] >+ <option value="aud:b" selected="selected">Primary</option> >+ [% ELSE %] >+ <option value="aud:b">Primary</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'c' ) %] >+ <option value="aud:c" selected="selected">Pre-adolescent</option> >+ [% ELSE %] >+ <option value="aud:c">Pre-adolescent</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'd' ) %] >+ <option value="aud:d" selected="selected">Adolescent</option> >+ [% ELSE %] >+ <option value="aud:d">Adolescent</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'e' ) %] >+ <option value="aud:e" selected="selected">Adult</option> >+ [% ELSE %] >+ <option value="aud:e">Adult</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'f' ) %] >+ <option value="aud:f" selected="selected">Specialized</option> >+ [% ELSE %] >+ <option value="aud:f">Specialized</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'g' ) %] >+ <option value="aud:g" selected="selected">General</option> >+ [% ELSE %] >+ <option value="aud:g">General</option> >+ [% END %] >+ [% IF (limits.aud.0 == 'j' ) %] >+ <option value="aud:j" selected="selected">Juvenile</option> >+ [% ELSE %] >+ <option value="aud:j">Juvenile</option> >+ [% END %] >+ [% limits.delete( 'aud' ) %] >+ </select> >+ </p> > >- <select name="limit" class="subtype"> >- [% IF ( limits.fic.size OR limits.bio.size OR limits.mus.size ) %] >- <option value="" class="menuheader">Any content</option> >- [% ELSE %] >- <option value="" selected="selected" class="menuheader">Any content</option> >- [% END %] >- [% IF (limits.fic.0 == '1' ) %] >- <option value="fic:1" selected="selected">Fiction</option> >- [% ELSE %] >- <option value="fic:1">Fiction</option> >- [% END %] >- [% IF (limits.fic.0 == '0' ) %] >- <option value="fic:0" selected="selected">Non-fiction</option> >- [% ELSE %] >- <option value="fic:0">Non-fiction</option> >- [% END %] >- [% IF (limits.bio.0 == 'b' ) %] >- <option value="bio:b" selected="selected">Biography</option> >- [% ELSE %] >- <option value="bio:b">Biography</option> >- [% END %] >- [% IF (limits.mus.0 == 'j' ) %] >- <option value="mus:j" selected="selected">Musical recording</option> >- [% ELSE %] >- <option value="mus:j">Musical recording</option> >- [% END %] >- [% IF (limits.mus.0 == 'i' ) %] >- <option value="mus:i" selected="selected">Non-musical recording</option> >- [% ELSE %] >- <option value="mus:i">Non-musical recording</option> >- [% END %] >- [% limits.delete( 'fic' ) %] >- [% limits.delete( 'bio' ) %] >- [% limits.delete( 'mus' ) %] >- </select> >+ <p> >+ <label for="content_limit">Content</label> >+ <select id="content_limit" name="limit" class="subtype"> >+ [% IF ( limits.fic.size OR limits.bio.size OR limits.mus.size ) %] >+ <option value="" class="menuheader">Any content</option> >+ [% ELSE %] >+ <option value="" selected="selected" class="menuheader">Any content</option> >+ [% END %] >+ [% IF (limits.fic.0 == '1' ) %] >+ <option value="fic:1" selected="selected">Fiction</option> >+ [% ELSE %] >+ <option value="fic:1">Fiction</option> >+ [% END %] >+ [% IF (limits.fic.0 == '0' ) %] >+ <option value="fic:0" selected="selected">Non-fiction</option> >+ [% ELSE %] >+ <option value="fic:0">Non-fiction</option> >+ [% END %] >+ [% IF (limits.bio.0 == 'b' ) %] >+ <option value="bio:b" selected="selected">Biography</option> >+ [% ELSE %] >+ <option value="bio:b">Biography</option> >+ [% END %] >+ [% IF (limits.mus.0 == 'j' ) %] >+ <option value="mus:j" selected="selected">Musical recording</option> >+ [% ELSE %] >+ <option value="mus:j">Musical recording</option> >+ [% END %] >+ [% IF (limits.mus.0 == 'i' ) %] >+ <option value="mus:i" selected="selected">Non-musical recording</option> >+ [% ELSE %] >+ <option value="mus:i">Non-musical recording</option> >+ [% END %] >+ [% limits.delete( 'fic' ) %] >+ [% limits.delete( 'bio' ) %] >+ [% limits.delete( 'mus' ) %] >+ </select> >+ </p> > >- [% SET lformat = 'l-format' %] >- <select name="limit" class="subtype"> >- [% IF ( limits.$lformat.size ) %] >- <option value="" class="menuheader">Any format</option> >- [% ELSE %] >- <option value="" selected="selected" class="menuheader">Any format</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'ta' ) %] >- <option value="l-format:ta" selected="selected">Regular print</option> >- [% ELSE %] >- <option value="l-format:ta">Regular print</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'tb' ) %] >- <option value="l-format:tb" selected="selected">Large print</option> >- [% ELSE %] >- <option value="l-format:tb">Large print</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'tc or fb' ) %] >- <option value="l-format:tc or fb" selected="selected">Braille</option> >- [% ELSE %] >- <option value="l-format:tc or fb">Braille</option> >- [% END %] >- <option value="">-----------</option> >- [% IF (limits.$lformat.0 == 'sd' ) %] >- <option value="l-format:sd" selected="selected">CD audio</option> >- [% ELSE %] >- <option value="l-format:sd">CD audio</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'ss' ) %] >- <option value="l-format:ss" selected="selected">Cassette recording</option> >- [% ELSE %] >- <option value="l-format:ss">Cassette recording</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'vf' ) %] >- <option value="l-format:vf" selected="selected">VHS tape / Videocassette</option> >- [% ELSE %] >- <option value="l-format:vf">VHS tape / Videocassette</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'vd' ) %] >- <option value="l-format:vd" selected="selected">DVD video / Videodisc</option> >- [% ELSE %] >- <option value="l-format:vd">DVD video / Videodisc</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'co' ) %] >- <option value="l-format:co" selected="selected">CD software</option> >- [% ELSE %] >- <option value="l-format:co">CD software</option> >- [% END %] >- [% IF (limits.$lformat.0 == 'cr' ) %] >- <option value="l-format:cr" selected="selected">Website</option> >- [% ELSE %] >- <option value="l-format:cr">Website</option> >- [% END %] >- [% limits.delete( 'l-format' ) %] >- </select> >+ <p> >+ [% SET lformat = 'l-format' %] >+ <label for="format_limit">Format</label> >+ <select id="format_limit" name="limit" class="subtype"> >+ [% IF ( limits.$lformat.size ) %] >+ <option value="" class="menuheader">Any format</option> >+ [% ELSE %] >+ <option value="" selected="selected" class="menuheader">Any format</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'ta' ) %] >+ <option value="l-format:ta" selected="selected">Regular print</option> >+ [% ELSE %] >+ <option value="l-format:ta">Regular print</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'tb' ) %] >+ <option value="l-format:tb" selected="selected">Large print</option> >+ [% ELSE %] >+ <option value="l-format:tb">Large print</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'tc or fb' ) %] >+ <option value="l-format:tc or fb" selected="selected">Braille</option> >+ [% ELSE %] >+ <option value="l-format:tc or fb">Braille</option> >+ [% END %] >+ <option value="">-----------</option> >+ [% IF (limits.$lformat.0 == 'sd' ) %] >+ <option value="l-format:sd" selected="selected">CD audio</option> >+ [% ELSE %] >+ <option value="l-format:sd">CD audio</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'ss' ) %] >+ <option value="l-format:ss" selected="selected">Cassette recording</option> >+ [% ELSE %] >+ <option value="l-format:ss">Cassette recording</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'vf' ) %] >+ <option value="l-format:vf" selected="selected">VHS tape / Videocassette</option> >+ [% ELSE %] >+ <option value="l-format:vf">VHS tape / Videocassette</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'vd' ) %] >+ <option value="l-format:vd" selected="selected">DVD video / Videodisc</option> >+ [% ELSE %] >+ <option value="l-format:vd">DVD video / Videodisc</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'co' ) %] >+ <option value="l-format:co" selected="selected">CD software</option> >+ [% ELSE %] >+ <option value="l-format:co">CD software</option> >+ [% END %] >+ [% IF (limits.$lformat.0 == 'cr' ) %] >+ <option value="l-format:cr" selected="selected">Website</option> >+ [% ELSE %] >+ <option value="l-format:cr">Website</option> >+ [% END %] >+ [% limits.delete( 'l-format' ) %] >+ </select> >+ </p> > >- <select name="limit" class="subtype"> >- [% IF ( limits.ctype.size ) %] >- <option value="">Additional content types</option> >- [% ELSE %] >- <option value="" selected="selected">Additional content types</option> >- [% END %] >- [% IF (limits.ctype.0 == 'a' ) %] >- <option value="ctype:a" selected="selected">Abstracts / Summaries</option> >- [% ELSE %] >- <option value="ctype:a">Abstracts / Summaries</option> >- [% END %] >- [% IF (limits.ctype.0 == 'b' ) %] >- <option value="ctype:b" selected="selected">Bibliographies</option> >- [% ELSE %] >- <option value="ctype:b">Bibliographies</option> >- [% END %] >- [% IF (limits.ctype.0 == 'c' ) %] >- <option value="ctype:c" selected="selected">Catalogs</option> >- [% ELSE %] >- <option value="ctype:c">Catalogs</option> >- [% END %] >- [% IF (limits.ctype.0 == 'e' ) %] >- <option value="ctype:e" selected="selected">Encyclopedias </option> >- [% ELSE %] >- <option value="ctype:e">Encyclopedias </option> >- [% END %] >- [% IF (limits.ctype.0 == 'f' ) %] >- <option value="ctype:f" selected="selected">Handbooks</option> >- [% ELSE %] >- <option value="ctype:f">Handbooks</option> >- [% END %] >- [% IF (limits.ctype.0 == 'g' ) %] >- <option value="ctype:g" selected="selected">Legal articles</option> >- [% ELSE %] >- <option value="ctype:g">Legal articles</option> >- [% END %] >- [% IF (limits.ctype.0 == 'i' ) %] >- <option value="ctype:i" selected="selected">Indexes</option> >- [% ELSE %] >- <option value="ctype:i">Indexes</option> >- [% END %] >- [% IF (limits.ctype.0 == 'j' ) %] >- <option value="ctype:j" selected="selected">Patent document</option> >- [% ELSE %] >- <option value="ctype:j">Patent document</option> >- [% END %] >- [% IF (limits.ctype.0 == 'k' ) %] >- <option value="ctype:k" selected="selected">Discographies</option> >- [% ELSE %] >- <option value="ctype:k">Discographies</option> >- [% END %] >- [% IF (limits.ctype.0 == 'l' ) %] >- <option value="ctype:l" selected="selected">Legislation</option> >- [% ELSE %] >- <option value="ctype:l">Legislation</option> >- [% END %] >- [% IF (limits.ctype.0 == 'm' ) %] >- <option value="ctype:m" selected="selected">Theses</option> >- [% ELSE %] >- <option value="ctype:m">Theses</option> >- [% END %] >- [% IF (limits.ctype.0 == 'n' ) %] >- <option value="ctype:n" selected="selected">Surveys</option> >- [% ELSE %] >- <option value="ctype:n">Surveys</option> >- [% END %] >- [% IF (limits.ctype.0 == 'o' ) %] >- <option value="ctype:o" selected="selected">Reviews</option> >- [% ELSE %] >- <option value="ctype:o">Reviews</option> >- [% END %] >- [% IF (limits.ctype.0 == 'p' ) %] >- <option value="ctype:p" selected="selected">Programmed texts</option> >- [% ELSE %] >- <option value="ctype:p">Programmed texts</option> >- [% END %] >- [% IF (limits.ctype.0 == 'q' ) %] >- <option value="ctype:q" selected="selected">Filmographies</option> >- [% ELSE %] >- <option value="ctype:q">Filmographies</option> >- [% END %] >- [% IF (limits.ctype.0 == 'r' ) %] >- <option value="ctype:r" selected="selected">Directories</option> >- [% ELSE %] >- <option value="ctype:r">Directories</option> >- [% END %] >- [% IF (limits.ctype.0 == 's' ) %] >- <option value="ctype:s" selected="selected">Statistics</option> >- [% ELSE %] >- <option value="ctype:s">Statistics</option> >- [% END %] >- [% IF (limits.ctype.0 == 't' ) %] >- <option value="ctype:t" selected="selected">Technical reports</option> >- [% ELSE %] >- <option value="ctype:t">Technical reports</option> >- [% END %] >- [% IF (limits.ctype.0 == 'v' ) %] >- <option value="ctype:v" selected="selected">Legal cases and case notes</option> >- [% ELSE %] >- <option value="ctype:v">Legal cases and case notes</option> >- [% END %] >- [% IF (limits.ctype.0 == 'w' ) %] >- <option value="ctype:w" selected="selected">Law reports and digests</option> >- [% ELSE %] >- <option value="ctype:w">Law reports and digests</option> >- [% END %] >- [% IF (limits.ctype.0 == 'z' ) %] >- <option value="ctype:z" selected="selected">Treaties </option> >- [% ELSE %] >- <option value="ctype:z">Treaties </option> >- [% END %] >- [% limits.delete( 'ctype' ) %] >- </select> >+ <p> >+ <label for="additional_content_limit">Additional content types</label> >+ <select id="additional_content_limit" name="limit" class="subtype"> >+ [% IF ( limits.ctype.size ) %] >+ <option value="">Additional content types</option> >+ [% ELSE %] >+ <option value="" selected="selected">Additional content types</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'a' ) %] >+ <option value="ctype:a" selected="selected">Abstracts / Summaries</option> >+ [% ELSE %] >+ <option value="ctype:a">Abstracts / Summaries</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'b' ) %] >+ <option value="ctype:b" selected="selected">Bibliographies</option> >+ [% ELSE %] >+ <option value="ctype:b">Bibliographies</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'c' ) %] >+ <option value="ctype:c" selected="selected">Catalogs</option> >+ [% ELSE %] >+ <option value="ctype:c">Catalogs</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'e' ) %] >+ <option value="ctype:e" selected="selected">Encyclopedias </option> >+ [% ELSE %] >+ <option value="ctype:e">Encyclopedias </option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'f' ) %] >+ <option value="ctype:f" selected="selected">Handbooks</option> >+ [% ELSE %] >+ <option value="ctype:f">Handbooks</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'g' ) %] >+ <option value="ctype:g" selected="selected">Legal articles</option> >+ [% ELSE %] >+ <option value="ctype:g">Legal articles</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'i' ) %] >+ <option value="ctype:i" selected="selected">Indexes</option> >+ [% ELSE %] >+ <option value="ctype:i">Indexes</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'j' ) %] >+ <option value="ctype:j" selected="selected">Patent document</option> >+ [% ELSE %] >+ <option value="ctype:j">Patent document</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'k' ) %] >+ <option value="ctype:k" selected="selected">Discographies</option> >+ [% ELSE %] >+ <option value="ctype:k">Discographies</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'l' ) %] >+ <option value="ctype:l" selected="selected">Legislation</option> >+ [% ELSE %] >+ <option value="ctype:l">Legislation</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'm' ) %] >+ <option value="ctype:m" selected="selected">Theses</option> >+ [% ELSE %] >+ <option value="ctype:m">Theses</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'n' ) %] >+ <option value="ctype:n" selected="selected">Surveys</option> >+ [% ELSE %] >+ <option value="ctype:n">Surveys</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'o' ) %] >+ <option value="ctype:o" selected="selected">Reviews</option> >+ [% ELSE %] >+ <option value="ctype:o">Reviews</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'p' ) %] >+ <option value="ctype:p" selected="selected">Programmed texts</option> >+ [% ELSE %] >+ <option value="ctype:p">Programmed texts</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'q' ) %] >+ <option value="ctype:q" selected="selected">Filmographies</option> >+ [% ELSE %] >+ <option value="ctype:q">Filmographies</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'r' ) %] >+ <option value="ctype:r" selected="selected">Directories</option> >+ [% ELSE %] >+ <option value="ctype:r">Directories</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 's' ) %] >+ <option value="ctype:s" selected="selected">Statistics</option> >+ [% ELSE %] >+ <option value="ctype:s">Statistics</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 't' ) %] >+ <option value="ctype:t" selected="selected">Technical reports</option> >+ [% ELSE %] >+ <option value="ctype:t">Technical reports</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'v' ) %] >+ <option value="ctype:v" selected="selected">Legal cases and case notes</option> >+ [% ELSE %] >+ <option value="ctype:v">Legal cases and case notes</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'w' ) %] >+ <option value="ctype:w" selected="selected">Law reports and digests</option> >+ [% ELSE %] >+ <option value="ctype:w">Law reports and digests</option> >+ [% END %] >+ [% IF (limits.ctype.0 == 'z' ) %] >+ <option value="ctype:z" selected="selected">Treaties </option> >+ [% ELSE %] >+ <option value="ctype:z">Treaties </option> >+ [% END %] >+ [% limits.delete( 'ctype' ) %] >+ </select> >+ </p> > [%- 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 @@ >-<p> >- <a id="show_coded_fields" class="toggle_element" data-element="#Coded_Fields,#show_coded_fields,#hide_coded_fields" href="#"><i class="fa-solid fa-square-plus"></i> Show coded information filters</a> >- <a id="hide_coded_fields" class="toggle_element" data-element="#Coded_Fields,#show_coded_fields,#hide_coded_fields" href="#" style="display:none;"><i class="fa-solid fa-square-minus"></i> Hide coded information filters</a> >-</p> >-<div style="display:none;" id="Coded_Fields"> >- <!-- SUBTYPE LIMITS --> >+<!-- SUBTYPE LIMITS --> >+<div> > <fieldset> > <legend>Coded fields</legend> > <p> >@@ -54,6 +50,11 @@ > <option value="lf:z">multiple/other literary forms</option> > </select> > </p> >+ </fieldset> >+</div> >+<div> >+ <fieldset> >+ <legend>More coded fields</legend> > <p> > <label for="biography">Biography: </label> > <select id="biography" name="limit" class="subtype"> >@@ -126,7 +127,8 @@ > </select> > </p> > </fieldset> >- >+</div> >+<div> > <fieldset> > <legend>Serials</legend> > <p> >@@ -177,7 +179,8 @@ > </select> > </p> > </fieldset> >- >+</div> >+<div> > <fieldset> > <legend>Picture</legend> > <p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index 5e71518f4bc..2e51f30fa43 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -12,6 +12,167 @@ > [% END %]</title > > > [% INCLUDE 'doc-head-close.inc' %] >+[% FILTER collapse %] >+ <style> >+ #advanced-search { >+ select, >+ input[type="text"] { >+ background-color: #fff; >+ border: 1px solid #aaaaaa; >+ border-radius: 4px; >+ color: #495057; >+ display: inline-block; >+ height: calc(1.5em + 0.75rem + 2px); >+ line-height: 1.5; >+ padding: 0.375rem 0.75rem; >+ width: 100%; >+ } >+ } >+ >+ #advsearches { >+ margin-bottom: 0.375rem; >+ } >+ >+ #advsearches .tab-pane { >+ } >+ >+ #advsearches table { >+ border-collapse: separate; >+ border-spacing: 5px; >+ border-width: 0; >+ } >+ >+ #advsearches td { >+ border: 1px solid #eee; >+ padding: 0.3em 0.4em; >+ } >+ >+ #searchterms .search-term-input { >+ margin: 0.375rem; >+ } >+ >+ #searchterms .search-term-input.search-more-options { >+ grid-column-end: 4; >+ grid-column-start: 2; >+ margin-left: -1.2rem; >+ } >+ >+ @media only screen and (min-width: 608px) { >+ #searchterms { >+ .search-term-row { >+ column-gap: 0.5rem; >+ display: grid; >+ grid-template-columns: 30% 40% 30%; >+ margin-bottom: 0.5rem; >+ >+ &.extended { >+ grid-template-columns: 10% 30% 40% 20%; >+ } >+ } >+ >+ .search-term-input { >+ margin: 0; >+ } >+ } >+ } >+ >+ @media only screen and (min-width: 608px) { >+ .search-limits { >+ align-items: stretch; >+ display: grid; >+ gap: 0.5rem; >+ grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); >+ } >+ } >+ >+ @media only screen and (min-width: 769px) { >+ .search-limits { >+ } >+ } >+ >+ .search-limits { >+ margin-bottom: 0.375rem; >+ } >+ >+ .search-limits div { >+ background-color: #fff; >+ flex: 1; >+ } >+ >+ .search-limits fieldset { >+ margin: 0; >+ } >+ >+ .search-limits label { >+ display: block; >+ font-weight: bold; >+ margin: 0.375rem 0; >+ } >+ >+ .search-limit-check { >+ display: flex; >+ gap: 0.375rem; >+ margin-bottom: 1rem; >+ } >+ .search-limit-check input[type="checkbox"] { >+ flex-shrink: 1; >+ } >+ .search-limit-check label { >+ display: inline-block; >+ } >+ >+ .limit-grid { >+ display: grid; >+ gap: 0.5rem; >+ grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); >+ } >+ >+ .itemtypeimages { >+ grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); >+ } >+ >+ .limit-grid-cell { >+ align-items: flex-start; >+ border: 1px solid #eee; >+ display: flex; >+ flex-direction: row; >+ padding: 0.375rem; >+ } >+ >+ .limit-grid-cell:has(img) { >+ flex-direction: column; >+ } >+ >+ .limit-grid-cell img, >+ .limit-grid-cell input { >+ flex-shrink: 1; >+ flex-grow: 0; >+ } >+ >+ .limit-grid-input { >+ border: 0; >+ display: flex; >+ flex-direction: row; >+ gap: 0.5rem; >+ justify-content: center; >+ } >+ >+ .limit-grid-input + label { >+ display: block; >+ margin-left: 0.5rem; >+ text-align: left; >+ } >+ >+ .ButtonLess .fa, >+ .ButtonPlus .fa { >+ padding: 3px 3px 0 5px; >+ } >+ >+ .ButtonPlus { >+ padding: 0.375rem 0.75rem; >+ } >+ </style> >+[% END %] > </head> > > [%- BLOCK language_limit_select -%] >@@ -44,28 +205,30 @@ > <form action="search.pl" method="get"> > <div id="advanced-search"> > [% IF edit_filter %] >- <div id="toolbar" class="btn-toolbar"> >- <legend>Editing filter: [% edit_filter.name | html %]</legend> >- <div class="p-2"> >- <label for="filter_edit_opac">Show in OPAC?</label> >- [% IF edit_filter.opac %] >- <input type="checkbox" id="show_filter_opac" name="show_filter_opac" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="show_filter_opac" name="show_filter_opac" /> >- [% END %] >- <label for="filter_edit_staff_client">Show in staff interface?</label> >- [% IF edit_filter.staff_client %] >- <input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" checked="checked" /> >- [% ELSE %] >- <input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" /> >- [% END %] >- </div> >- <hr /> >- <div class="btn-group"> >- <button id="save_filter" class="btn btn-default"><i class="fa fa-save"></i> Save filter</button> >+ <div id="edit_search_filter" class="page-section"> >+ <h2>Editing filter: [% edit_filter.name | html %]</h2> >+ <div class="d-inline-flex gap-1"> >+ <div class="btn-group"> >+ <label class="btn label-btn"> >+ [% IF edit_filter.opac %] >+ <input type="checkbox" id="show_filter_opac" name="show_filter_opac" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="show_filter_opac" name="show_filter_opac" /> >+ [% END %] >+ Show in OPAC? >+ </label> >+ </div> >+ >+ <label class="btn label-btn"> >+ [% IF edit_filter.staff_client %] >+ <input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" id="filter_edit_staff_client" name="filter_edit_staff_client" /> >+ [% END %] >+ Show in staff interface? >+ </label> >+ <button id="save_filter" class="btn btn-primary"><i class="fa fa-save"></i> Save filter</button> > <button class="btn btn-default" type="submit" accesskey="s"><i class="fa fa-search"></i> Search using filter</button> >- </div> >- <div class="btn-group"> > <a href="/cgi-bin/koha/catalogue/search.pl?do=Clear&expanded_options=[% expanded_options | uri %]" class="btn btn-link"><i class="fa fa-trash-can"></i> Cancel</a> > </div> > </div> >@@ -106,19 +269,15 @@ > <fieldset id="searchterms"> > <legend>Search for </legend> > [% FOREACH query IN operands %] >- [% SET div_style = '' %] >- [% SET div_class = '' %] >+ [% SET div_class = 'search-term-row' %] > [% IF expanded_options %] >- [% div_class='search-term-row' %] >- [% END %] >- [% IF expanded_options && loop.first %] >- [% div_style = 'text-indent: 4.25em;' %] >+ [% div_class='search-term-row extended' %] > [% END %] > > <div class="[% div_class | html %]" style="[% div_style | html %]"> > [% IF ( expanded_options ) %] >- [% IF loop.first %] >- [% SET opindex = loop.index - 1 %] >+ [% SET opindex = loop.index - 1 %] >+ <div class="search-term-input"> > <select name="op"> > [% IF operators.$opindex == 'OR' %] > <option value="AND">and</option> >@@ -134,39 +293,46 @@ > <option value="NOT">not</option> > [% END %] > </select> >- [% END %] >+ </div> > [% END %] > [% SET preselect = 'ms_' _ indexes.${loop.index}.replace(',','comma') %] > [% INCLUDE 'search_indexes.inc' ${preselect} = 1 index = loop.index %] >- <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" /> >+ <div class="search-term-input"> >+ <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" /> >+ </div> > [% IF ( expanded_options ) %] >- [% IF ( loop.last ) %] >- <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a> >- [% END %] >- [% IF ( loop.first ) %] >- <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" /> >- [% END %] >+ <div class="search-term-input"> >+ [% UNLESS ( loop.first ) %] >+ <a class="ButtonPlus" title="Add another field" href="#"><i class="fa fa-xl fa-plus-square" aria-hidden="true"></i></a> >+ <a class="ButtonLess" title="Remove field" href="#"><i class="fa fa-xl fa-minus-square" aria-hidden="true"></i></a> >+ [% END %] >+ </div> > [% END %] > </div> >- [% END %] >- [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %] >- [% IF ( expanded_options ) %] >- <p> >- [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %] >- <label><input type="checkbox" name="whole_record" /> Search entire MARC record</label> >+ <div class="[% div_class | html %]" style="[% div_style | html %]"> >+ <div class="search-term-input search-more-options"> >+ [% IF ( expanded_options ) %] >+ [% IF ( loop.last ) %] >+ [% IF ( Koha.Preference('SearchEngine') == 'Elasticsearch' ) %] >+ [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %] >+ <label class="btn label-btn"><input type="checkbox" name="whole_record" /> Search entire MARC record</label> >+ [% END %] >+ <label id="weight_search" class="btn label-btn"><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label> >+ [% END %] >+ <label class="btn label-btn"><input type="checkbox" name="scan" id="scan" value="1" /> Scan indexes</label> >+ [% END %] >+ [% ELSE %] >+ <input type="hidden" name="weight_search" value="1" /> > [% END %] >- <span id="weight_search"> >- <label><input type="checkbox" name="weight_search" checked="checked" /> Apply field weights to search</label> >- </span> >- </p> >- [% ELSE %] >- <input type="hidden" name="weight_search" value="1" /> >- [% END %] >+ </div> >+ </div> > [% END %] > [% IF Koha.Preference('IncludeSeeFromInSearches') %] >- <div class="hint included-see-from-headings-info"> >- <i class="fa fa-info-circle" aria-hidden="true"></i> >- See from (non-preferred form) headings are included >+ <div class="[% div_class | html %]" style="[% div_style | html %]"> >+ <div class="search-term-input hint included-see-from-headings-info" style="grid-column-start:2;grid-column-end:4"> >+ <i class="fa fa-info-circle" aria-hidden="true"></i> >+ See from (non-preferred form) headings are included >+ </div> > </div> > [% END %] > </fieldset> >@@ -189,190 +355,206 @@ > [% END # /tab_item#advsearch-tab-... %] > [% END # /FOREACH advsearchloo %] > [% END # /WRAPPER tabs_nav %] >- <!-- prettier-ignore-start --> >- [% WRAPPER tab_panels %] >- [% FOREACH advsearchloo IN advancedsearchesloop %] >- [% WRAPPER tab_panel tabname="advsearch-tab-${advsearchloo.advanced_search_type}" %] >- <h4>Limit to any of the following:</h4> >- <table> >- <tr> >- [% FOREACH itemtypeloo IN advsearchloo.code_loop %] >- <td> >- [% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %] >- [% IF limits.$limit_key.defined %] >- [% limits.delete( limit_key ) %] >- <input type="checkbox" checked="checked" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/> >- [% ELSE %] >- <input type="checkbox" id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" name="limit" value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]"/> >- [% END # /IF limits.$limit_key.defined %] >- <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> >- [% UNLESS ( Koha.Preference('noItemTypeImages') ) %] >- [% IF ( itemtypeloo.imageurl ) %] >- <img class="itemtype-image" src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> >- [% END %] >- >- [% END %] >- <span class="itypetext">[% itemtypeloo.description | html %]</span> >- </label> >- </td> >- [% IF ( loop.last ) %] >- </tr> >+ [% WRAPPER tab_panels %] >+ [% FOREACH advsearchloo IN advancedsearchesloop %] >+ [% WRAPPER tab_panel tabname="advsearch-tab-${advsearchloo.advanced_search_type}" %] >+ <h4>Limit to any of the following:</h4> >+ [% SET with_img = Koha.Preference('noItemTypeImages') ? "" : "itemtypeimages" %] >+ <div id="[% advsearchloo.advanced_search_type | html %]_grid" class="limit-grid [% with_img | html %]"> >+ [% FOREACH itemtypeloo IN advsearchloo.code_loop %] >+ <div class="limit-grid-cell"> >+ [% SET limit_key = 'mc-' _ itemtypeloo.ccl _ "_" _ itemtypeloo.code %] >+ <div class="limit-grid-input"> >+ [% IF limits.$limit_key.defined %] >+ [% limits.delete( limit_key ) %] >+ <input >+ type="checkbox" >+ checked="checked" >+ id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" >+ name="limit" >+ value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]" >+ /> > [% ELSE %] >- [% UNLESS ( loop.count % 5 ) %] >- </tr> >- <tr> >+ <input >+ type="checkbox" >+ id="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]" >+ name="limit" >+ value="mc-[% itemtypeloo.ccl | html %]:[% itemtypeloo.code | html %]" >+ /> >+ [% END # /IF limits.$limit_key.defined %] >+ [% UNLESS ( Koha.Preference('noItemTypeImages') ) %] >+ [% IF ( itemtypeloo.imageurl ) %] >+ <img class="itemtype-image" src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> > [% END %] >- [% END # /IF ( loop.last ) %] >- [% END # /FOREACH itemtypeloo %] >- </table> >- [% END # tab_panel/#advsearch-... %] >- [% END # /FOREACH advsearchloo %] >- [% END # /WRAPPER tab_panels %] >- <!-- prettier-ignore-end --> >+ [% END %] >+ </div> >+ <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> >+ <span class="itypetext">[% itemtypeloo.description | html %]</span> >+ </label> >+ </div> >+ [% END # /FOREACH itemtypeloo %] >+ </div> >+ [% END # tab_panel/#advsearch-... %] >+ [% END # /FOREACH advsearchloo %] >+ [% END # /WRAPPER tab_panels %] > [% END # /WRAPPER tabs %] > <!-- /MC-TYPE LIMIT --> > >- [% IF ( expanded_options ) %] >+ <div class="search-limits"> > <!-- BASIC LIMITS --> >- <fieldset id="basiclimits"> >- <legend>Limits</legend> >- <fieldset id="pubrange"> >+ <div id="basiclimits"> >+ <fieldset> >+ <legend>Limits</legend> > <!-- PUB / COPY YEAR LIMIT --><!-- FIXME: add publication,copyright,acquisition options --> > <p> >- <label for="limit-yr">Year: </label> >+ <label for="limit-yr">Year</label> > [% SET year_limit_key = 'yr,st-numeric' %] >- <input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]" /> (format: yyyy-yyyy) >+ <input type="text" size="15" name="limit-yr" id="limit-yr" value="[% limits.$year_limit_key.0 | html %]" /> >+ <span class="hint">(format: yyyy-yyyy)</span> > [% IF limits.$year_limit_key.defined %] > [% limits.delete(year_limit_key) %] > [% END %] > </p> > <!-- /PUB / COPY YEAR LIMIT --> >- </fieldset> >- <!-- /#pubrange --> >- >- <fieldset id="language"> > <!-- LANGUAGE LIMIT --> > <p> >- <label for="language-limit">Language: </label> >+ <label for="language-limit">Language</label> > [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-limit' ln_index='ln' selected = limits.${'ln,rtrn'}.0 %] > [% limits.delete( 'ln,rtrn' ) %] >- <label for="language-original-limit">Language of original: </label> >+ </p> >+ <p> >+ <label for="language-original-limit">Language of original</label> > [% PROCESS language_limit_select ln_loop=search_languages_loop ln_id='language-original-limit' ln_index='language-original' selected = limits.${'language-original,rtrn'}.0 %] > [% limits.delete( 'language-original,rtrn' ) %] > </p> > <!-- /LANGUAGE LIMIT --> >+ <!-- /#language --> > </fieldset> >- <!-- /#language --> >- </fieldset> >+ </div> > <!-- /#basiclimits --> > <!-- /BASIC LIMITS --> >- [% END # /IF ( expanded_options ) %] > >- [% IF ( UNIMARC ) %] >- [% INCLUDE 'subtypes_unimarc.inc' %] >- [% ELSE %] >- [% PROCESS 'subtype_limits.inc' %] >- <!-- SUBTYPE LIMITS --> >- <fieldset id="subtype"> >- <legend>Subtype limits</legend><p> [% PROCESS subtype_dropdowns %] </p >- ><fieldset id="current_subtype_limits"> >- <legend>Current subtype limits</legend> >- [% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %] >- [% FOREACH limit IN limits.$subtype %] >- <span> >- <input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden" /> >- <label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label> >- <input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked" /> >- </span> >+ [% UNLESS ( UNIMARC ) %] >+ [% PROCESS 'subtype_limits.inc' %] >+ <!-- SUBTYPE LIMITS --> >+ <div> >+ <fieldset id="subtype"> >+ <legend>Subtype limits</legend> >+ <p> [% PROCESS subtype_dropdowns %] </p> >+ <fieldset id="current_subtype_limits"> >+ <legend>Current subtype limits</legend> >+ [% FOREACH subtype IN ['aud','fic','bio','ctype','l-format'] %] >+ [% FOREACH limit IN limits.$subtype %] >+ <span> >+ <input name="limit" value="[% subtype | html %]:[% limit | html %]" type="hidden" /> >+ <label for="subtype_limit_[% loop.index() | html %]">[%# PROCESS subtype_limits_description subtype_limit = subtype _':' _ limit #%]</label> >+ <input type="checkbox" class="toggle_limit" name="subtype_limit_[% loop.index() | html %]" checked="checked" /> >+ </span> >+ [% END %] >+ [% limits.delete( subtype ) %] >+ [% END # /FOREACH subtype %] >+ </fieldset> >+ <!-- #current_subtype_limits --> >+ </fieldset> >+ </div> >+ <!-- /#subtype --> >+ [% END # /IF ( UNIMARC ) %] >+ >+ <!-- AVAILABILITY LIMITS --> >+ <div> >+ <fieldset id="availability"> >+ <legend>Location and availability</legend> >+ <fieldset id="currently-avail"> >+ [% IF limit_available %] >+ <div class="search-limit-check"> >+ <input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /> >+ <label for="available-items"> Only items currently available </label> >+ </div> >+ [% ELSE %] >+ <div class="search-limit-check"> >+ <input type="checkbox" id="available-items" name="limit" value="available" /> >+ <label for="available-items"> Only items currently available </label> >+ </div> > [% END %] >- [% limits.delete( subtype ) %] >- [% END # /FOREACH subtype %] >+ </fieldset> >+ <!-- /#currently-avail --> >+ >+ <fieldset id="select-libs"> >+ <p> >+ <label for="branchloop">Individual libraries:</label> >+ <select name="limit" id="branchloop"> >+ <option value="">All libraries</option> >+ [%# FIXME Should not we filter the libraries displayed? %] >+ [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %] >+ [% limits.delete('branch') %] >+ </select> >+ <!-- /#branchloop --> >+ </p> >+ [% IF search_groups %] >+ <p>OR</p> >+ <p> >+ <label for="categoryloop">Groups of libraries</label> >+ <select name="limit" id="categoryloop"> >+ <option value=""> -- none -- </option> >+ [% FOREACH sg IN search_groups %] >+ [% UNLESS sg.branchcode %] >+ [% IF limits.multibranchlimit.0 == sg.id %] >+ <option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> >+ [% ELSE %] >+ <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> >+ [% END %] >+ [% END %] >+ [% END %] >+ [% limits.delete('multibranchlimit') %] >+ </select> >+ <!-- /#categoryloop --> >+ </p> >+ [% END # /search_groups %] >+ </fieldset> >+ <!-- /#select-libs --> > </fieldset> >- <!-- #current_subtype_limits --> >- </fieldset> >- <!-- /#subtype --> >- [% END # /IF ( UNIMARC ) %] >- >- <!-- AVAILABILITY LIMITS --> >- <fieldset id="availability"> >- <legend>Location and availability</legend> >- <fieldset id="currently-avail"> >- [% IF limit_available %] >- <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" checked="checked" /></p> >- [% ELSE %] >- <p><label for="available-items">Only items currently available:</label> <input type="checkbox" id="available-items" name="limit" value="available" /></p> >- [% END %] >- </fieldset> >- <!-- /#currently-avail --> >- >- <fieldset id="select-libs"> >- <p> >- <label for="branchloop">Individual libraries:</label> >- <select name="limit" id="branchloop"> >- <option value="">All libraries</option> >- [%# FIXME Should not we filter the libraries displayed? %] >- [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %] >- [% limits.delete('branch') %] >- </select> >- <!-- /#branchloop --> >- </p> >- [% IF search_groups %] >- <p>OR</p> >+ </div> >+ <!-- /#availability --> >+ <!-- /AVAILABILITY LIMITS --> >+ >+ <!-- OTHER LIMITS (facets, etc.) --> >+ [% IF limits.size %] >+ <fieldset id=""> >+ <legend>Other limits</legend> > <p> >- <label for="categoryloop">Groups of libraries: </label> >- <select name="limit" id="categoryloop"> >- <option value=""> -- none -- </option> >- [% FOREACH sg IN search_groups %] >- [% UNLESS sg.branchcode %] >- [% IF limits.multibranchlimit.0 == sg.id %] >- <option selected="selected" value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> >- [% ELSE %] >- <option value="multibranchlimit:[% sg.id | html %]">[% sg.title | html %]</option> >- [% END %] >- [% END %] >+ [% FOREACH key IN limits.keys %] >+ [% FOREACH limit IN limits.$key %] >+ <span> >+ <input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]" /> >+ <label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label> >+ <input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked" /> >+ </span> > [% END %] >- [% limits.delete('multibranchlimit') %] >+ [% END %] >+ </p> >+ </fieldset> >+ [% END # /IF limits.size %] >+ <!-- /OTHER LIMITS (facets, etc.) --> >+ >+ <!-- RANK LIMITS --> >+ <div> >+ <fieldset id="sortby"> >+ <legend>Sorting</legend> >+ <p> >+ <label for="sort_by">Sort by</label> >+ <select id="sort_by" name="sort_by"> >+ [% INCLUDE 'resort_form.inc' sort_by = sort || sort_by %] > </select> >- <!-- /#categoryloop --> > </p> >- [% END # /search_groups %] >- </fieldset> >- <!-- /#select-libs --> >- </fieldset> >- <!-- /#availability --> >- <!-- /AVAILABILITY LIMITS --> >- >- <!-- OTHER LIMITS (facets, etc.) --> >- [% IF limits.size %] >- <fieldset id=""> >- <legend>Other limits</legend> >- <p> >- [% FOREACH key IN limits.keys %] >- [% FOREACH limit IN limits.$key %] >- <span> >- <input type="hidden" name="limit" value="[% key | html %]:[% limit | html %]" /> >- <label for="other_[% key _ loop.index() | html %]">[% key | html %]:[% limit | html %]</label> >- <input type="checkbox" class="toggle_limit" name="other_[% key _ loop.index() | html %]" checked="checked" /> >- </span> >- [% END %] >- [% END %] >- </p> >- </fieldset> >- [% END # /IF limits.size %] >- <!-- /OTHER LIMITS (facets, etc.) --> >- >- <!-- RANK LIMITS --> >- <fieldset id="sortby"> >- <legend>Sorting</legend> >- <p> >- <label for="sort_by">Sort by: </label> >- <select id="sort_by" name="sort_by"> >- [% INCLUDE 'resort_form.inc' sort_by = sort || sort_by %] >- </select> >- </p> >- </fieldset> >- <!-- /#sortby --> >- <!-- /RANK LIMITS --> >+ </fieldset> >+ </div> >+ <!-- /#sortby --> >+ <!-- /RANK LIMITS --> >+ <!-- /.search-limits --> >+ [% IF ( UNIMARC ) %] >+ [% INCLUDE 'subtypes_unimarc.inc' %] >+ [% END %] >+ </div> > </div> > <!-- /#advanced-search --> > </form> >@@ -383,20 +565,35 @@ > [% Asset.css("css/humanmsg.css") | $raw %] > [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] > <script> >- /** >- * Function add_field(); >- * This function allows to display a new field to search. >- */ >- function add_field() { >- var ButtonPlus = document.getElementById("ButtonPlus"); >- var line = ButtonPlus.parentNode; >- var dad = line.parentNode; >- dad.appendChild(line.cloneNode(true)); >- line.removeChild(ButtonPlus); >- } >+ window.addEventListener('pageshow', function( e ){ >+ $('.form-control:visible').prop('disabled' , false ); >+ }); > > $(document).ready(function() { >- $("input[name=q]:eq(0)").focus(); >+ >+ /* This function allows to display a new field to search. >+ */ >+ $(document).on("click", '.ButtonPlus', function(e) { >+ e.preventDefault(); >+ $('.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(''); >+ thisLine.after(newLine); >+ }); >+ >+ $(document).on("click", '.ButtonLess', function(e) { >+ e.preventDefault(); >+ $(this).parent().parent().remove(); >+ if( $(".ButtonLess").length < 2 ) { >+ $('.ButtonLess').hide(); >+ } >+ $('.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(); >+ > if( $("#advsearches .tab-pane.active").length < 1 ){ > $("#advsearches a:first").tab("show"); > } >@@ -431,58 +628,65 @@ > browser.show_back_link(); > [% END %] > >- [% IF edit_filter %] >- $("#save_filter").click(function(e){ >- e.preventDefault(); >- let operators = []; >- let indexes = []; >- let operands = []; >- let limits =[]; >- let opac = $("#show_filter_opac").prop('checked'); >- let staff_client = $("#show_filter_staff_client").prop('checked'); >- $("select[name='op']").each(function(){ >- operators.push( $(this).val() ); >- }); >- $("select[name='idx']").each(function(){ >- indexes.push( $(this).val() ); >- }); >- $("input[name='q']").each(function(){ >- operands.push( $(this).val() ); >- }); >- $("select[name='limit'],input[name='limit']:checked").each(function(){ >- if( $(this).val() != ""){ >- limits.push( $(this).val() ); >- } >- }); >- let year_limit = $("#limit-yr").val(); >- if( year_limit ){ >- limits.push( "yr,st-numeric:"+year_limit ); >+ $(".limit-grid > *").on("click", function(e){ >+ const checkbox = $(this).find("input"); >+ if( checkbox.prop("checked") ){ >+ checkbox.prop("checked", false ); >+ } else { >+ checkbox.prop("checked", true ); > } >- let options = { >- url: '/api/v1/search_filters/'+ [% edit_filter.id | html %], >- method: "PUT", >- contentType: "application/json", >- data: JSON.stringify({ >- name: "[% edit_filter.name | html %]", >- query: JSON.stringify({ operands: operands, indexes: indexes, operators:operators }), >- limits: JSON.stringify({ limits: limits }), >- opac: opac, >- staff_client: staff_client, >- }) >- }; >- $.ajax(options) >- .then(function(result) { >- humanMsg.displayAlert( _("Saved filter: ") + result.name , { className: 'human Success' } ); >- }) >- .fail( function(err){ >- humanMsg.displayAlert( _("There was an error during saving:") + err.responseText, { className: 'humanError' } ); >+ }); >+ >+ [% IF edit_filter %] >+ $("#save_filter").click(function(e){ >+ e.preventDefault(); >+ let operators = []; >+ let indexes = []; >+ let operands = []; >+ let limits =[]; >+ let opac = $("#show_filter_opac").prop('checked'); >+ let staff_client = $("#show_filter_staff_client").prop('checked'); >+ $("select[name='op']").each(function(){ >+ operators.push( $(this).val() ); >+ }); >+ $("select[name='idx']").each(function(){ >+ indexes.push( $(this).val() ); >+ }); >+ $("input[name='q']").each(function(){ >+ operands.push( $(this).val() ); > }); >+ $("select[name='limit'],input[name='limit']:checked").each(function(){ >+ if( $(this).val() != ""){ >+ limits.push( $(this).val() ); >+ } >+ }); >+ let year_limit = $("#limit-yr").val(); >+ if( year_limit ){ >+ limits.push( "yr,st-numeric:"+year_limit ); >+ } >+ let options = { >+ url: '/api/v1/search_filters/'+ [% edit_filter.id | html %], >+ method: "PUT", >+ contentType: "application/json", >+ data: JSON.stringify({ >+ name: "[% edit_filter.name | html %]", >+ query: JSON.stringify({ operands: operands, indexes: indexes, operators:operators }), >+ limits: JSON.stringify({ limits: limits }), >+ opac: opac, >+ staff_client: staff_client, >+ }) >+ }; >+ $.ajax(options) >+ .then(function(result) { >+ humanMsg.displayAlert( _("Saved filter: ") + result.name , { className: 'human Success' } ); >+ }) >+ .fail( function(err){ >+ humanMsg.displayAlert( _("There was an error during saving:") + err.responseText, { className: 'humanError' } ); >+ }); > > >- }); >+ }); > [% END %] >- >- > }); > </script> > [% 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(); > }); > </script> > [% END %] >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39398
:
179556
|
179557
|
179558
|
179615
| 179833 |
180975