Merge branch 'MDL-63839_master' of git://github.com/markn86/moodle
[moodle.git] / blocks / recentlyaccessedcourses / templates / view-cards.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
14     You should have received a copy of the GNU General Public Licensebllsdsadfasfd
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16 }}
17 {{!
18     @template block_recentlyaccessedcourses/view-cards
20     This template renders the carousel for the recentlyaccessedcourses block.
22     Example context (json):
23     {
24         "courses": [
25             {
26                 "name": "Assignment due 1",
27                 "viewurl": "https://moodlesite/course/view.php?id=2",
28                 "courseimageurl": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
29                 "fullname": "course 3",
30                 "isfavourite": true
31             }
32         ]
33     }
34 }}
36 <div class="card-deck dashboard-card-deck" role="list">
37     {{#courses}}
38         <div class="card dashboard-card" role="listitem">
39             <a href="{{viewurl}}" title="{{fullname}}">
40                 <div class="card-img-top dashboard-card-img" style='background-image: url("{{{courseimage}}}");'>
41                     <span class="sr-only">{{#str}}aria:courseimage, core_course{{/str}}</span>
42                     {{>core_course/favouriteicon }}
43                 </div>
44                 <div class="card-body pr-1 course-info-container">
45                     <div class="d-flex">
46                         <div class="card-title d-inline-block text-truncate">
47                             {{{fullname}}}
48                         </div>
49                     </div>
50                 </div>
51             </a>
52         </div>
53     {{/courses}}
54 </div>