{{!
    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 tiny_media/embed_media_modal

    Embed media modal template.

    Example context (json):
    {

    }
}}
{{< core/modal }}

    {{$title}}
        {{#str}} modaltitle, tiny_h5p {{/str}}
    {{/title}}

    {{$body}}
        <form class="tiny_media_form" id="{{elementid}}_tiny_media_form">
            <ul class="root nav nav-tabs mb-1" role="tablist">
                <li data-medium-type="link" class="nav-item">
                    <a class="nav-link {{# link }}active{{/ link }}" href="#{{elementid}}_link" role="tab" data-toggle="tab">
                        {{#str}} link, tiny_media {{/str}}
                    </a>
                </li>
                <li data-medium-type="video" class="nav-item">
                    <a class="nav-link {{# video }}active{{/ video }}" href="#{{elementid}}_video" role="tab" data-toggle="tab">
                        {{#str}} video, tiny_media {{/str}}
                    </a>
                </li>
                <li data-medium-type="audio" class="nav-item">
                    <a class="nav-link {{# audio }}active{{/ audio }}" href="#{{elementid}}_audio" role="tab" data-toggle="tab">
                        {{#str}} audio, tiny_media {{/str}}
                    </a>
                </li>
            </ul>
            <div class="root tab-content">
                <div data-medium-type="link" class="tab-pane {{# link }}active{{/ link }}" id="{{elementid}}_link">
                    {{> tiny_media/embed_media_modal_link }}
                </div>
                <div data-medium-type="video" class="tab-pane {{# video }}active{{/ video }}" id="{{elementid}}_video">
                    {{> tiny_media/embed_media_modal_video}}
                </div>
                <div data-medium-type="audio" class="tab-pane {{# audio }}active{{/ audio }}" id="{{elementid}}_audio">
                    {{> tiny_media/embed_media_modal_audio}}
                </div>
            </div>
        </form>
    {{/body}}

    {{$footer}}
        <button type="button" class="btn btn-primary" data-action="save">
            {{#isupdating}}
                {{#str}} updatemedia, tiny_media {{/str}}
            {{/isupdating}}
            {{^isupdating}}
                {{#str}} createmedia, tiny_media {{/str}}
            {{/isupdating}}
        </button>
        <button type="button" class="btn btn-secondary" data-action="cancel">{{#str}} cancel, moodle {{/str}}</button>
    {{/footer}}

{{/ core/modal }}
