{{!
    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 core_h5p/h5perror

    This template will render the embed code shown in the H5P content embed popup.

    Note: this mustache is part of the H5P player and requires '/h5p/js/embed.js' already loaded.

    Variables required for this template:
    * h5picon - The icon
    * message - The error messages to display.

    Example context (json):
    {
        "embedurl": "http://example.com/h5p/embed.php?url=testurl"
    }

}}

<div class="d-flex h-100 position-relative align-items-center bg-light h5pmessages">
   <div class="position-absolute py-2 bg-secondary" style="top: 0px; left: 0px; right: 0px;">
      <div class="container">
        {{#h5picon}}
         <img src="{{{.}}}" class="h5picon" alt="{{#str}}h5p, core_h5p{{/str}}" style="width: 50px; height: auto; opacity: 0.5">
        {{/h5picon}}
      </div>
   </div>
   <div class="container mt-5">
      {{#exception}}
      <div class="alert alert-block fade in alert-danger my-2" role="alert">
         {{{ exception }}}
      </div>
      {{/exception}}
      {{#info}}
      <div class="alert alert-block fade in alert-info my-2" role="alert">
         {{{ . }}}
      </div>
      {{/info}}
      {{#error}}
      <div class="alert alert-block fade in alert-warning my-2" role="alert">
         {{#code}}{{{code}}} : {{/code}}{{{ message }}}
      </div>
      {{/error}}
   </div>
</div>
{{#js}}
(function() {
    if (typeof H5PEmbedCommunicator !== 'undefined') {
        H5PEmbedCommunicator.send('resize', {
            scrollHeight: document.body.scrollHeight
        });
    }
})();
{{/js}}
