View | Details | Raw Unified | Return to bug 37830
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +31 lines)
Lines 530-535 Link Here
530
                        [% END # / IF serialcollection %]
530
                        [% END # / IF serialcollection %]
531
531
532
                        [% WRAPPER tab_panel tabname="holdings" %]
532
                        [% WRAPPER tab_panel tabname="holdings" %]
533
                            <input style="margin-bottom:10px; "type="text" placeholder="Filter holdings" id="holdings_search_input">
533
                            [% IF too_many_items %]
534
                            [% IF too_many_items %]
534
                                <p>This record has many physical items ([% items_count | html %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;viewallitems=1">View all the physical items.</a></p>
535
                                <p>This record has many physical items ([% items_count | html %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;viewallitems=1">View all the physical items.</a></p>
535
                            [% ELSIF ( itemloop.size ) %]
536
                            [% ELSIF ( itemloop.size ) %]
Lines 2047-2052 Link Here
2047
                $("#libraryInfoModalLabel, #libraryInfo").html("");
2048
                $("#libraryInfoModalLabel, #libraryInfo").html("");
2048
                $("#libraryInfoLink").attr("href", "");
2049
                $("#libraryInfoLink").attr("href", "");
2049
            });
2050
            });
2051
2052
            // Filter holdings rows:
2053
            const elsTr = $("#holdingst tbody tr");
2054
            const elSearch = $("#holdings_search_input");
2055
            const regEsc = (v) => v.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
2056
2057
            const filterRows = (evt) => {
2058
                const val = evt.currentTarget.value.trim(); // Trim from whitespaces
2059
                const reg = new RegExp(regEsc(val), "i"); // "i" = case insensitive
2060
2061
                $('#holdings_noresultsfound').remove();
2062
2063
                $.each(elsTr, function(index, elTr) {
2064
                    if(!reg.test(elTr.textContent)){
2065
                        $(elTr).addClass('d-none');
2066
                    }else{
2067
                        $(elTr).removeClass('d-none');
2068
                    }
2069
                });
2070
2071
                if (val) {
2072
                    const visibleCount = $(elsTr).filter(':visible').length;
2073
                    const totalCount = $(elsTr).length;
2074
                    $(elSearch).after(`<span class="m-1" id="holdings_noresultsfound">Showing ${visibleCount} out of ${totalCount} holdings</span>`);
2075
                }
2076
            };
2077
2078
            $(elSearch).on('input',function(e){
2079
                filterRows(e);
2080
            });
2050
        });
2081
        });
2051
2082
2052
        function showBsTab( container, panelid ){
2083
        function showBsTab( container, panelid ){
2053
- 

Return to bug 37830