{{!
    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 format_popups/embedfile

    Modal content for embeddeding file

    Example context (json):
    {
        "heading": "Read me",
        "url": "http://moodle.org/README.txt",
        "downloadurl": "http://moodle.org/README.txt"
    }
}}
{{# heading }}
    <h2>{{ heading }}</h2>
{{/ heading }}
{{# image }}
    <img src="{{ url }}" class="img-responsive"></img>
{{/ image }}
{{^ image }}
    <iframe src="{{ url }}"></iframe>
{{/ image }}
{{^ downloadurl }}
<form action="{{ url }}">
    {{# params }}
        <input type="hidden" name="{{ name }}" value="{{ value }}" />
    {{/ params }}
    <button class="btn btn-primary">
        {{# str }} download {{/ str }}
    </button>
    {{# returnurl }}
        <a class="btn btn-secondary" href="{{ returnurl }}">
            {{# str }} cancel {{/ str }}
        </a>
    {{/ returnurl }}
    {{^ returnurl }}
        <a class="btn btn-secondary" href="#" data-action="hide">
            {{# str }} cancel {{/ str }}
        </a>
    {{/ returnurl }}
</form>
{{/ downloadurl }}
{{# downloadurl }}
<div>
<a href="{{ downloadurl }}" class="btn btn-primary" role="button" download>{{# str }} download {{/ str }}</a>
<a href="#" class="btn btn-secondary" data-action="hide" role="button">{{# str }} cancel {{/ str }} </a>
</div>
{{/ downloadurl }}
{{# js }}
require(['format_popups/embed'], function(embed) {
    embed.init();
});
{{/ js }}
