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

    This template renders tasks in the content for the deft response block.

    Example context (json):
    {
        "title": "Deft response",
        "uniqueid": "lafUeOQr32KKJ",
        "tasks": [
        ]
    }
}}
%>
<div id="deft-view-<%uniqid%>"
    data-region="deft-view"
>
<ion-label><h5><% title %></h5></ion-label>
    <div data-region="deft-view-content">
        <ion-list>
        <%# tasks %>
            <ion-item data-task="<% id %>">
            <ion-label>
                <%# choice %> <%> block_deft/mobile_choice %> <%/ choice %>
                <%# comments %>
                    <h5><% name %></h5>
                        <ion-button expand="block" color="light" core-site-plugins-new-content title="<% label %>"
                            component="block_deft" method="mobile_comments_view" [args]="{task: <% id %>}">
                            <% label %> (<% count %>)
                        </ion-button>
                <%/ comments %>
                <%# text %> <%> block_deft/mobile_text %> <%/ text %>
                <%# venue %>
                    <ion-label><h5><% name %></h5></ion-label>
                    <%# content %>
                        <ion-item class="block_deft_text p-3">
                            <ion-label>
                                <div class="ion-text-wrap"><%{ content }%></div>
                            </ion-label>
                        </ion-item>
                    <%/ content %>
                    <%# mixed %>
                    <ion-button expand="block" core-site-plugins-new-content title="<% name %>"
                        [args]="{task: <% id %>, uuid: this.Device.uuid}"
                        component="block_deft"
                        method="mobile_venue_view"
                        [preSets]="{getFromCache: false, saveToCache: false, reusePending: false}"
                    >
                        <ion-label>
                        {{ 'plugin.block_deft.join' | translate }} (<% count %>)
                        </ion-label>
                        <ion-icon name="enter-outline" slot="start"></ion-icon>
                    </ion-button>
                    <%/ mixed %>
                    <%^ mixed %>
                    <ion-button expand="block" href="<% url %>" data-open-in="browser" target="_blank" class="card-link m-0" data-action="join" title="{{ 'plugin.block_deft.join' | translate }}">
                        {{ 'plugin.block_deft.join' | translate }} (<% count %>)
                        <ion-icon name="enter-outline" slot="start"></ion-icon>
                    </ion-button>
                    <%/ mixed %>
                <%/ venue %>
            </ion-label>
            </ion-item>
        <%/ tasks %>
        </ion-list>
    </div>
</div>
