{{!
    This file is part of the tool_certificate plugin for 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 tool_certificate/edit_layout

    The certificate edit layout

    Classes required for JS:
    * None

    Data attibutes required for JS:

    Context variables required for this template:

    Example context (json):
    {
        "pages": [
            {"id": 1, "title": "Page 1"},
            {
                "id": 2,
                "title": "Page 2",
                "editlabel": "Edit",
                "deletelabel": "Delete",
                "pagelayout": "Page layout editor",
                "haselements": 1,
                "elements": [
                    {"name": "Element1", "type": "Type1", "id": 1},
                    {"name": "Element2", "type": "Type2", "id": 2},
                    {"name": "Element3", "type": "Type3", "id": 3}
                ]
            },
            {"id": 3, "title": "Page 3"},
            {"id": 4, "title": "Page 4"}
        ]
    }
}}
{{> tool_certificate/content_heading }}
<div class="mt-4" data-region="template" data-id="{{id}}">
{{#pages}}
    {{> tool_certificate/edit_layout_page}}
{{/pages}}
</div>
{{#js}}
    require(['tool_certificate/template-edit'],
        function(T) {
            T.init();
        }
    );
{{/js}}
