{{!
    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 theme_boost_union/popover-favourites

    Boost Union popover for starred courses template.

    Example context (json):
    {
        "favourites": [
            {
                "url": "/course/view.php?id=42",
                "fullname": "My nice little course",
                "visible": true
            }
        ],
        "cogiconlinktargeturl": "/my/courses.php",
        "cogiconlinktargettitle": "mycourses"
    }
}}

{{< core/popover_region }}
    {{$classes}}popover-region-favourites{{/classes}}
    {{$attributes}}id="nav-popover-favourites-container" {{/attributes}}

    {{$togglelabel}}{{#str}} shownavbarstarredcourses_label, theme_boost_union {{/str}}{{/togglelabel}}
    {{$togglecontent}}
        {{#pix}} i/star, core, {{#str}} shownavbarstarredcourses_label, theme_boost_union {{/str}} {{/pix}}
    {{/togglecontent}}

    {{$containerlabel}}{{#str}} shownavbarstarredcourses_label, theme_boost_union {{/str}}{{/containerlabel}}

    {{$headertext}}{{#str}} shownavbarstarredcourses_label, theme_boost_union {{/str}}{{/headertext}}
    {{$headeractions}}
        <a href="{{cogiconlinktargeturl}}"
           title="{{cogiconlinktargettitle}}"
           aria-label="{{cogiconlinktargettitle}}">
            {{#pix}} i/settings, core {{/pix}}</a>
    {{/headeractions}}

    {{$content}}
        {{#favourites}}
            <a class="dropdown-item {{^visible}}dimmed{{/visible}}" href="{{{url}}}" title="{{{fullname}}}">{{{fullname}}}</a>
        {{/favourites}}
    {{/content}}
{{/ core/popover_region }}
{{#js}}
require(['jquery', 'core/popover_region_controller'], function($, Controller) {
    var container = $('#nav-popover-favourites-container');
    var controller = new Controller(container);
    controller.registerListNavigationEventListeners();
});
{{/js}}
