{{!
    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.

    Edwiser Reports Pro
    @package   local_edwiserreports
    @copyright (c) 2022 WisdmLabs (https://wisdmlabs.com/)
    @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

}}
{{!
    @template local_edwiserreports/navigation

    Display the navigation for reports pages.

    Context variables required for this template:

    Example context (json):
    {
    }
}}
<ul class="edwiserreports-tabs mt-4 px-1">
    {{#navigation}}
        {{#visible}}
            {{#link}}
                <li class="tab-item{{#active}} active{{/active}}">
                    <a class="tab-link" data-id="{{id}}" href="{{link}}">{{label}}</a>
                </li>
            {{/link}}
            {{^link}}
                <li class="tab-item dropdown{{#active}} active{{/active}}">
                    <a class="tab-link dropdown-toggle" data-id="{{id}}" data-bs-toggle="dropdown" href="javascript:void(0)" role="button" aria-expanded="false">{{label}}</a>
                    
                    <ul class="dropdown-menu {{class}}">
                        {{#nodes}}
                            {{#visible}}
                                <li><a class="dropdown-item"  data-id="{{id}}" href="{{link}}">{{label}}</a></li>
                            {{/visible}}
                        {{/nodes}}
                    </ul>
                </li>
            {{/link}}
        {{/visible}}
    {{/navigation}}
</ul>
{{#js}}
require(['jquery', 'local_edwiserreports/common'], function($, common) {
    $(document).ready(function() {
        // Handling header tab dropdown.
        common.headerNavigation();
    });
});
{{/js}}
