5966aabb5f7b2c7030d270c3fc5cca9418021601
[moodle.git] / theme / classic / templates / navbar.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
4     Moodle is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
9     Moodle is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
14     You should have received a copy of the GNU General Public License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16 }}
17 {{!
18     @template theme_classic/navbar
20     This template renders the top navbar.
22     Example context (json):
23     {
24         "output": {
25             "should_display_navbar_logo": true,
26             "get_compact_logo_url": "http://example.com/image.png",
27             "custom_menu": "<li>..</li>",
28             "page_heading_menu": "<li>..</li>",
29             "search_box": "<div><input type='text'></div>",
30             "navbar_plugin_output": "<div class='dropdown'>Messaging</div>",
31             "user_menu": "<div class='dropdown'>John Doe</div>"
32         },
33         "config": {
34             "wwwroot": "#"
35         },
36         "sitename": "Moodle Site"
37     }
38 }}
39 <nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
41         <a href="{{{ config.wwwroot }}}" class="navbar-brand aalink {{# output.should_display_navbar_logo }}has-logo{{/ output.should_display_navbar_logo }}
42             {{^ output.should_display_navbar_logo }}
43                 d-none d-sm-inline
44             {{/ output.should_display_navbar_logo }}
45                 ">
46             {{# output.should_display_navbar_logo }}
47                 <span class="logo d-none d-sm-inline">
48                     <img src="{{output.get_compact_logo_url}}" alt="{{sitename}}">
49                 </span>
50             {{/ output.should_display_navbar_logo }}
51             <span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
52         </a>
54         <ul class="navbar-nav d-none d-md-flex">
55             <!-- custom_menu -->
56             {{{ output.custom_menu }}}
57             <!-- page_heading_menu -->
58             {{{ output.page_heading_menu }}}
59         </ul>
60         <ul class="nav navbar-nav ml-auto">
61             <li class="d-none d-lg-block">
62                 {{{ output.search_box }}}
63             </li>
64             <!-- navbar_plugin_output -->
65             <li class="nav-item">
66                 {{{ output.navbar_plugin_output }}}
67             </li>
68             <!-- user_menu -->
69             <li class="nav-item d-flex align-items-center">
70                 {{{ output.user_menu }}}
71             </li>
72         </ul>
73         <!-- search_box -->
74 </nav>