Bugzilla – Attachment 178331 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.83 KB, created by
Owen Leonard
on 2025-02-19 13:04:21 UTC
(
hide
)
Description:
Bug 38227: Collapse authority popup search form when showing results
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-02-19 13:04:21 UTC
Size:
7.83 KB
patch
obsolete
>From 5a77ba211ec85205d5bcafbc4bdb6603525a2bfe 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> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/css/src/staff-global.scss | 29 +++++++++++++ > .../prog/en/includes/auth-finder-search.inc | 8 ++-- > .../prog/en/modules/members/memberentrygen.tt | 41 ------------------- > .../prog/js/auth-finder-search.js | 8 ++++ > .../intranet-tmpl/prog/js/staff-global.js | 21 ++++++++++ > 5 files changed, 62 insertions(+), 45 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 7cf5f1237d..c7132b4052 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -1201,6 +1201,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 c2f2409d40..0c5965a250 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 >@@ -12,10 +12,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 a4f415881b..e3bb0442e1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -27,34 +27,6 @@ > [% END %]</title > > > [% INCLUDE 'doc-head-close.inc' %] >-[% FILTER collapse %] >- <style> >- fieldset legend { >- border: 1px solid #fff; >- margin-left: -0.5em; >- margin-top: -0.5em; >- padding: 0.7em; >- } >- fieldset legend:hover { >- border: 1px solid #6faf44; >- cursor: pointer; >- } >- >- fieldset legend i { >- color: #4c7aa8; >- font-size: 80%; >- padding-right: 0.2rem; >- } >- >- fieldset legend.collapsed { >- margin-bottom: -0.5em; >- } >- >- legend.collapsed i.fa.fa-caret-down::before { >- content: "\f0da"; >- } >- </style> >-[% END %] > </head> > > <body id="pat_memberentrygen" class="pat"> >@@ -1771,18 +1743,6 @@ > [% 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(){ >@@ -1790,7 +1750,6 @@ > }); > > $(".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 bb84b525e6..dfd81947c8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/auth-finder-search.js >@@ -145,6 +145,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"); >@@ -155,6 +159,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 105447539c..7117010aac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -59,6 +59,22 @@ $.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) { >@@ -438,6 +454,11 @@ $(document).ready(function () { > $(".output.next").prepend(__("Next")); > $(".output.last").prepend(__("Last")); > } >+ >+ $(".collapsed,.expanded").on("click", function (e) { >+ e.preventDefault(); >+ togglePanel($(this)); >+ }); > }); > > function removeLastBorrower() { >-- >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 38227
:
173162
|
173245
|
176660
| 178331