{{=<% %>=}}
<%!
    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/mobile_venue

    This template renders the view for the venue task

    Example context (json):
    {
        "name": "Welcome",
        "intro": "hello",
        "mute": true,
        "task": 17
    }
}}
%>
<ion-list>
    <ion-list-header>
        <ion-label>
            <% name %>
        </ion-label>
    </ion-list-header>
    <%# intro %>
        <ion-item>
            <ion-label>
                <core-format-text text="<% intro %>" component="block_deft" componentId="<% task %>"></core-format-text>
            </ion-label>
        </ion-item>
    <%/ intro %>
    <audio id="roomaudio" autoplay style="display: none;"></audio>
    <ion-item>
        <video id="roomvideo" autoplay style="width: 100%; display: none;"></video>
    </ion-item>
    <core-navbar-buttons slot="start">
    <ion-button
        class="card-link m-0"
        core-site-plugins-call-ws
        data-action="mute"
        (onSuccess)="DeftVenue.switchMute(true);"
        name="block_deft_venue_settings"
        [params]="{mute: true, status: false, uuid: this.Device.uuid}"
        [preSets]="{getFromCache: 0, saveToCache: 0}"
        <%# mute %>
            style="display: none;"
        <%/ mute %>
        title="{{ 'plugin.block_deft.mute' | translate }}"
    >
        <ion-icon name="mic-outline"></ion-icon>
    </ion-button>
    <ion-button
        core-site-plugins-call-ws
        successMessage="{{ 'plugin.block_deft.microphoneon' | translate }}"
        class="card-link m-0 p-0 rounded-circle"
        data-action="unmute"
        (onSuccess)="DeftVenue.switchMute(false);"
        name="block_deft_venue_settings"
        [params]="{mute: false, status: false, uuid: this.Device.uuid}"
        [preSets]="{getFromCache: 0, saveToCache: 0}"
        <%^ mute %>
            style="display: none;"
        <%/ mute %>
        title="{{ 'plugin.block_deft.unmute' | translate }}"
    >
        <ion-icon color="warning" name="mic-off-circle-outline"></ion-icon>
    </ion-button>
    </core-navbar-buttons>
    <core-navbar-buttons slot="end">
    <ion-button
        class="card-link m-0"
        data-action="raisehand"
        core-site-plugins-call-ws
        name="block_deft_raise_hand"
        (onSuccess)="DeftVenue.raiseHand(true);"
        [params]="{status: true, uuid: this.Device.uuid}"
        [preSets]="{getFromCache: 0, saveToCache: 0}"
        title="{{ 'plugin.block_deft.raisehand' | translate }}">
        <ion-icon name="hand-left-outline" data-role="mute"></ion-icon>
    </ion-button>
    <ion-button
        class="card-link m-0"
        core-site-plugins-call-ws
        data-action="lowerhand"
        name="block_deft_raise_hand"
        (onSuccess)="DeftVenue.raiseHand(false);"
        [preSets]="{getFromCache: 0, saveToCache: 0}"
        style="display: none;"
        [params]="{status: false, uuid: this.Device.uuid}"
        [preSets]="{getFromCache: 0, saveToCache: 0}"
        title="{{ 'plugin.block_deft.lowerhand' | translate }}"
    >
        <ion-icon color="success" name="hand-left"></ion-icon>
    </ion-button>
    <ion-button
        data-action="pause"
        title="{{ 'plugin.block_deft.lowerhand' | translate }}"
    >
        <ion-icon color="success" name="pause-outline"></ion-icon>
    </ion-button>
    <ion-button
        data-action="start"
        style="display: none;"
        title="{{ 'plugin.block_deft.lowerhand' | translate }}"
    >
        <ion-icon color="danger" name="desktop-outline"></ion-icon>
    </ion-button>
    </core-navbar-buttons>
    <ion-item>
        <ion-chip color="light" slot="start">
            <ion-icon name="people-outline"></ion-icon>
            <ion-label id="guests">1</ion-label>
        </ion-chip>
        <ion-label>
            {{ 'plugin.block_deft.guests' | translate }}
        </ion-label>
        <ion-chip color="success" style="opacity: 0;" slot="end">
            <ion-icon name="hand-left-outline"></ion-icon>
            <ion-label id="hands">0</ion-label>
        </ion-chip>
    </ion-item>
    <ion-item>
        <ion-list id="participants">
        </ion-list>
    </ion-item>
</ion-list>
