weekly release 3.9dev
[moodle.git] / course / templates / chooser.mustache
CommitLineData
05b27f21
MM
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
19
20 Chooser dialog template.
21
22 Example context (json):
23 {
24 "title": "Chooser title",
25 "options": {
26 "label": "Option name",
27 "description": "Option description",
28 "urls": {
29 "addoption": "http://addoptionurl.com"
30 },
31 "icon": "<img class='icon' src='http://urltooptionicon'>"
32 }
33 }
34}}
f152b71d 35
05b27f21
MM
36<div data-region="carousel" class="carousel slide">
37 <div class="carousel-inner" aria-live="polite">
c58c23d6 38 <div class="carousel-item p-4 active" data-region="modules">
f152b71d
MG
39 <div class="modchoosercontainer" aria-label="{{#str}} activitymodules, core {{/str}}">
40 <div class="searchcontainer mb-3">
41 {{>core_course/chooser_search}}
c58c23d6 42 </div>
f152b71d
MG
43 <div data-region="chooser-container">
44 <ul class="nav nav-tabs mb-2" id="activities-{{uniqid}}" role="tablist">
45 <li class="nav-item">
46 <a class="nav-link {{#favouritesFirst}}active{{/favouritesFirst}} {{^favourites}}d-none{{/favourites}}"
47 id="starred-tab-{{uniqid}}"
48 data-toggle="tab"
49 data-region="favourite-tab-nav"
50 href="#starred-{{uniqid}}"
51 role="tab"
52 aria-label="{{#str}} aria:favouritestab, core_course {{/str}}"
53 aria-controls="starred-{{uniqid}}"
54 aria-selected="{{#favouritesFirst}}true{{/favouritesFirst}}{{^favouritesFirst}}false{{/favouritesFirst}}"
55 tabindex="{{#favouritesFirst}}0{{/favouritesFirst}}{{^favouritesFirst}}-1{{/favouritesFirst}}"
56 >
57 {{#str}} favourites, core {{/str}}
58 </a>
59 </li>
60 <li class="nav-item">
61 <a class="nav-link {{#recommendedFirst}}active{{/recommendedFirst}} {{^recommended}}d-none{{/recommended}}"
62 id="recommended-tab-{{uniqid}}"
63 data-region="recommended-tab-nav"
64 data-toggle="tab"
65 href="#recommended-{{uniqid}}"
66 role="tab"
67 aria-label="{{#str}} aria:recommendedtab, core_course {{/str}}"
68 aria-controls="recommended-{{uniqid}}"
69 aria-selected="{{#recommendedFirst}}true{{/recommendedFirst}}{{^recommendedFirst}}false{{/recommendedFirst}}"
70 tabindex="{{#recommendedFirst}}0{{/recommendedFirst}}{{^recommendedFirst}}-1{{/recommendedFirst}}">
71 {{#str}} recommended, core {{/str}}
72 </a>
73 </li>
74 <li class="nav-item">
75 <a class="nav-link {{#fallback}}active{{/fallback}}"
76 id="all-tab-{{uniqid}}"
77 data-toggle="tab"
78 data-region="default-tab-nav"
79 href="#all-{{uniqid}}"
80 role="tab"
81 aria-label="{{#str}} aria:defaulttab, core_course {{/str}}"
82 aria-controls="all-{{uniqid}}"
83 aria-selected="{{#fallback}}true{{/fallback}}{{^fallback}}false{{/fallback}}"
84 tabindex="{{#fallback}}0{{/fallback}}{{^fallback}}-1{{/fallback}}"
85 >
86 {{#str}} activities, core {{/str}}
87 </a>
88 </li>
89 </ul>
90 <div class="tab-content" id="tabbed-activities-{{uniqid}}">
91 <div class="tab-pane {{#favouritesFirst}}active{{/favouritesFirst}}" id="starred-{{uniqid}}" data-region="favourites" role="tabpanel" aria-labelledby="starred-tab-{{uniqid}}">
92 <div class="optionscontainer d-flex flex-wrap mw-100 p-3 position-relative" role="menubar" data-region="chooser-options-container" data-render="favourites-area">
93 {{>core_course/chooser_favourites}}
94 </div>
c58c23d6 95 </div>
f152b71d
MG
96 <div class="tab-pane {{#recommendedFirst}}active{{/recommendedFirst}}" id="recommended-{{uniqid}}" data-region="recommended" role="tabpanel" aria-labelledby="recommended-tab-{{uniqid}}">
97 <div class="optionscontainer d-flex flex-wrap mw-100 p-3 position-relative" role="menubar" data-region="chooser-options-container">
98 {{#recommended}}
99 {{>core_course/chooser_item}}
100 {{/recommended}}
101 </div>
102 </div>
103 <div class="tab-pane {{#fallback}}active{{/fallback}}" id="all-{{uniqid}}" data-region="default" role="tabpanel" aria-labelledby="all-tab-{{uniqid}}">
104 <div class="optionscontainer d-flex flex-wrap mw-100 p-3 position-relative" role="menubar" data-region="chooser-options-container">
105 {{#default}}
106 {{>core_course/chooser_item}}
107 {{/default}}
108 </div>
c58c23d6
MM
109 </div>
110 </div>
05b27f21
MM
111 </div>
112 </div>
113 </div>
114 <div class="carousel-item" data-region="help"></div>
115 </div>
116</div>