1 |
efrain |
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 |
"homeurl": "/my/"
|
|
|
36 |
},
|
|
|
37 |
"sitename": "Moodle Site"
|
|
|
38 |
}
|
|
|
39 |
}}
|
|
|
40 |
<nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
|
|
|
41 |
<div class="container-fluid">
|
|
|
42 |
<a href="{{{ config.homeurl }}}" class="navbar-brand d-flex align-items-center m-1 p-0 aabtn">
|
|
|
43 |
{{# output.should_display_navbar_logo }}
|
|
|
44 |
<img src="{{output.get_compact_logo_url}}" class="logo mr-1" alt="{{sitename}}">
|
|
|
45 |
{{/ output.should_display_navbar_logo }}
|
|
|
46 |
{{^ output.should_display_navbar_logo }}
|
|
|
47 |
<span class="sitename">{{{ sitename }}}</span>
|
|
|
48 |
{{/ output.should_display_navbar_logo }}
|
|
|
49 |
</a>
|
|
|
50 |
|
|
|
51 |
<ul class="navbar-nav d-none d-md-flex">
|
|
|
52 |
<!-- custom_menu -->
|
|
|
53 |
{{{ output.custom_menu }}}
|
|
|
54 |
<!-- page_heading_menu -->
|
|
|
55 |
{{{ output.page_heading_menu }}}
|
|
|
56 |
</ul>
|
|
|
57 |
<div id="usernavigation" class="navbar-nav my-1 ml-auto">
|
|
|
58 |
<div class="divider border-left h-50 align-self-center mx-1"></div>
|
|
|
59 |
{{{ output.search_box }}}
|
|
|
60 |
{{{ output.navbar_plugin_output }}}
|
|
|
61 |
<div class="d-flex align-items-stretch usermenu-container" data-region="usermenu">
|
|
|
62 |
{{{ output.user_menu }}}
|
|
|
63 |
</div>
|
|
|
64 |
</div>
|
|
|
65 |
</div>
|
|
|
66 |
</nav>
|