{{!
    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 format_thinkera/livepanel

    The live sessions of a course: what is scheduled, what was recorded, and the two actions (ask for a session,
    or open a new one). It used to sit in a sidebar; it now lives inside the course page's sessions panel, so the
    lessons keep the full width of the page.

    Example context (json):
    {
        "liveurl": "#", "haslivesessions": false, "livesessions": [],
        "hasliverecordings": true,
        "liverecordings": [{"day": "12", "month": "Sep", "name": "Unit 1 revision", "when": "Sunday 7pm",
            "minutes": 45, "parts": 12, "private": false, "sessionurl": "#", "watchurl": "#"}],
        "liverequesturl": "#", "livenewurl": ""
    }
}}
<section class="tkc-live" aria-labelledby="tkc-live-title">
    <div class="tkc-live-head">
        <h2 class="tkc-h2" id="tkc-live-title">{{#str}}live_title, local_thinkera{{/str}}</h2>
        <a href="{{liveurl}}">{{#str}}teach_all, local_thinkera{{/str}}</a>
    </div>
    {{#haslivesessions}}<ul class="tkv-list">{{#livesessions}}{{> local_thinkera/live_card }}{{/livesessions}}</ul>{{/haslivesessions}}
    {{^haslivesessions}}<p class="tkc-live-none">{{#livenewurl}}{{#str}}live_none_teacher, local_thinkera{{/str}}{{/livenewurl}}{{^livenewurl}}{{#str}}live_none_student, local_thinkera{{/str}}{{/livenewurl}}</p>{{/haslivesessions}}
    {{#hasliverecordings}}
    <h3 class="tkc-rec-title">{{#str}}live_course_recordings, local_thinkera{{/str}}</h3>
    <ul class="tkc-recs">
        {{#liverecordings}}
        <li class="tkc-rec">
            <span class="tkc-rec-date" aria-hidden="true"><b>{{day}}</b>{{month}}</span>
            <span class="tkc-rec-body">
                <a class="tkc-rec-name" href="{{sessionurl}}">{{name}}</a>
                <span class="tkc-rec-meta">{{when}}{{#minutes}} · {{#str}}live_minutes, local_thinkera, {{minutes}}{{/str}}{{/minutes}}{{#parts}} · {{#str}}live_rec_parts, local_thinkera, {{parts}}{{/str}}{{/parts}}{{#private}} · {{#str}}live_private_you, local_thinkera{{/str}}{{/private}}</span>
            </span>
            <a class="tkc-rec-play" href="{{watchurl}}" title="{{#str}}live_watch, local_thinkera{{/str}}"><svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="9.5"/><path d="m10 8.5 5.5 3.5-5.5 3.5z" fill="currentColor"/></svg><span class="visually-hidden">{{#str}}live_watch, local_thinkera{{/str}}: {{name}}</span></a>
        </li>
        {{/liverecordings}}
    </ul>
    {{/hasliverecordings}}
    <div class="tkc-live-actions">
        {{#liverequesturl}}<a class="tk-btn tk-btn-ghost" href="{{liverequesturl}}">{{#str}}request_ask, local_thinkera{{/str}}</a>{{/liverequesturl}}
        {{#livenewurl}}<a class="tk-btn tk-btn-ghost" href="{{livenewurl}}">{{#str}}live_new, local_thinkera{{/str}}</a>{{/livenewurl}}
    </div>
</section>
