{{!
    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_minilesson/lessonbanklistitem

    TODO describe template lessonbanklistitem

    Example context (json):
    {
    }
}}
<table class="table table-bordered table-striped listtable">
    <thead>
        <tr>
            <th></th>
            <th>{{#str}}title, mod_minilesson{{/str}}</th>
            <th class="langcolumn">{{#str}}targetlang, mod_minilesson{{/str}}</th>
            <th class="levelcolumn">{{#str}}level, mod_minilesson{{/str}}</th>
            <th class="keywordcolumn">{{#str}}keyword, mod_minilesson{{/str}}</th>
            <th class="listdescription">{{#str}}description{{/str}}</th>
            <th>{{#str}}items, mod_minilesson{{/str}}</th>
            <th>{{#str}}actions{{/str}}</th>
        </tr>
    </thead>
    <tbody>
    {{#lessonitems}}
        <tr>
            <td class="imgcolumn"><img src="{{posterimage}}" alt="{{name}}" class="searchimg img-responsive"></td>
            <td>{{name}}</td>
            <td class="langcolumn">{{language}}</td>
            <td class="levelcolumn">{{languagelevel}}</td>
            <td class="keywordcolumn"></b>{{keywords}}</p></td>
            <td>
                <p data-text={{#quote}}{{{description}}}{{/quote}}>
                    <b class="mr-2">{{#str}}descriptioncolon, mod_minilesson{{/str}}</b>
                    {{#shortentext}} 150, {{{description}}} {{/shortentext}}
                </p>
            </td>
            <td>{{itemcount}}</td>
            <td>
                {{#nativelanguage}}
                    <a data-translateimportid="{{id}}" data-sourcelanguage="{{{nativelanguage}}}" data-action="translate" class="btn btn-primary text-white rounded ml-auto">
                        {{#str}}translatetoimport, mod_minilesson{{/str}}
                    </a>
                {{/nativelanguage}}
                <a data-id="{{id}}" data-action="download" data-download="{{name}}" class="btn btn-primary text-white rounded ml-auto importlessonitembtn">
                    {{#str}}import{{/str}}
                </a>
            </td>
        </tr>
    {{/lessonitems}}
    {{^lessonitems}}
        <tr>
            <td colspan="7">
                <p class="bg-secondary p-3 text-center w-100"><span>{{#str}}nolessonitemfound, mod_minilesson{{/str}}</span></p>
            </td>
        </tr>
    {{/lessonitems}}
    </tbody>
</table>