{{!
    This file is part of Moodle - https://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_certificatebeautiful/editpage

    Example context (json):
    {
      "url-setting": "https://example.com/settings",
      "url-changemodel": "https://example.com/change-model",
      "url-changeupload": "https://example.com/change-upload",
      "iframe-url": "https://example.com/editor",
      "form_components": "<input type='text' name='example' />"
    }
}}

<div class="editpage">
<div>
    {{#str}}edit_page_instruction,certificatebeautiful{{/str}}
    <p>
        <a href="{{url-setting}}" target="_blank">{{#str}}edit_signature_certificate,certificatebeautiful{{/str}}</a>
    </p>
</div>

<div class="d-flex flex-row-reverse">
    <a href="{{url-changemodel}}" class="btn btn-primary mb-3 iconlarge float-right">
        {{#pix}}t/add, core{{/pix}}
        {{#str}}select_model_preview,certificatebeautiful{{/str}}
    </a>
    &nbsp;&nbsp;&nbsp;
    <a href="{{url-changeupload}}" class="btn btn-success mb-3 iconlarge float-right">
        {{#pix}}t/add, core{{/pix}}
        {{#str}}select_background_preview,certificatebeautiful{{/str}}
    </a>
</div>

<iframe class="certificate-editor" src="{{{iframe-url}}}"
        frameborder="0" allowfullscreen
        sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
        allow=":encrypted-media; :picture-in-picture"></iframe>

{{{form_components}}}
</div>
