{{!
    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_trema/navbar

    Page navbar.

    Context variables required for this template:
    * config.wwwroot: The wwwroot of the site.
    * sitename: The name of the site.
    * output.should_display_navbar_logo: Whether the navbar logo should be displayed.
    * output.get_compact_logo_url: The URL of the compact logo.
    * output.search_box: The search box.
    * output.navbar_plugin_output: The navbar plugin output.
    * output.edit_switch: The edit switch.
    * output.page_heading_menu: The page heading menu.
    * output.render_lang_menu: The lang menu.
    * primarymoremenu: The primary more menu.
    * langmenu: The lang menu.
    * usermenu: The user menu.

    Example context (json):
    {
        "config.wwwroot": "https://example.com",
        "sitename": "Moodle",
        "output.should_display_navbar_logo": true,
        "output.get_compact_logo_url": "https://example.com/theme/image.php/boost/theme/1610130847/logo",
        "output.search_box": "<form class=\"form-inline my-2 my-lg-0\" action=\"https://example.com/course/search.php\" method=\"get\"><input class=\"form-control mr-sm-2\" type=\"search\" name=\"search\" placeholder=\"Search courses\" aria-label=\"Search\"><button class=\"btn btn-outline-success my-2 my-sm-0\" type=\"submit\">Search</button></form>",
        "output.navbar_plugin_output": "<div class=\"navbar-plugin-output\"></div>",
        "output.edit_switch": "<div class=\"edit-switch\">...</div>",
        "output.page_heading_menu": "<li class=\"nav-item\"><a class=\"nav-link\" href=\"https://example.com\">Home</a></li>",
        "output.render_lang_menu": "<a class=\"dropdown-item\" href=\"/?lang=en\">English</a>",
        "primarymoremenu": true,
        "langmenu": true,
        "usermenu": true
    }
}}
<nav class="navbar fixed-top navbar-light bg-white navbar-expand" aria-label="{{#str}}sitemenubar, admin{{/str}}">

    <button class="navbar-toggler aabtn d-block d-md-none my-1 mr-2" data-toggler="drawers" data-action="toggle" data-target="theme_boost-drawers-primary">
        <span class="navbar-toggler-icon"></span>
        <span class="sr-only">{{#str}}sidepanel, core{{/str}}</span>
    </button>

    <a href="{{{ config.wwwroot }}}" class="navbar-brand d-flex align-items-center p-0 mr-4 aabtn">
        {{# output.should_display_navbar_logo }}
            <img src="{{output.get_compact_logo_url}}" class="logo mr-1" alt="{{sitename}}">
        {{/ output.should_display_navbar_logo }}
        {{^ output.should_display_navbar_logo }}
            {{{ sitename }}}
        {{/ output.should_display_navbar_logo }}
    </a>
    {{#primarymoremenu}}
        <div class="primary-navigation">
            {{> core/moremenu}}
        </div>
    {{/primarymoremenu}}

    <ul class="navbar-nav trema-custom-menu d-none d-md-flex">
        <!-- page_heading_menu -->
        {{{ output.page_heading_menu }}}
    </ul>
    <div id="usernavigation" class="navbar-nav ml-auto">
        {{# output.search_box }}
            {{{ output.search_box }}}
            <div class="divider border-left h-75 align-self-center mx-1"></div>
        {{/output.search_box}}
        {{#langmenu}}
            {{{ output.render_lang_menu }}}
            <div class="divider border-left h-75 align-self-center mx-1"></div>
        {{/langmenu}}
        {{{ output.navbar_plugin_output }}}
        <div class="d-flex align-items-stretch usermenu-container" data-region="usermenu">
            {{#usermenu}}
                {{> core/user_menu }}
            {{/usermenu}}
        </div>
        {{{ output.edit_switch }}}
    </div>
</nav>

{{> theme_boost/primary-drawer-mobile }}
