MDL-64092 block_timeline: Separate the activity view and submission link
[moodle.git] / blocks / timeline / templates / event-list-item.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 License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16 }}
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     }
43 }}
44 <div class="list-group-item flex-column py-2 pl-0 pr-0 border-0"
45     data-region="event-list-item"
46     >
47     <div class="d-flex">
48         <div class="icon-size-4 d-flex align-self-top">
49             {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
50         </div>
51         <div class="w-100 event-name-container text-truncate line-height-3">
52             <a href="{{url}}"
53                title="{{name}}"
54                aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": "{{name}}", "course": "{{course.fullnamedisplay}}", "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'
55             ><h6 class="event-name text-truncate mb-0">{{{name}}}</h6></a>
56             <small class="text-muted text-truncate m-b-0">{{{course.fullnamedisplay}}}</small>
57             {{#action.actionable}}
58             <h6 class="m-b-0 pt-2">
59                 <a href="{{{action.url}}}" aria-label="{{{action.name}}}" title="{{{action.name}}}" class="list-group-item-action">{{{action.name}}}</a>
60             </h6>
61             {{/action.actionable}}
62         </div>
63         <small class="text-right text-nowrap ml-1">
64             {{#userdate}} {{timesort}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
65         </small>
67     </div>
68 </div>