{{!
    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/primary-drawer-mobile

    This template renders the mobile version of the top navbar menu in a drawer.

    Example context (json):
    {
        "output": {
            "should_display_navbar_logo": true,
            "get_compact_logo_url": "http://placekitten.com/50/50"
        },
        "mobileprimarynav": [
            {
                "text": "Dashboard",
                "url": "/my",
                "isactive": "true"
            },
            {
                "text": "Site home",
                "url": "/",
                "isactive": "false"
            },
            {
                "text": "My courses",
                "url": "/course",
                "isactive": "false"
            }
        ]
    }
}}
{{!
    This template is a modified version of theme_boost/primary-drawer-mobile

    Modifications compared to the original template:
    * Add bottom bar.
    * Extend the mobile primary navigation.
    * Move child node markup into its own template.
}}
{{< theme_boost/drawer }}
    {{$id}}theme_boost-drawers-primary{{/id}}
    {{$drawerclasses}}drawer {{#bottombar.drawer}} drawer-bottom {{/bottombar.drawer}} {{^bottombar.drawer}} drawer-left {{/bottombar.drawer}} drawer-primary{{/drawerclasses}}
    {{$drawercloseonresize}}1{{/drawercloseonresize}}
    {{$drawerheading}}
        <a
            href="{{#alternativelogolinkurl}}{{{alternativelogolinkurl}}}{{/alternativelogolinkurl}}{{^alternativelogolinkurl}}{{{ config.homeurl }}}{{/alternativelogolinkurl}}"
            title="{{{ sitename }}}"
            data-region="site-home-link"
            class="aabtn text-reset d-flex align-items-center py-1 h-100"
        >
            {{# output.should_display_navbar_logo }}
                <img src="{{output.get_compact_logo_url}}" class="logo py-1 h-100" alt="{{sitename}}">
            {{/ output.should_display_navbar_logo }}
            {{^ output.should_display_navbar_logo }}
                <span class="sitename" title="{{{ sitename }}}">{{{ sitename }}}</span>
            {{/ output.should_display_navbar_logo }}
        </a>
    {{/drawerheading}}
    {{$drawercontent}}
        {{#bottombar.drawer}}
        <div class="menu-title">{{#str}} menu, core {{/str}}</div>
        {{/bottombar.drawer}}
        <div class="list-group">
            {{#mobileprimarynav}}
                {{#haschildren}}
                    {{> theme_boost_union/primary-drawer-mobile-child }}
                {{/haschildren}}
                {{^haschildren}}
                <a href="{{{url}}}" {{#tooltip}}title="{{.}}" data-toggle="tooltip"{{/tooltip}} class="{{#menuclasses}} {{.}} {{/menuclasses}} list-group-item list-group-item-action {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" {{#isactive}}aria-current="true"{{/isactive}} {{#attributes}}{{#name}}{{name}}="{{value}}"{{/name}} {{/attributes}}>
                    {{{text}}}
                </a>
                {{/haschildren}}
            {{/mobileprimarynav}}
        </div>
    {{/drawercontent}}
    {{$drawerstate}}show-drawer-primary{{/drawerstate}}
{{/ theme_boost/drawer}}
