{{!
    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 core_calendar/event_details

    Calendar event details.

    The purpose of this template is to render the event details.

    This template is used in the summary modal, day and upcoming views to output event information consistently
    across the calendar.

    Classes required for JS:
    * none

    Data attributes required for JS:
    * none

    Example context (json):
    {
        "formattedtime": "Wednesday, 17 April, 9:27 AM",
        "normalisedeventtype": "Group",
        "normalisedeventtypetext": "Group event",
        "description": "An random event description",
        "location": "Moodle HQ",
        "isactionevent": "true",
        "course": {
            "viewurl": "http://mymoodlesite/course/view.php?id=1",
            "fullname": "Course name"
        },
        "source": "Ical imported",
        "groupname": "Group 1",
        "iscategoryevent": "true",
        "category": {
            "nestedname": "Category name"
        },
        "iscourseevent": "true",
        "groupname": "Group name",
        "subscription": "true",
        "displayeventsource": "true",
        "subscriptionname": "Subscription name",
        "subscriptionurl": "http://subscriptionurl"
    }
}}
<div class="modal-cal-time mb-1 pb-3">
    {{{formattedtime}}}
</div>
{{#description}}
    <div class="modal-cal-desc d-inline-flex align-items-start py-4 mb-4">
        <div class="description-content ml-2">{{{.}}}</div>
    </div>
{{/description}}
{{#location}}
    <div class="modal-cal-location w-100 mb-1">
        <div class="badge badge-light">{{#pix}} i/location, core, {{#str}} location {{/str}} {{/pix}} {{{.}}}</div>
    </div>
{{/location}}
{{#iscategoryevent}}
    <div class="modal-cal-cat w-100 mb-1">
        <div class="badge badge-info badge-link">{{#pix}} i/categoryevent, core, {{#str}} category {{/str}} {{/pix}} {{{category.nestedname}}}</div>
    </div>
{{/iscategoryevent}}
{{#course.viewurl}}
    <div class="modal-cal-course w-100 mb-1">
        <a href="{{course.viewurl}}" class="badge badge-link badge-success">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}<span class="ml-2">{{{course.fullname}}}</span></a></>
    </div>
{{/course.viewurl}}
{{#groupname}}
    <div class="modal-cal-gr d-inline-flex align-items-center w-100 mb-2">
        <div class="mr-3 ml-1">{{#pix}} i/groupevent, core, {{#str}} group {{/str}} {{/pix}}</div>
        <div>{{{groupname}}}</div>
    </div>
{{/groupname}}
{{#normalisedeventtypetext}}
    <div class="modal-cal-event d-inline-flex align-items-center w-100 pb-2">
        <div class="badge badge-light">{{#pix}} i/calendar, core, {{#str}} eventtype, core_calendar {{/str}} {{/pix}} {{normalisedeventtypetext}}</div>
    </div>
{{/normalisedeventtypetext}}
{{#subscription}}
    {{#displayeventsource}}
        <div class="d-inline-flex align-items-center w-100 mb-2">
            <div class="badge badge-secondary">
                {{#pix}} i/rss, core, {{#str}} eventsource, core_calendar {{/str}} {{/pix}}
                {{#subscriptionurl}}
                    <span><a href="{{subscriptionurl}}">{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</a></span>
                {{/subscriptionurl}}
                {{^subscriptionurl}}
                    <span>{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</span>
                {{/subscriptionurl}}
            </div>
        </div>
    {{/displayeventsource}}
{{/subscription}}
