Automatically generated installer lang files
[moodle.git] / lib / templates / action_menu_trigger.mustache
blob6f2faa3d09e5523c2fdd4461af1423b02011aede
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/>.
17 {{!
18     @template core/action_menu_trigger
20     Action menu trigger.
22     Example context (json):
23     {
24         "text": "Example link text",
25         "title": "Example link title",
26         "url": "http://example.com/link",
27         "classes": "icon menu-action",
28         "instance": "1",
29         "triggerextraclasses": "",
30         "attributes": [
31             {"name": "role", "value": "menuitem" },
32             {"name": "data-title", "value": "mymoodle,admin" }
33         ],
34         "secondary": {
35             "classes": "menu  align-tr-br",
36             "dropdownalignment": "dropdown-menu-right",
37             "attributes": [
38                 {"name": "id", "value": "action-menu-0-menu"},
39                 {"name": "data-rel", "value": "menu-content"},
40                 {"name": "role", "value": "menu"},
41                 {"name": "data-align", "value": "tr-br"}
42             ],
43             "items": [
44                 {"actionmenulink":
45                     {
46                     "id": "action_link59ecf8394a68078",
47                     "disabled": false,
48                     "text": "Dashboard",
49                     "url": "http://example.com/link",
50                     "icon": {
51                         "key": "i/dashboard",
52                         "component": null,
53                         "title": "Dashboard"
54                         },
55                     "classes": "icon menu-action",
56                     "attributes": [
57                         {"name": "role", "value": "menuitem"},
58                         {"name": "data-title", "value": "mymoodle,admin"}
59                         ],
60                     "instance": 1,
61                     "showtext": true
62                     }
63                 },
64                 {"actionmenufiller":
65                     {
66                     "id": "action_link59ecf8394a68079",
67                     "disabled": false,
68                     "text": "",
69                     "url": "",
70                     "icon": null,
71                     "classes": "",
72                     "attributes": [
73                         {"name": "role", "value": "menuitem"}
74                         ]
75                     }
76                 }
77             ]
78         }
79     }
81 <div class="dropdown{{^secondary.items}} hidden{{/secondary.items}}">
82     <a href="#" tabindex="0" class="{{triggerextraclasses}} dropdown-toggle icon-no-margin" id="action-menu-toggle-{{instance}}" aria-label="{{title}}" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" aria-controls="action-menu-{{instance}}-menu">
83         {{{actiontext}}}
84         {{{menutrigger}}}
85             {{#icon}}
86                 {{#pix}}
87                     {{key}},{{component}},{{title}}
88                 {{/pix}}
89             {{/icon}}
90             {{#rawicon}}{{{.}}}{{/rawicon}}
91         {{#menutrigger}}
92         <b class="caret"></b>
93         {{/menutrigger}}
94     </a>
95     {{#secondary}}
96         <div class="dropdown-menu {{classes}} {{dropdownalignment}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
97             {{#items}}
98                 {{#actionmenulink}}
99                     {{< core/action_menu_link}}
100                         {{$actionmenulinkclasses}}dropdown-item {{classes}}{{/actionmenulinkclasses}}
101                     {{/ core/action_menu_link}}
102                 {{/actionmenulink}}
103                 {{#actionmenufiller}}
104                     <div class="dropdown-divider" role="presentation"><span class="filler">&nbsp;</span></div>
105                 {{/actionmenufiller}}
106                 {{^actionmenulink}}
107                     {{^actionmenufiller}}
108                         <div class="dropdown-item">{{> core/action_menu_item }}</div>
109                     {{/actionmenufiller}}
110                 {{/actionmenulink}}
111             {{/items}}
112         </div>
113     {{/secondary}}
114 </div>