Bugzilla – Attachment 173245 Details for
Bug 38227
Collapse authority popup search form when showing results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38227: Collapse authority popup search form when showing results
Bug-38227-Collapse-authority-popup-search-form-whe.patch (text/plain), 7.65 KB, created by
Phil Ringnalda
on 2024-10-24 02:25:08 UTC
(
hide
)
Description:
Bug 38227: Collapse authority popup search form when showing results
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-10-24 02:25:08 UTC
Size:
7.65 KB
patch
obsolete
>From 72d7261821387e6870150030fa49e93e17021704 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 22 Oct 2024 13:47:20 +0000 >Subject: [PATCH] Bug 38227: Collapse authority popup search form when showing > results > >This patch takes the collapsing-panel functionality of the patron entry >form and generalizes it so that it can be used on the authority search >popup window in cataloging. > >To test, apply the patch and rebuild the staff interface CSS. > >- Go to Cataloging -> New record (basic MARC editor) >- Switch to tab 1 and click the tag editor link next to tag 100 subfield > a. >- The search form should be expanded in the pop-up window. >- Perform a search. When the window reloads with search results the > search form should be collapsed. >- Confirm that clicking the "Search options" legend works correctly to > expand and collapse the form. >- Collapse the form and click the "Clear form" button. The form should > expand -- This is based on the assumption that the "Clear form" button > would be used when the user wants to initiate a new search. >- Go to Patrons -> New patron and confirm that collapsible sections > still work correctly. > >Sponsored-by: Athens County Public Libraries >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > .../prog/css/src/staff-global.scss | 29 ++++++++++++++ > .../prog/en/includes/auth-finder-search.inc | 6 ++- > .../prog/en/modules/members/memberentrygen.tt | 39 ------------------- > .../prog/js/auth-finder-search.js | 8 ++++ > .../intranet-tmpl/prog/js/staff-global.js | 16 ++++++++ > 5 files changed, 57 insertions(+), 41 deletions(-) > >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 6b6c5e7f0c..f8f015e1de 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -1208,6 +1208,35 @@ fieldset { > } > } > >+legend { >+ &.collapsed, >+ &.expanded { >+ border: 1px solid #FFF; >+ margin-left: -.7em; >+ margin-top: -.7em; >+ padding: .7em; >+ >+ &:hover { >+ border: 1px solid #6FAF44; >+ cursor: pointer; >+ } >+ >+ i { >+ color: #4C7AA8; >+ font-size: 80%; >+ padding-right: .2rem; >+ } >+ } >+ >+ &.collapsed { >+ margin-bottom: -.5em; >+ >+ i.fa.fa-caret-down::before { >+ content: "\f0da"; >+ } >+ } >+} >+ > details { > > summary { > cursor: pointer; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc >index f9ff82c907..7545e668b7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc >@@ -10,8 +10,10 @@ > <input type="hidden" name="op" value="do_search" /> > <input type="hidden" name="type" value="intranet" /> > <input type="hidden" name="index" value="[% index | html %]" /> >- <fieldset class="rows"><legend>Search options</legend> >- <ol><li> >+ <fieldset class="rows"> >+ <legend class="collapsed"><i class="fa fa-caret-down" title="Collapse this section"></i> Search options</legend> >+ <ol style="display:none"> >+ <li> > <span class="label">Authority type: </span> > [% authtypecode | html %] > <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 2ea5d5957f..06bb12835d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -26,32 +26,6 @@ > [% t("Koha") | html %] > [% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >-<style>[% FILTER collapse %] >-fieldset legend { >- border: 1px solid #FFF; >- margin-left: -.5em; >- margin-top: -.5em; >- padding: .7em; >-} >-fieldset legend:hover { >- border: 1px solid #6FAF44; >- cursor: pointer; >-} >- >-fieldset legend i { >- color: #4C7AA8; >- font-size: 80%; >- padding-right: .2rem; >-} >- >-fieldset legend.collapsed { >- margin-bottom: -.5em; >-} >- >-legend.collapsed i.fa.fa-caret-down::before { >- content: "\f0da"; >-} >-[% END %]</style> > </head> > > <body id="pat_memberentrygen" class="pat"> >@@ -1856,18 +1830,6 @@ legend.collapsed i.fa.fa-caret-down::before { > [% END %] > } > >- function togglePanel( node ){ >- var panel = node.nextAll(); >- if(panel.is(":visible")){ >- node.addClass("collapsed").removeClass("expanded").attr("title", _("Click to expand this section") ); >- panel.hide(); >- } else { >- node.addClass("expanded").removeClass("collapsed").attr("title", _("Click to collapse this section") ); >- panel.show(); >- panel.find("input, select, textarea").eq(0).focus(); >- } >- } >- > $(document).ready(function() { > showHideFields(); > $("#toggle_hidden_fields").change(function(){ >@@ -1875,7 +1837,6 @@ legend.collapsed i.fa.fa-caret-down::before { > }); > > $(".collapsed,.expanded").on("click",function(){ >- togglePanel( $(this) ); > $("#messaging_prefs_loading").hide(); > $("#guarantor_template").hide(); > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js b/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js >index 5bdf7db81a..d570527204 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js >@@ -134,6 +134,10 @@ $(document).ready(function(){ > minLength: 3, > }); > $("#clear-form").click(function(){ >+ let legend = $("legend"); >+ if( legend.hasClass("collapsed") ){ >+ legend.click(); >+ }; > setTimeout(function(){ > $(":input[type='text']").val(''); > $("#mainmainentry").val("contains"); >@@ -144,6 +148,10 @@ $(document).ready(function(){ > }, 50); > return true; > }); >+ >+ if( $("#resultlist").length === 0 ){ >+ $("legend").click(); >+ } > }); > > function finderjump(page, full){ >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index 73a4a0251e..f0cda8aecc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -59,6 +59,18 @@ $.fn.selectTabByID = function (tabID) { > $("a[href='" + tabID + "']", $(this)).tab("show"); > }; > >+function togglePanel( node ){ >+ var panel = node.nextAll(); >+ if(panel.is(":visible")){ >+ node.addClass("collapsed").removeClass("expanded").attr("title", __("Click to expand this section") ); >+ panel.hide(); >+ } else { >+ node.addClass("expanded").removeClass("collapsed").attr("title", __("Click to collapse this section") ); >+ panel.show(); >+ panel.find("input, select, textarea").eq(0).focus(); >+ } >+} >+ > $(document).ready(function () { > //check if sticky element is stuck, if so add floating class > if ( $('.sticky').length ) { >@@ -392,6 +404,10 @@ $(document).ready(function () { > $('[data-bs-toggle="tooltip"]').tooltip(); > } > >+ $(".collapsed,.expanded").on("click",function(e){ >+ e.preventDefault(); >+ togglePanel( $(this) ); >+ }); > }); > > function removeLastBorrower() { >-- >2.44.0
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 38227
:
173162
| 173245