{{!
    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 videotimetab_chat/main

    This template renders the main content area for the deft choice block.

    Example context (json):
    {
        "contextid": 2,
        "uniqid": "eworio",
        "token": "dladfjlakerlaa3j4lr",
        "throttle": 100,
        "instanceid": 100
    }
}}

<div id="videotimetab-chat-{{uniqid}}" class="block-cards" data-type="comments">
    <div class="container-fluid p-0" data-component="videotimetab_chat">
        {{{ comments }}}
    </div>
    <textarea data-type="content" class="form-control"></textarea>
    <a href="#" class="card-link float-right" data-action="addcomment" title="{{# str }} addcomment {{/ str }}">{{# str }} send, core_message {{/ str}}</a>
</div>
{{#js}}
    require(['videotimetab_chat/comment', 'videotimetab_chat/refresh'], function(Comment, Refresh) {
        new Refresh({{ contextid }}, '#videotimetab-chat-{{uniqid}} [data-region="deft-view"]', '{{ token }}', {{ throttle }});
        Comment.init({{ contextid }}, '#videotimetab-chat-{{uniqid}}', {{ instanceid }});
    });
{{/js}}
