{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template core_reportbuilder/local/filters/area

    Template for system report filters area

    Example context (json):
    {
        "id": 3,
        "contextid": 1,
        "filtersapplied": 3,
        "filtersform": "form"
    }
}}

{{! Filters button }}
<button class="btn btn-sm btn-secondary ml-2" type="button" id="dropdownFiltersButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{#str}} filters, moodle {{/str}}">
    <svg width="20" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M4.75 7C4.33579 7 4 7.33579 4 7.75C4 8.16421 4.33579 8.5 4.75 8.5V7ZM19.25 8.5C19.6642 8.5 20 8.16421 20 7.75C20 7.33579 19.6642 7 19.25 7V8.5ZM4.75 8.5H19.25V7H4.75V8.5Z" fill="currentColor"></path>
        <path d="M6.75 11C6.33579 11 6 11.3358 6 11.75C6 12.1642 6.33579 12.5 6.75 12.5V11ZM17.25 12.5C17.6642 12.5 18 12.1642 18 11.75C18 11.3358 17.6642 11 17.25 11V12.5ZM6.75 12.5H17.25V11H6.75V12.5Z" fill="currentColor"></path>
        <path d="M8.75 15C8.33579 15 8 15.3358 8 15.75C8 16.1642 8.33579 16.5 8.75 16.5V15ZM15.25 16.5C15.6642 16.5 16 16.1642 16 15.75C16 15.3358 15.6642 15 15.25 15V16.5ZM8.75 16.5H15.25V15H8.75V16.5Z" fill="currentColor"></path>
    </svg>
    <span data-region="filter-button-label" class="ml-2">
        {{#filtersapplied}} {{#str}} filtersappliedx, core_reportbuilder, {{filtersapplied}} {{/str}} {{/filtersapplied}}
        {{^filtersapplied}} {{#str}} filters, moodle {{/str}} {{/filtersapplied}}
    </span>
</button>
{{! Filters content }}
<div class="filters-dropdown dropdown-menu dropdown-menu-right moodle-has-zindex" aria-labelledby="dropdownFiltersButton">
    <div id="filters" class="reportbuilder-filters-sidebar" data-region="report-filters">
        <div class="p-3">
            {{#filtersform}}
                <div class="reportbuilder-filters-wrapper" data-region="filters-form">
                    {{{filtersform}}}
                </div>
            {{/filtersform}}
        </div>
    </div>
</div>

{{#js}}
    require(['core_reportbuilder/filters'], function(filters) {
        filters.init({{id}}, {{contextid}});
    });
{{/js}}
