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 core_course/coursecard
|
|
|
19 |
|
|
|
20 |
This template renders the a card for the course cards.
|
|
|
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 |
"visible": true
|
|
|
33 |
}
|
|
|
34 |
]
|
|
|
35 |
}
|
|
|
36 |
}}
|
|
|
37 |
<div class="card course-card mx-1" role="listitem"
|
|
|
38 |
data-region="course-content"
|
|
|
39 |
data-course-id="{{{id}}}">
|
|
|
40 |
<a href="{{viewurl}}" tabindex="-1">
|
|
|
41 |
<div class="card-img-top" style='background-image: url("{{{courseimage}}}");'>
|
|
|
42 |
<span class="sr-only">{{fullname}}</span>
|
|
|
43 |
</div>
|
|
|
44 |
</a>
|
|
|
45 |
<div class="card-body pr-1 course-info-container" id="course-info-container-{{id}}-{{uniqid}}">
|
|
|
46 |
<div class="d-flex align-items-start">
|
|
|
47 |
<div class="w-100 text-truncate">
|
|
|
48 |
{{#showshortname}}
|
|
|
49 |
<div class="text-muted muted d-flex mb-1 flex-wrap">
|
|
|
50 |
<span class="sr-only">
|
|
|
51 |
{{#str}}aria:courseshortname, core_course{{/str}}
|
|
|
52 |
</span>
|
|
|
53 |
<div>
|
|
|
54 |
{{{shortname}}}
|
|
|
55 |
</div>
|
|
|
56 |
</div>
|
|
|
57 |
{{/showshortname}}
|
|
|
58 |
<a href="{{viewurl}}" class="aalink coursename mr-2 mb-1">
|
|
|
59 |
{{> core_course/favouriteicon }}
|
|
|
60 |
<span class="sr-only">
|
|
|
61 |
{{#str}}aria:coursename, core_course{{/str}}
|
|
|
62 |
</span>
|
|
|
63 |
{{$coursename}}{{/coursename}}
|
|
|
64 |
</a>
|
|
|
65 |
<div class="text-muted muted d-flex flex-wrap">
|
|
|
66 |
{{$coursecategory}}{{/coursecategory}}
|
|
|
67 |
</div>
|
|
|
68 |
{{^visible}}
|
|
|
69 |
<div class="d-flex flex-wrap">
|
|
|
70 |
<span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
|
|
|
71 |
</div>
|
|
|
72 |
{{/visible}}
|
|
|
73 |
</div>
|
|
|
74 |
</div>
|
|
|
75 |
</div>
|
|
|
76 |
<div class="d-flex align-items-start">
|
|
|
77 |
{{$progress}}{{/progress}}
|
|
|
78 |
{{$menu}}{{/menu}}
|
|
|
79 |
</div>
|
|
|
80 |
</div>
|