MDL-78324 core: Convert core/tag to esm
[moodle.git] / course / templates / category_actionbar.mustache
blobf232dae39d33c3704a7408104c112dcd5789001c
1 {{!
2     This file is part of Moodle - http://moodle.org/
3     Moodle is free software: you can redistribute it and/or modify
4     it under the terms of the GNU General Public License as published by
5     the Free Software Foundation, either version 3 of the License, or
6     (at your option) any later version.
7     Moodle is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10     GNU General Public License for more details.
11     You should have received a copy of the GNU General Public License
12     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
14 {{!
15     @template core_course/category_actionbar
17     Displays the tertiary nav for the category page
19     Context variables required for this template:
20     * urlselect Object - The content to be rendered within the url_select
21     * renderedcontent String - Any additional content/actions to be displayed inline with the select box
23     Example context (json):
24     {
25         "categoryselect" : {
26             "formid": "url_select_f61834256d7754158",
27             "classes": "urlselect",
28             "label": "",
29             "disabled": false,
30             "title":null,
31             "id":"url_select61834256d7754159",
32             "sesskey":"LWILINyZMH",
33             "action":"http:\/\/localhost\/stable_master\/course\/jumpto.php",
34             "showbutton":null,
35             "options": [
36                 {
37                     "name":"Category 1",
38                     "value":"\/course\/index.php\/?categoryid=279"
39                 },
40                 {
41                     "name":"Category 2",
42                     "value":"\/course\/index.php\/?categoryid=280"
43                 },
44                 {
45                     "name":"Category 3",
46                     "value":"\/course\/index.php\/?categoryid=281"
47                 }
48             ],
49             "labelattributes":[],
50             "helpicon":false,
51             "attributes":[]
52         },
53         "search": {
54             "action": "https://moodle.local/admin/search.php",
55             "extraclasses": "my-2",
56             "inputname": "search",
57             "inform": false,
58             "searchstring": "Search settings",
59             "value": "policy",
60             "btnclass": "primary",
61             "query": "themedesigner",
62             "hiddenfields": [
63                 {
64                     "name": "context",
65                     "value": "11"
66                 }
67             ]
68         },
69         "additionaloptions": {
70             "options": [
71                 {
72                     "url": "\/course\/index.php\/?categoryid=281",
73                     "string": "Action 1"
74                     "attributes": [
75                         {
76                             "name": "data-id",
77                             "value": "1"
78                         },
79                         {
80                             "name": "aria-role",
81                             "value": "test"
82                         }
83                     ]
84                 }
85             ]
86         }
87     }
89 <div class="container-fluid tertiary-navigation" id="action_bar">
90     <div class="row">
91         {{#categoryselect}}
92             <div class="navitem">
93                 {{> core/url_select }}
94             </div>
95         {{/categoryselect}}
96         {{#search}}
97             <div class="navitem">
98                 {{> core/search_input }}
99             </div>
100         {{/search}}
101         {{#additionaloptions}}
102             <div class="ml-auto d-flex">
103                 <div class="navitem dropdown">
104                     <button aria-label="{{#str}}moreactions{{/str}}" class="btn btn-secondary dropdown-toggle" id="dropdown-actions" data-toggle="dropdown" aria-haspopup="true" aria-controls="moreactionsmenu">
105                         {{#str}}moremenu{{/str}}
106                     </button>
108                     <div id="moreactionsmenu" class="dropdown-menu" aria-labelledby="dropdown-actions" role="menu">
109                         {{#options}}
110                             <a role="menuitem" class="dropdown-item" {{#attributes}}{{name}}="{{value}}"{{/attributes}} href="{{url}}" tabindex="-1">{{string}}</a>
111                         {{/options}}
112                     </div>
113                 </div>
114             </div>
115         {{/additionaloptions}}
116     </div>
117 </div>