[Bug 34707] New: Abstract intranet-tmpl/includes/*-search.inc
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34707 Bug ID: 34707 Summary: Abstract intranet-tmpl/includes/*-search.inc Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: In Discussion Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: pedro.amorim@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart+koha@gmail.com, katrin.fischer@bsz-bw.de, m.de.rooy@rijksmuseum.nl, martin.renvoize@ptfs-europe.com, nick@bywatersolutions.com, oleonard@myacpl.org, tomascohen@gmail.com After looking at bug 34624, I thought we could abstract (thus reducing) a lot of code and, making it more maintainable. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34707 --- Comment #1 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 155202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155202&action=edit Bug 34707: New common/header-search-tabs.inc Proof of concept of new abstract header-search-tabs.inc to be called everywhere its needed -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34707 --- Comment #2 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 155203 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=155203&action=edit Bug 34707: Apply *-search.inc abstraction to cities PROOF OF CONCEPT I've applied this idea to cities to start discussion around this. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34707 --- Comment #3 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- I believe we can abstract this even further but, for now, test plan is to apply patches and play around cities. Check that the top search bar works as before, etc. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34707 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I am not sure, that's a lot of different variables to define. Also some inc files are included from different places, you are going to duplicate this new big block. Another approach (to test!) would be to define all the 'tabs' in a single include, then pass the idea from the tt? include would contain all those blocks (here is one): + { + id => 'city_search', + is_active => 1, + is_allowed => 1, + label => 'Search cities', #TODO:translate + icon => 'fa-building', + form_action => undef, + form_id => undef, + form_method => 'POST', + inputs => [ + { + id => 'city_name_filter', + name => 'city_name_filter', + type => 'text', + value => city_name_filter, + placeholder => 'City search', + class => 'head-searchbox form-control', + } + ] + }, and tt would simply include: [% INCLUDE header-search-tabs.inc tabs => ['city-search', 'circ_search', 'catalog_search'] %] -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34707 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #4)
I am not sure, that's a lot of different variables to define. Also some inc files are included from different places, you are going to duplicate this new big block.
Another approach (to test!) would be to define all the 'tabs' in a single include, then pass the idea from the tt?
include would contain all those blocks (here is one): + { + id => 'city_search', + is_active => 1, + is_allowed => 1, + label => 'Search cities', #TODO:translate + icon => 'fa-building', + form_action => undef, + form_id => undef, + form_method => 'POST', + inputs => [ + { + id => 'city_name_filter', + name => 'city_name_filter', + type => 'text', + value => city_name_filter, + placeholder => 'City search', + class => 'head-searchbox form-control', + } + ] + },
and tt would simply include: [% INCLUDE header-search-tabs.inc tabs => ['city-search', 'circ_search', 'catalog_search'] %]
s/idea/ids -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org