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 mod_unilabel/activity_picker_list
|
|
|
19 |
Template showing a bootstrap modal dialog to pick an activity instance and get its url.
|
|
|
20 |
|
|
|
21 |
Example context (json):
|
|
|
22 |
{
|
|
|
23 |
"formid": "xyzabc-123",
|
|
|
24 |
"hasactivities": 1,
|
|
|
25 |
"activities": [
|
|
|
26 |
{
|
|
|
27 |
"name": "name1",
|
|
|
28 |
"module": "forum",
|
|
|
29 |
"modulename": "Forum",
|
|
|
30 |
"activityname": "Announcements",
|
|
|
31 |
"url": "https://example.com",
|
|
|
32 |
"icon": "https://example.com/img.png",
|
|
|
33 |
"purpose": "content",
|
|
|
34 |
"filterstring": "Forum Announcements",
|
|
|
35 |
"hasavailabilityinfo": 1,
|
|
|
36 |
"availableinfo": [
|
|
|
37 |
{
|
|
|
38 |
"text": "Not available unless: ..."
|
|
|
39 |
}
|
|
|
40 |
],
|
|
|
41 |
"modstealth": "",
|
|
|
42 |
"stealthinfo": "",
|
|
|
43 |
"hidden": "1",
|
|
|
44 |
"hiddeninfo": "Hidden from students"
|
|
|
45 |
},
|
|
|
46 |
{
|
|
|
47 |
"name": "name1",
|
|
|
48 |
"module": "page",
|
|
|
49 |
"modulename": "Page",
|
|
|
50 |
"activityname": "Text of something",
|
|
|
51 |
"url": "https://example.com",
|
|
|
52 |
"icon": "https://example.com/img.png",
|
|
|
53 |
"purpose": "content",
|
|
|
54 |
"filterstring": "Page Text of something",
|
|
|
55 |
"hasavailabilityinfo": "",
|
|
|
56 |
"availableinfo": "",
|
|
|
57 |
"modstealth": 1,
|
|
|
58 |
"stealthinfo": "Hidden but available",
|
|
|
59 |
"hidden": "",
|
|
|
60 |
"hiddeninfo": ""
|
|
|
61 |
}
|
|
|
62 |
]
|
|
|
63 |
}
|
|
|
64 |
}}
|
|
|
65 |
{{#hasactivities}}
|
|
|
66 |
<input class="form-control" id="search-{{formid}}" type="text" placeholder="{{#str}}search{{/str}}...">
|
|
|
67 |
<ul id="unilabel-activity-picker-list" class="section m-0 p-0 img-text d-block" data-for="cmlist">
|
|
|
68 |
{{#activities}}
|
|
|
69 |
<li class="activity activity-wrapper {{module}} modtype_{{module}}" data-filterstring="{{filterstring}}" style="transition: all 1s ease-out;">
|
|
|
70 |
<div class="activity-item" style="cursor:default;">
|
|
|
71 |
<div class="activity-basis d-flex align-items-center">
|
|
|
72 |
<div class="d-flex flex-column flex-md-row w-100 align-self-start">
|
|
|
73 |
<div class="activity-instance w-100">
|
|
|
74 |
<div class="activitytitle media modtype_{{module}} position-relative align-self-start">
|
|
|
75 |
<div class="activityiconcontainer {{purpose}} courseicon align-self-start mr-3" style="{{#hidden}}opacity:0.5;{{/hidden}}">
|
|
|
76 |
<img src="{{{icon}}}" class="activityicon" alt="{{{module}}} icon">
|
|
|
77 |
</div>
|
|
|
78 |
<div class="media-body align-self-center" style="{{#hidden}}opacity:0.5;{{/hidden}}">
|
|
|
79 |
<div class="text-uppercase small">
|
|
|
80 |
{{{modulename}}}
|
|
|
81 |
</div>
|
|
|
82 |
<div class="activityname">
|
|
|
83 |
<a class="aalink stretched-link activity-picker-link text-decoration-none" href="{{{url}}}">
|
|
|
84 |
{{activityname}}{{#availableinfo}}
|
|
|
85 |
<div class="description">
|
|
|
86 |
<div class="course-description-item description-inner my-0 py-0">
|
|
|
87 |
{{{text}}}
|
|
|
88 |
</div>
|
|
|
89 |
</div>
|
|
|
90 |
{{/availableinfo}}
|
|
|
91 |
{{#modstealth}}
|
|
|
92 |
<div class="description">
|
|
|
93 |
<div class="course-description-item description-inner my-0 py-0">
|
|
|
94 |
({{stealthinfo}})
|
|
|
95 |
</div>
|
|
|
96 |
</div>
|
|
|
97 |
{{/modstealth}}
|
|
|
98 |
{{#hiddeninfo}}
|
|
|
99 |
<div class="description">
|
|
|
100 |
<div class="course-description-item description-inner my-0 py-0">
|
|
|
101 |
({{.}})
|
|
|
102 |
</div>
|
|
|
103 |
</div>
|
|
|
104 |
{{/hiddeninfo}}
|
|
|
105 |
</a>
|
|
|
106 |
</div>
|
|
|
107 |
</div>
|
|
|
108 |
<div class="float-right unilabel-activity-picker-info">
|
|
|
109 |
<i class="fa fa-external-link"></i>
|
|
|
110 |
</div>
|
|
|
111 |
</div>
|
|
|
112 |
</div>
|
|
|
113 |
</div>
|
|
|
114 |
</div>
|
|
|
115 |
</div>
|
|
|
116 |
</li>
|
|
|
117 |
{{/activities}}
|
|
|
118 |
</ul>
|
|
|
119 |
{{/hasactivities}}
|