Koha/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc
Owen Leonard 086810633b
Bug 34135: Show the icons for selected tab to the left of the search bar in the staff interface
This patch modifies header search forms so that the form label has the
same icon used by the "tab" link.

The patch also improves the responsive behavior of the header search by
using the icon as the form label when the browser window is narrow
enough to hide the label text.

I've added the "aria-hidden" attribute to other icons in the modified
templates and made the "fa-fw" class consistent for all tab icons.

To test, apply the patch and rebuild the staff interface CSS. Clear your
browser cache if necessary.

View the header search form at various browser sizes to confirm that
content is shown and hidden correctly. Test at least one page which uses
each of the modified header search includes:

 - Staff client home page
 - Acquisitions -> Acquisitions home
   - Vendor ->
     - Basket -> Add to basket -> From suggestion
     - Contracts
 - Administration ->
   - Budgets
   - Currencies
   - Desks (with UseCirculationDesks enabled)
   - System preferences
   - Z39.50/SRU servers
 - Catalog advanced search
   - Search results
 - Authorities -> Authorities home
 - Cataloging -> Cataloging home
 - Circulation -> Check out
 - E-resource management (with ERMModule enabled)
 - Patrons -> Patrons home
 - Serials -> Serials home
 - Tools -> Notices

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-01 11:43:47 -03:00

79 lines
4 KiB
HTML

<!-- member-search-box.inc -->
[% USE Branches %]
[% USE Categories %]
[% USE Koha %]
[% PROCESS 'patronfields.inc' %]
[% IF CAN_user_borrowers_edit_borrowers %]
[%- SET searchtype = Koha.Preference('DefaultPatronSearchMethod') -%]
[% IF( bs_tab_active ) %]
<div id="patron_search" role="tabpanel" class="tab-pane active">
[% ELSE %]
<div id="patron_search" role="tabpanel" class="tab-pane">
[% END %]
<form method="post" action="/cgi-bin/koha/members/member.pl">
<input type="hidden" name="quicksearch" value="1" />
<div class="form-title">
<label class="control-label"><span class="control-text">Search patrons</span> <i class="fa fa-fw fa-id-card" aria-hidden="true"></i></label>
</div>
<div class="form-content">
[% IF ( Koha.Preference('RetainPatronsSearchTerms') ) %]
<input name="searchmember" id="searchmember" class="head-searchbox form-control" type="text" placeholder="Enter patron card number or partial name" size="25" value="[% searchmember | html %]"/>
[% ELSE %]
<input name="searchmember" id="searchmember" class="head-searchbox form-control" type="text" placeholder="Enter patron card number or partial name" size="25"/>
[% END %]
<button type="button" class="form-extra-content-toggle" title="More options"><i class="form-extra-content-icon fa-solid fa-sliders" aria-hidden="true"></i></button>
</div>
<button type="submit"><i class="fa fa-arrow-right"></i></button>
<div class="form-extra-content">
<div>
[% INCLUDE patron_fields_dropdown search_box=1 %]
</div>
<div>
<label for="searchtype" class="control-label">Search type</label>
<select name="searchtype" id="searchtype" class="form-control">
[% IF searchtype == 'starts_with' %]
<option value='starts_with' selected='selected'>Starts with</option>
<option value='contains'>Contains</option>
[% ELSE %]
<option value='starts_with'>Starts with</option>
<option value='contains' selected='selected'>Contains</option>
[% END %]
</select>
</div>
<div>
[% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
<label for="branchcode" class="control-label">Library</label>
<select name="branchcode_filter" id="branchcode" class="form-control">
[% IF branches.size != 1 %]
<option value="">Any</option>
[% END %]
[% PROCESS options_for_libraries libraries => branches %]
</select>
</div>
<div>
[% SET categories = Categories.all() %]
<label for="categorycode" class="control-label">Category</label>
<select name="categorycode_filter" id="categorycode" class="form-control">
<option value="">Any</option>
[% FOREACH category IN categories %]
[% IF category.categorycode == categorycode_filter %]
<option value="[% category.categorycode | html %]" selected="selected">[% category.description | html %]</option>
[% ELSE %]
<option value="[% category.categorycode | html %]">[% category.description | html %]</option>
[% END %]
[% END %]
</select>
</div>
</div>
</form>
</div>
[% END %]
<!-- /member-search-box.inc -->