Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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/>.
13
}}
14
{{!
15
    @template mod_data/templates_action_bar
16
 
17
    Actions bar at the top of the template pages in the database activity.
18
 
19
    Context variables required for this template:
20
    * d - The database id.
21
    * selectmenu - The data object containing the required properties to render core/selectmenu.
22
    * actionsselect - The presets actions selector.
23
 
24
    Example context (json):
25
    {
26
        "d": 1,
27
        "selectmenu": {
28
            "name": "Templates tertiary navigation selector",
29
            "value": "opt",
30
            "baseid": "select-menu1",
31
            "selectedoption": "Single view template",
32
            "options": [
33
                {
34
                    "selected": false,
35
                    "name": "Add entry template",
36
                    "id": "select-menu-group1"
37
                },
38
                {
39
                    "selected": true,
40
                    "name": "Single view template",
41
                    "value": "opt2",
42
                    "id": "select-menu-option2"
43
                }
44
            ]
45
        },
46
        "actionsselect": {
47
            "classes": "moodle-actionmenu",
48
            "instance": "1",
49
            "triggerrole": "button",
50
            "primary": {
51
                "attributes": [
52
                    {"name": "id", "value": "action-menu-1"},
53
                    {"name": "role", "value": "menu"}
54
                ],
55
                "items": [
56
                    {
57
                        "attributes": [
58
                            {"name": "role", "value": "menuitem"}
59
                        ],
60
                        "rawhtml": "Actions"
61
                    }
62
                ]
63
            },
64
            "secondary": {
65
                "attributes": [
66
                    {"name": "id", "value": "action-menu-1-menu"},
67
                    {"name": "role", "value": "menuitem"}
68
                ],
69
                "items": [
70
                    {
71
                        "rawhtml": "Import preset"
72
                    },
73
                    {
74
                        "rawhtml": "Export preset"
75
                    }
76
                ]
77
            }
78
        }
79
    }
80
}}
81
<div class="container-fluid tertiary-navigation">
82
    <div class="row">
83
        <div class="navitem mb-0 col">
84
            {{#selectmenu}}
85
                <div>
86
                    {{>core/tertiary_navigation_selector}}
87
                </div>
88
            {{/selectmenu}}
89
        </div>
90
        <div class="col-auto">
91
            {{#actionsselect}}
92
                <div class='navitem mb-0 presetsactions'>
93
                    {{>core/action_menu}}
94
                </div>
95
            {{/actionsselect}}
96
        </div>
97
    </div>
98
</div>
99
<hr/>
100
{{#js}}
101
    require(['mod_data/saveaspreset', 'mod_data/resetalltemplates'], function(saveAsPreset, resetAll) {
102
        saveAsPreset.init();
103
        resetAll.init();
104
    });
105
{{/js}}