Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 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 core_question/question_banks_list
19
 
20
    Example context (json):
21
{
22
    "purpose": "content",
23
    "iconurl": {},
24
    "modname": "Course 1 course question bank",
25
    "description": "<div class=\"no-overflow\">Description<\/div>",
26
    "managequestions": {
27
        "id": "action_link669a882ce8ec613",
28
        "disabled": false,
29
        "text": "Course 1 course question bank",
30
        "url": "example/index.php?id=2",
31
        "icon": null,
32
        "classes": "",
33
        "attributes": [],
34
        "actions": [],
35
        "hasactions": false
36
    },
37
    "managebank": {
38
        "instance": 1,
39
        "classes": "moodle-actionmenu",
40
        "attributes": [
41
            {
42
                "name": "id",
43
                "value": "action-menu-1"
44
            },
45
            {
46
                "name": "data-enhance",
47
                "value": "moodle-core-actionmenu"
48
            }
49
        ],
50
        "primary": {
51
            "title": "",
52
            "prioritise": false,
53
            "classes": "menubar",
54
            "attributes": [
55
                {
56
                    "name": "id",
57
                    "value": "action-menu-1-menubar"
58
                }
59
            ],
60
            "triggerattributes": [],
61
            "menutrigger": "<i class=\"icon fa fa-ellipsis-v fa-fw \"  title=\"Edit\" role=\"img\" aria-label=\"Edit\"><\/i>",
62
            "triggerextraclasses": "btn btn-icon d-flex no-caret ",
63
            "triggerrole": "button",
64
            "iconraw": "",
65
            "actiontext": "",
66
            "items": []
67
        },
68
        "secondary": {
69
            "classes": "menu",
70
            "attributes": [
71
                {
72
                    "name": "id",
73
                    "value": "action-menu-1-menu"
74
                },
75
                {
76
                    "name": "data-rel",
77
                    "value": "menu-content"
78
                },
79
                {
80
                    "name": "aria-labelledby",
81
                    "value": "action-menu-toggle-1"
82
                },
83
                {
84
                    "name": "role",
85
                    "value": "menu"
86
                }
87
            ],
88
            "items": [
89
                {
90
                    "simpleitem": false,
91
                    "actionmenulink": {
92
                        "id": "action_link669a882ce8ec67",
93
                        "disabled": false,
94
                        "text": "Edit settings",
95
                        "url": "https:example.com/course/mod.php?sesskey=abcde12345&update=2",
96
                        "icon": {
97
                            "key": "t\/edit",
98
                            "component": "moodle",
99
                            "title": ""
100
                        },
101
                        "classes": "editing_update menu-action",
102
                        "attributes": [
103
                            {
104
                                "name": "data-action",
105
                                "value": "update"
106
                            },
107
                            {
108
                                "name": "role",
109
                                "value": "menuitem"
110
                            },
111
                            {
112
                                "name": "tabindex",
113
                                "value": "-1"
114
                            }
115
                        ],
116
                        "actions": [],
117
                        "hasactions": false,
118
                        "showtext": true
119
                    }
120
                },
121
                {
122
                    "simpleitem": false,
123
                    "actionmenulink": {
124
                        "id": "action_link669a882ce8ec611",
125
                        "disabled": false,
126
                        "text": "Assign roles",
127
                        "url": "https:example.com/admin/roles/assign.php?contextid=16",
128
                        "icon": {
129
                            "key": "t\/assignroles",
130
                            "component": "moodle",
131
                            "title": ""
132
                        },
133
                        "classes": "editing_assign menu-action",
134
                        "attributes": [
135
                            {
136
                                "name": "data-action",
137
                                "value": "assignroles"
138
                            },
139
                            {
140
                                "name": "data-sectionreturn",
141
                                "value": null
142
                            },
143
                            {
144
                                "name": "role",
145
                                "value": "menuitem"
146
                            },
147
                            {
148
                                "name": "tabindex",
149
                                "value": "-1"
150
                            }
151
                        ],
152
                        "actions": [],
153
                        "hasactions": false,
154
                        "showtext": true
155
                    }
156
                },
157
                {
158
                    "simpleitem": false,
159
                    "actionmenulink": {
160
                        "id": "action_link669a882ce8ec612",
161
                        "disabled": false,
162
                        "text": "Delete",
163
                        "url": "https:example.com/course/mod.php?sesskey=abcde12345&delete=2",
164
                        "icon": {
165
                            "key": "t\/delete",
166
                            "component": "moodle",
167
                            "title": ""
168
                        },
169
                        "classes": "editing_delete text-danger menu-action",
170
                        "attributes": [
171
                            {
172
                                "name": "data-action",
173
                                "value": "cmDelete"
174
                            },
175
                            {
176
                                "name": "data-sectionreturn",
177
                                "value": null
178
                            },
179
                            {
180
                                "name": "data-id",
181
                                "value": "2"
182
                            },
183
                            {
184
                                "name": "role",
185
                                "value": "menuitem"
186
                            },
187
                            {
188
                                "name": "tabindex",
189
                                "value": "-1"
190
                            }
191
                        ],
192
                        "actions": [],
193
                        "hasactions": false,
194
                        "showtext": true
195
                    }
196
                }
197
            ]
198
        },
199
        "dropdownalignment": "dropdown-menu-right"
200
    }
201
}
202
}}
203
 
204
<div class="question-banks-list">
205
    <ul class="list-unstyled">
206
        <li class="d-flex mb-2 me-2">
207
            <div class="flex-shrink-0 {{purpose}} activityiconcontainer icon-size-6 modicon_{{modname}}">
208
                <a href="{{managequestions.url}}">
209
                    <img class="icon activityicon" aria-hidden="true" src="{{iconurl}}" alt="modicon_{{modname}}"/>
210
                </a>
211
            </div>
212
            <div class="flex-grow-1 align-self-center ms-3">
213
                {{#managequestions}}
214
                    {{> core/action_link}}
215
                {{/managequestions}}
216
                <div class="manage-bank-actions d-inline-block">
217
                    {{#managebank}}
218
                        {{> core/action_menu}}
219
                    {{/managebank}}
220
                </div>
221
                {{{description}}}
222
            </div>
223
        </li>
224
    </ul>
225
</div>