{{!
    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 contenttype_repurpose/previewquestion

    This template renders the link for question preview and adds listener

    Example context (json):
    {
        "url": "https://moodle.org/pluginfile.php/contenttype_repurpose/content/530/content/image/image-238972974911.png"
    }
}}
<div class="row">
{{# path }}
<div class="col col-md-3">
    <div class="card">
        <img class="card-img-top" src="@@PLUGINFILE@@/content/{{ path }}" alt="{{ title }}">
        <div class="card-body">
            <h5 class="card-title">{{ title }}</h5>
            <a href="#" data-action="edit"><i class="icon fa fa-cog"></i></a>
            <a href="#" data-action="delete"><i class="icon fa fa-trash"></i></a>
        </div>
    </div>
</div>
{{/ path }}
{{# media }}
<div class="col col-md-3">
    <div class="card">
        {{# image }}
            <img class="card-img-top" src="@@PLUGINFILE@@/content/{{ params.file.path }}" alt="{{ metadata.title }}">
        {{/ image }}
        {{# audio }}
            <audio controls class="card-img-top">
                 {{# params.files }}
                 <source src="@@PLUGINFILE@@/content/{{ path }}" type="{{ mime }}" alt="{{ metadata.title }}">
                 {{/ params.files }}
            </audio>
        {{/ audio }}
        {{# video }}
            <video controls class="card-img-top">
                 {{# params.sources }}
                 <source src="@@PLUGINFILE@@/content/{{ path }}" type="{{ mime }}" alt="{{ metadata.title }}">
                 {{/ params.sources }}
            </video>
        {{/ video }}
        <div class="card-body">
            <h5 class="card-title">{{ metadata.title }}</h5>
            <a href="#" data-action="edit"><i class="icon fa fa-cog"></i></a>
            <a href="#" data-action="delete"><i class="icon fa fa-trash"></i></a>
            {{^ first }}<a href="#" data-action="left"><i class="icon fa fa-arrow-left"></i></a>{{/ first }}
            {{^ last }}<a href="#" data-action="right"><i class="icon fa fa-arrow-right"></i></a>{{/ last }}
        </div>
    </div>
</div>
{{/ media }}
</div>
