MDL-63044 block_timeline: add timeline block
[moodle.git] / theme / bootstrapbase / templates / block_timeline / event-list-item.mustache
blobaf008b179190982ab9c734928f89c36ce2f8d656
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 License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
17 {{!
18     @template block_timeline/event-list-item
20     This template renders an event list item for the timeline block.
22     Example context (json):
23     {
24         "name": "Assignment due 1",
25         "url": "https://www.google.com",
26         "timesort": 1490320388,
27         "course": {
28             "fullnamedisplay": "Course 1"
29         },
30         "action": {
31             "name": "Submit assignment",
32             "url": "https://www.google.com",
33             "itemcount": 1,
34             "showitemcount": true,
35             "actionable": true
36         },
37         "icon": {
38             "key": "icon",
39             "component": "mod_assign",
40             "alttext": "Assignment icon"
41         }
42     }
44 <li class="media">
45     <a
46         class="media"
47         href="{{{action.url}}}"
48         title="{{name}}"
49         data-region="event-list-item"
50         aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": "{{name}}", "course": "{{course.fullnamedisplay}}", "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
51     >
52         <div class="icon-size-4 pull-left">
53             {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
54         </div>
55         <small class="text-right text-nowrap pull-right">
56             {{#userdate}} {{timesort}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
57         </small>
58         <div class="text-truncate line-height-3 media-body">
59             <h6 class="text-truncate m-0">{{{name}}}</h6>
60             <small class="text-muted text-truncate">{{{course.fullnamedisplay}}}</small>
61         </div>
62     </a>
63 </li>