Bug 24758

Summary: Allow folding sections in patron edition form
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Screenshot

Description Fridolin Somers 2020-02-28 11:59:42 UTC
Patron edition form is big and contains several sections : Patron identity, Main address ...
Some of them are often unused so user may want to fold/unfold it to ease edition.
Comment 1 Fridolin Somers 2020-02-28 12:01:36 UTC
Created attachment 99755 [details]
Screenshot

I've managed to add this behavior with JS customisation.

===

$(document).ready(function() {
  if ($('#pat_memberentrygen').size()) {
    // Prepare
    $("fieldset").children("legend")
    .addClass("bl-autorepli")
    .append(' <i class="fa fa-caret-down"><i class="fa fa-caret-right" style="display:none">');
    // Onclick
    $("fieldset legend.bl-autorepli").on("click", function() {
      $(this).siblings("ol,table").toggle();
      $(this).children("i.fa").toggle();
    });
    // Hide by default
    $("fieldset#memberentry_address, fieldset#memberentry_altaddress").children("legend.bl-autorepli").click();
  }
});

===

Needs rework.

Feel free to propose a patch.
Comment 2 Owen Leonard 2020-02-28 12:45:19 UTC
I wonder if this should be considered a duplicate of Bug 3137?
Comment 3 Fridolin Somers 2020-03-11 12:35:18 UTC
Indeed looks a lot like it, thanks a lot Owen

*** This bug has been marked as a duplicate of bug 3137 ***