MDL-67883 core: Make core ready for MoodleNet.
[moodle.git] / course / templates / local / activitychooser / item.mustache
... / ...
CommitLineData
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_course/chooser_item
19
20 Chooser item template.
21
22 Example context (json):
23 {
24 "label": "Option name",
25 "description": "Option description",
26 "urls": {
27 "addoption": "http://addoptionurl.com"
28 },
29 "icon": "<img class='icon' src='http://urltooptionicon'>"
30 }
31}}
32<div role="menuitem" tabindex="-1" aria-label="{{title}}" class="option border-0 card m-1 bg-white" data-region="chooser-option-container" data-internal="{{name}}" data-modname="{{componentname}}_{{link}}">
33 <div class="optioninfo card-body d-flex flex-column text-center p-1" data-region="chooser-option-info-container">
34 <a class="d-flex flex-column justify-content-between flex-fill" href="{{link}}" title="{{#str}} addnew, moodle, {{title}} {{/str}}" tabindex="-1" data-action="add-chooser-option">
35 <div class="optionicon mt-2 mb-1 icon-size-5 icon-no-margin">
36 {{{icon}}}
37 </div>
38 <div class="optionname clamp-2">{{title}}</div>
39 </a>
40 <div class="optionactions d-flex justify-content-center" role="group" data-region="chooser-option-actions-container">
41 {{^legacyitem}}
42 <button class="btn btn-icon icon-no-margin icon-size-3 m-0 optionaction {{#favourite}}text-primary{{/favourite}}{{^favourite}}text-muted{{/favourite}}"
43 data-action="manage-module-favourite"
44 data-favourited="{{favourite}}"
45 data-id="{{id}}"
46 data-name="{{componentname}}"
47 data-internal="{{name}}"
48 {{^favourite}}
49 aria-pressed="false"
50 {{/favourite}}
51 {{#favourite}}
52 aria-pressed="true"
53 {{/favourite}}
54 aria-label="{{#str}} aria:modulefavourite, core_course, {{title}} {{/str}}"
55 tabindex="-1"
56 >
57 {{#favourite}}
58 {{#pix}} i/star, core {{/pix}}
59 {{/favourite}}
60 {{^favourite}}
61 {{#pix}} i/star-o, core {{/pix}}
62 {{/favourite}}
63 </button>
64 {{/legacyitem}}
65 <button class="btn btn-icon icon-no-margin icon-size-3 m-0 optionaction" data-action="show-option-summary" tabindex="-1">
66 <span aria-hidden="true">{{#pix}} docs, core {{/pix}}</span>
67 <span class="sr-only">{{#str}} informationformodule, core_course, {{title}} {{/str}}</span>
68 </button>
69 </div>
70 </div>
71</div>