{{!
    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 local_edwisersiteimporter/homepage_modal

    Homepage modal template.

    Context variables required for this template:
    * site - Site base url
    * image - Screenshot image
    * name - Template name

    Example context (json):
    {
        "site" : "http://edwiser-demo-url.org",
        "image" : "http://edwiser-demo.org/screenshot.jpg",
        "name" : "Edwiser Demo"
    }
}}
<div class="homepage-modal">
    <img src="{{image}}"/>
    <form method="post" target="_blank">
        <input type="hidden" name="site" value="{{site}}">
    </form>
</div>
{{#js}}
require(['jquery'], function($) {
    var root = '.homepage-modal';
    $(root).closest('.modal-dialog').addClass('modal-xl');
    $(root).find('iframe').on('load', function() {
        $(root).find('.loader-wrapper').hide();
    });
});
{{/js}}
