{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template block_timeline/event-list-item

    This template renders an event list item for the timeline block.

    Example context (json):
    {
        "name": "Assignment 1 is due",
        "activityname": "Assignment",
        "activitystr": "Assignment is due",
        "courseview": true,
        "url": "https://www.google.com",
        "timesort": 1490320388,
        "course": {
            "fullnamedisplay": "Course 1"
        },
        "action": {
            "name": "Submit assignment",
            "url": "https://www.google.com",
            "itemcount": 1,
            "showitemcount": true,
            "actionable": true
        },
        "icon": {
            "key": "icon",
            "component": "mod_assign",
            "alttext": "Assignment icon"
        },
        "overdue": false,
        "purpose": "assessment"
    }
}}
<div class="list-group-item bg-transparent timeline-event-list-item flex-column px-0 py-2 {{#courseview}}{{/courseview}}{{^courseview}}{{/courseview}}"
        data-region="event-list-item">
    <div class="d-flex flex-wrap">
        <div class="d-flex timeline-name w-100 flex-gap-4">
            <div class="activityiconcontainer small {{purpose}} courseicon align-self-top align-self-center  text-nowrap">
                {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
            </div>
            <div class="event-name-container d-flex w-100 flex-gap-4 ">
                <div class="d-flex flex-column flex-gap-4">
                        <div class="d-flex flex-column flex-gap-d5">
                            <h6 class="event-name mb-0 h-semibold-5  ellipsis ellipsis-1 d-flex align-items-center">
                                {{#overdue}}<span class="badge badge-pill badge-danger order-2  p-ml-2 py-1 px-2">{{#str}} overdue, block_timeline {{/str}}</span>{{/overdue}}
                                <a href="{{url}}"
                                        title="{{name}}" class="ellipsis ellipsis-1 edw-heading-color h-semibold-5 text-decoration-none"
                                        aria-label='{{#cleanstr}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/cleanstr}}'>
                                    {{{activityname}}}</a>
                            </h6>

                        <div class="mb-0 edw-paragraph-color coursename-action">
                            {{#course.fullnamedisplay}}<span class="h-regular-6">{{{course.fullnamedisplay}}}</span> - {{/course.fullnamedisplay}}
                            {{activitystr}}
                        </div>
                    </div>
                <small class=" text-nowrap small-info-text">
                    {{#userdate}} {{timesort}}, {{#str}} strftimetime24, core_langconfig {{/str}} {{/userdate}}
                </small>
                </div>

                {{#action.actionable}}
                <div class="d-flex timeline-action-button">
                    <h6 class="event-action">
                        <a class="list-group-item-action btn btn-secondary btn-sm bg-transparent text-nowrap"
                            href="{{action.url}}"
                            aria-label="{{action.name}}"
                            title="{{action.name}}">
                        {{{action.name}}}
                        {{#action.showitemcount}}
                        <span class="badge badge-secondary">{{action.itemcount}}</span>
                        {{/action.showitemcount}}
                        </a>
                    </h6>
                </div>
                {{/action.actionable}}
            </div>
        </div>
    </div>
</div>
