{{!
    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_deft/venue_manager

    This template renders the main venue window page

    Example context (json):
    {
        "autogaincontrol": true,
        "contextid": 2,
        "echocancellation": true,
        "full": true,
        "iceservers": "[]",
        "intro": "Hello world",
        "noisesuppression": true,
        "peerid": 109,
        "peers": "[105, 106]",
        "roomid": 3,
        "samplerate": 11025,
        "server": "wss://deftly.us/janus/ws",
        "title": "Venue",
        "throttle": 100,
        "uniqueid": "eworio",
        "user": {
        }
    }
}}
<div id="block-deft-{{uniqid}}" class="block-deft block-cards" data-task="{{ taskid }}" data-region="deft-venue" data-roomid="{{ roomid }}">
    <div class="container-fluid">
        <div class="row">
            {{^ peerid }}
            <div class="card col col-12 text-center p-3">
                <div class="card-body">
                {{# str }} venueclosed, block_deft {{/ str }}
                </div>
            </div>
            {{/ peerid }}
            {{# peerid }}
            {{# user }}
                {{# full }}
                <div class="card col col-12 text-center p-3">
                    <div class="card-body">
                        <h4 class="card-title">{{ title }}</h4>
                        <div class="card-text">{{{ intro }}}</div>
                    </div>
                </div>
                {{/ full }}
                {{{ media }}}
                <div class="card {{^ full }}border-0 {{/ full}}col col-12 p-0" data-peerid={{ peerid }}>
                    <div class="card-body {{^ full }}border-0 {{/ full}}p-0">
                        {{# full }}
                        <div class="card-head text-center">
                    {{# picture }}
                        <img src="{{ pictureurl }}" class="card-img-top img-fluid rounded-circle">
                    {{/ picture }}
                    {{^ picture }}
                        {{{ avatar }}}
                    {{/ picture }}
                            <h5 class="text-center">
                                {{ fullname }}
                            </h5>
                            {{> block_deft/volume_indicator }}
                        </div>
                        {{/ full }}
                        <div class="card-footer {{^ full }}border-0 {{/ full}}p-0">
                        <p class="text-center h3 p-0  m-1">
                            {{# sharevideo }}
                                <a href="#" class="btn btn-secondary card-link m-0 p-1" data-action="publish" data-type="camera" data-roomid="{{ roomid }}" data-contextid="{{ contextid }}" title="{{# str }} sharevideo, block_deft {{/ str }}">
                                    <i class="icon fa fa-camera bg-secondary rounded-circle m-0 p-2"></i>
                                </a>
                                <a href="#" class="btn btn-secondary card-link m-0 p-1 hidden" data-action="unpublish" data-roomid="{{ roomid }}" data-contextid="{{ contextid }}" title="{{# str }} stopvideo, block_deft {{/ str }}">
                                    <i class="icon fa fa-stop bg-danger rounded-circle m-0 p-2"></i>
                                </a>
                                {{# sharedisplay }}
                                <a href="#" class="btn btn-secondary card-link m-0 p-1" data-action="publish" data-type="display" data-roomid="{{ roomid }}" data-contextid="{{ contextid }}" title="{{# str }} sharevideo, block_deft {{/ str }}">
                                    <i class="icon fa fa-television bg-secondary rounded-circle m-0 p-2"></i>
                                </a>
                                {{/ sharedisplay }}
                            {{/ sharevideo }}
                            {{# full }}
                                <a href="#" class="btn btn-secondary card-link m-0 p-1" data-action="mute" title="{{# str }} mute, block_deft {{/ str }}"><i class="icon fa fa-microphone bg-secondary rounded-circle m-0 p-2"></i></a><a href="#" class="btn btn-secondary card-link hidden m-0 p-1" data-action="unmute" title="{{# str }} unmute, block_deft {{/ str }}"><i class="icon fa fa-microphone-slash bg-warning rounded-circle m-0 p-2"></i></a>
                                <a href="#" class="btn btn-secondary card-link m-0 p-1" data-action="raisehand" title="{{# str }} raisehand, block_deft {{/ str }}"><i class="icon fa fa-hand-grab-o bg-secondary rounded-circle m-0 p-2"></i></a><a href="#" class="btn btn-secondary card-link hidden m-0 p-1" data-action="lowerhand" title="{{# str }} lowerhand, block_deft {{/ str }}"><i class="icon fa fa-hand-stop-o bg-success rounded-circle m-0 p-2"></i></a>
                                <a href="#" class="btn btn-secondary card-link m-0 p-1" data-action="close" title="{{# str }} close, block_deft {{/ str }}"><i class="icon fa fa-sign-out bg-secondary rounded-circle m-0 p-2"></i></a>
                            {{/ full }}
                        </p>
                        </div>
                    </div>
                </div>
            {{/ user }}
            {{/ peerid }}
        </div>
        <div id="deft_audio" class="row p-0"></div>
        <div id="room" class="hidden">
            <audio class="rounded centered" id="roomaudio" autoplay></audio>
        </div>
    </div>
</div>
