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 report_insights/bulk_action_button
|
|
|
19 |
|
|
|
20 |
Extension of core/single_button to show the label with HTML
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
* none
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* classes - a list of classes to wrap the form.
|
|
|
30 |
* url - the action url to submit to
|
|
|
31 |
* params - array of params with name and value attributes
|
|
|
32 |
* primary - true if this is a primary action button
|
|
|
33 |
* id - id for the element
|
|
|
34 |
* tooltip - tooltip text for the button
|
|
|
35 |
* disabled - true if this element is disabled
|
|
|
36 |
* label - text to show on the button
|
|
|
37 |
|
|
|
38 |
Example context (json):
|
|
|
39 |
{
|
|
|
40 |
"url" : "#",
|
|
|
41 |
"primary" : true,
|
|
|
42 |
"tooltip" : "This is a tooltip",
|
|
|
43 |
"label" : "This is a the button text, it can include HTML",
|
|
|
44 |
"attributes": [
|
|
|
45 |
{
|
|
|
46 |
"name": "data-attribute",
|
|
|
47 |
"value": "yeah"
|
|
|
48 |
}
|
|
|
49 |
]
|
|
|
50 |
}
|
|
|
51 |
}}
|
|
|
52 |
<div class="{{classes}}">
|
|
|
53 |
{{#params}}
|
|
|
54 |
<input type="hidden" name="{{name}}" value="{{value}}">
|
|
|
55 |
{{/params}}
|
|
|
56 |
<button type="submit" class="btn btn-sm {{#primary}}btn-primary{{/primary}}{{^primary}}btn-secondary{{/primary}}"
|
|
|
57 |
id="{{id}}"
|
|
|
58 |
title="{{tooltip}}"
|
|
|
59 |
{{#disabled}}disabled{{/disabled}}
|
|
|
60 |
{{#attributes}} {{name}}="{{value}}" {{/attributes}}>{{{label}}}</button>
|
|
|
61 |
</div>
|