{{!
    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_foundation/partials/navbar-secure

    Secure navbar.

    Context variables required for this template:
    * sitename - The name of the site.
    * output - The core renderer for the page.
    * config - The config instance.
    * hasdrawerblocks - true if there are drawer blocks on this page.
    * drawerclosed - true if the drawer is closed on this page.
    * navbarposition - Position of the navbar on the page.
    * fav - true if using Font Awesome 5.

    Example context (json):
    {
        "output": {
            "should_display_navbar_logo": "true",
            "get_compact_logo_url": "http://example.com/image.png"
        },
        "sitename": "Moodle Site",
        "config": "",
        "hasdrawerblocks": true,
        "drawerclosed": true,
        "navbarposition": "top",
        "fav": true
    }
}}
<nav class="fixed-{{navbarposition}} navbar navbar-dark bg-primary navbar-expand-md moodle-has-zindex" aria-label="{{#str}}sitemenubar, admin{{/str}}">
    {{#hasdrawerblocks}}
    <div class="navbar-nav">
        <button id="drawer" class="btn btn-link nav-link" type="button">
            <span id="drawerclose" class="{{^fav}}fa fa-hand-o-left{{/fav}}{{#fav}}far fa-hand-point-left{{/fav}}{{#drawerclosed}} d-none{{/drawerclosed}}" aria-hidden="{{#drawerclosed}}true{{/drawerclosed}}{{^drawerclosed}}false{{/drawerclosed}}" aria-label="{{#str}}closedrawer, theme_foundation{{/str}}"></span>
            <span id="draweropen" class="{{^fav}}fa fa-hand-o-right{{/fav}}{{#fav}}far fa-hand-point-right{{/fav}}{{^drawerclosed}} d-none{{/drawerclosed}}" aria-hidden="{{^drawerclosed}}true{{/drawerclosed}}{{#drawerclosed}}false{{/drawerclosed}}" aria-label="{{#str}}opendrawer, theme_foundation{{/str}}"></span>
        </button>
    </div>
    {{/hasdrawerblocks}}

    {{# output.should_display_navbar_logo }}
        <span class="logo d-none d-sm-inline">
            <img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
        </span>
    {{/ output.should_display_navbar_logo }}
    <span class="site-name d-none d-md-inline">{{{ sitename }}}</span>

    <ul class="nav navbar-nav ml-auto">
        <!-- Anti-gravity -->
        <li class="nav-item">
            <div class="d-flex navbarantigravity{{#fav}} fav{{/fav}}">
                <div class="bttc antigravity">
                    <div class="btts nav-link" title="{{#str}}backtotop, theme_foundation{{/str}}"><span aria-hidden="true" class="{{^fav}}fa fa-arrow-circle-o-up{{/fav}}{{#fav}}far fa-arrow-alt-circle-up{{/fav}}"></span></div>
                    <div class="backtotop nav-link" title="{{#str}}backtotop, theme_foundation{{/str}}"><span aria-hidden="true" class="{{^fav}}fa fa-arrow-circle-o-up{{/fav}}{{#fav}}far fa-arrow-alt-circle-up{{/fav}}"></span></div>
                </div>
                <div class="gtbc antigravity">
                    <div class="gtbs nav-link" title="{{#str}}gotobottom, theme_foundation{{/str}}"><span aria-hidden="true" class="{{^fav}}fa fa-arrow-circle-o-down{{/fav}}{{#fav}}far fa-arrow-alt-circle-down{{/fav}}"></span></div>
                    <div class="gotobottom nav-link" title="{{#str}}gotobottom, theme_foundation{{/str}}"><span aria-hidden="true" class="{{^fav}}fa fa-arrow-circle-o-down{{/fav}}{{#fav}}far fa-arrow-alt-circle-down{{/fav}}"></span></div>
                </div>
            </div>
        </li>
        {{# output.secure_layout_language_menu }}
        <ul class="navbar-nav d-none d-md-flex">
            <!-- language_menu -->
            {{{ . }}}
        </ul>
        {{/ output.secure_layout_language_menu }}
        {{# output.secure_layout_login_info }}
        <div class="ml-auto">
            {{{ . }}}
        </div>
        {{/ output.secure_layout_login_info }}
    </ul>
</nav>
{{#js}}
require(['theme_foundation/anti_gravity']);
{{/js}}
