{{!
    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 mod_videotime/text_tab

    This template for text track tab

    Variables optional for this template:
    * textracks - array of available tracks
    * showselect - boolean whether to show language selector

    Example context (json):
    {
        "showselector": true,
        "texttracks": [
            {
                "lang": "en",
                "langname": "English",
                "kind": "captions",
                "show": true,
                "label": "Information",
                "captions": [
                     {
                          "starttime": "00:05.00",
                          "starttimedisplay": "00:05",
                          "lines": [
                              {"text": "Hello world"}
                          ]
                     }
                ]
            }
        ]
    }

}}
<div class="videotimetab_textrack_content">
    {{# showselector }}
    <form class="videotimetab_texttrack_selectlang">
    <label>
    {{# str }} language, core {{/ str }}
        <select name="lang" class="custom-select text-track-lang">
        {{# texttracks }}
            <option value="{{ lang }}">{{ langname }}</option>
        {{/ texttracks }}
        </select>
    </label>
    </form>
    {{/ showselector }}
    <div class="texttracks">
    {{# texttracks }}
        {{# captions }}
        <div class="row texttracks"{{^ show }} style="display: none;"{{/ show }} data-lang="{{ lang}}">
            <div class="col-3" style="max-width: 100px;">
                <a href="#" data-action="cue" data-start="{{ starttime }}">{{starttimedisplay}}</a>
            </div>
            <div class="col-9">
                {{# lines }}
                <div>{{ text }}</div>
                {{/ lines }}
            </div>
        </div>
        {{/ captions }}
    {{/ texttracks }}
    </div>
</div>
{{# js }}
    require(['videotimetab_texttrack/selecttrack'], function(SelectTrack) {
        SelectTrack.initialize();
    });
{{/ js }}
