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 block_myoverview/view-list
|
|
|
19 |
|
|
|
20 |
This template renders the list view for the myoverview block.
|
|
|
21 |
|
|
|
22 |
Example context (json):
|
|
|
23 |
{
|
|
|
24 |
"courses": [
|
|
|
25 |
{
|
|
|
26 |
"name": "Assignment due 1",
|
|
|
27 |
"viewurl": "https://moodlesite/course/view.php?id=2",
|
|
|
28 |
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
|
|
|
29 |
"fullname": "course 3",
|
|
|
30 |
"hasprogress": true,
|
|
|
31 |
"progress": 10,
|
|
|
32 |
"coursecategory": "Category 1",
|
|
|
33 |
"visible": true
|
|
|
34 |
}
|
|
|
35 |
]
|
|
|
36 |
}
|
|
|
37 |
}}
|
|
|
38 |
|
|
|
39 |
<ul class="list-group">
|
|
|
40 |
{{#courses}}
|
|
|
41 |
<li class="list-group-item course-listitem border-left-0 border-right-0 border-top-0 px-2 rounded-0"
|
|
|
42 |
data-region="course-content"
|
|
|
43 |
data-course-id="{{{id}}}">
|
|
|
44 |
<div class="row">
|
|
|
45 |
<div class="col-md-2 d-flex align-items-center mb-sm-3 mb-md-0">
|
|
|
46 |
<a href="{{viewurl}}" tabindex="-1" class="mw-100 w-100">
|
|
|
47 |
<div class="rounded list-image mw-100" style='background-image: url("{{{courseimage}}}");'>
|
|
|
48 |
<span class="sr-only">{{fullname}}</span>
|
|
|
49 |
</div>
|
|
|
50 |
</a>
|
|
|
51 |
</div>
|
|
|
52 |
<div class="col-md-9 d-flex flex-column">
|
|
|
53 |
{{#showshortname}}
|
|
|
54 |
<div class="text-muted muted d-flex flex-wrap">
|
|
|
55 |
{{#showcoursecategory}}
|
|
|
56 |
<div class="pl-1 pr-1">|</div>
|
|
|
57 |
{{/showcoursecategory}}
|
|
|
58 |
<span class="sr-only">
|
|
|
59 |
{{#str}}aria:courseshortname, core_course{{/str}}
|
|
|
60 |
</span>
|
|
|
61 |
<div>{{{shortname}}}</div>
|
|
|
62 |
</div>
|
|
|
63 |
{{/showshortname}}
|
|
|
64 |
<a href="{{viewurl}}" class="aalink coursename">
|
|
|
65 |
{{> core_course/favouriteicon }}
|
|
|
66 |
<span class="sr-only">
|
|
|
67 |
{{#str}}aria:coursename, core_course{{/str}}
|
|
|
68 |
</span>
|
|
|
69 |
{{{fullname}}}
|
|
|
70 |
</a>
|
|
|
71 |
{{#showcoursecategory}}
|
|
|
72 |
<div class="text-muted muted d-flex flex-wrap">
|
|
|
73 |
<span class="sr-only">
|
|
|
74 |
{{#str}}aria:coursecategory, core_course{{/str}}
|
|
|
75 |
</span>
|
|
|
76 |
<span class="categoryname">
|
|
|
77 |
{{{coursecategory}}}
|
|
|
78 |
</span>
|
|
|
79 |
</div>
|
|
|
80 |
{{/showcoursecategory}}
|
|
|
81 |
{{^visible}}
|
|
|
82 |
<div class="d-flex flex-wrap">
|
|
|
83 |
<span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
|
|
|
84 |
</div>
|
|
|
85 |
{{/visible}}
|
|
|
86 |
{{#hasprogress}}
|
|
|
87 |
<div class="text-muted muted d-flex flex-wrap mt-auto">
|
|
|
88 |
{{> block_myoverview/progress-bar}}
|
|
|
89 |
</div>
|
|
|
90 |
{{/hasprogress}}
|
|
|
91 |
</div>
|
|
|
92 |
<div class="col-md-1 p-0 d-flex menu">
|
|
|
93 |
{{> block_myoverview/course-action-menu }}
|
|
|
94 |
</div>
|
|
|
95 |
</div>
|
|
|
96 |
</li>
|
|
|
97 |
{{/courses}}
|
|
|
98 |
</ul>
|