{{!
    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_elementlist

    The certificate edit layout

    Classes required for JS:
    * None

    Data attibutes required for JS:

    Context variables required for this template:

    Example context (json):
    {
        "haselements": 1,
        "elements": [
            {"name": "Element1", "type": "Type1", "id": 1},
            {"name": "Element2", "type": "Type2", "id": 2},
            {"name": "Element3", "type": "Type3", "id": 3}
        ]
    }
}}
<ul data-region="elementlist" data-id="{{id}}" class="unlist">
    {{#elements}}
        <li data-region="pageelement" data-id="{{id}}" class="mb-2 mt-2 d-flex">
            {{> core/drag_handle}}
            <span>{{{icon}}}</span>
            {{#editablename}}{{> core/inplace_editable}}{{/editablename}}

            <span class="ml-auto d-flex">
                <a class="btn btn-link p-0" data-action="editelement" href="#" data-id="{{id}}" data-name="{{displayname}}" title="{{#str}}editelement, tool_certificate, {{displayname}}{{/str}}">
                    {{#pix}} i/settings, core {{/pix}}
                </a>
                <a class="btn btn-link p-0" data-action="deleteelement" href="#" data-id="{{id}}" data-name="{{displayname}}" title="{{#str}}deleteelement, tool_certificate{{/str}}">
                    {{#pix}} i/trash, core {{/pix}}
                </a>
            </span>
        </li>
    {{/elements}}
</ul>