MDL-69454 core_search: consistent navbar search
[moodle.git] / theme / classic / templates / navbar.mustache
CommitLineData
de213bf0
BB
1{{!
2 This file is part of Moodle - http://moodle.org/
3
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.
8
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.
13
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
19
20 This template renders the top navbar.
21
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">
40
91de0ed8 41 <a href="{{{ config.wwwroot }}}" class="navbar-brand aalink {{# output.should_display_navbar_logo }}has-logo{{/ output.should_display_navbar_logo }}
de213bf0
BB
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>
53
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>
1fdb4fda
BB
60 <div class="ml-auto">
61 {{{ output.search_box }}}
62 </div>
63 <ul class="nav navbar-nav usernav">
de213bf0
BB
64 <!-- navbar_plugin_output -->
65 <li class="nav-item">
37856e46 66 {{{ output.navbar_plugin_output }}}
de213bf0
BB
67 </li>
68 <!-- user_menu -->
1fdb4fda 69 <li class="nav-item align-items-center">
de213bf0
BB
70 {{{ output.user_menu }}}
71 </li>
72 </ul>
73 <!-- search_box -->
74</nav>
75