{{!
    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/publicview

    Example context (json):
    {
      "code": true,
      "urlcode": "https://example.com/validate?code=ABC123",
      "code": "ABC123",
      "date": "2024-09-03",
      "username": "joaosilva",
      "name": "João Silva",
      "course": "Curso de Programação Avançada"
    }

}}

{{#code}}
    <table class="table table-striped">
        <tr>
            <th>{{#str}}validate_certificate_code,certificatebeautiful{{/str}}</th>
            <td><a href="{{{urlcode}}}" target="_blank">{{{code}}}</a></td>
        </tr>
        <tr>
            <th>{{#str}}validate_certificate_date,certificatebeautiful{{/str}}</th>
            <td>{{{date}}}</td>
        </tr>
        {{#username}}
            <tr>
                <th>{{#str}}validate_certificate_user,certificatebeautiful{{/str}}</th>
                <td>{{{username}}}</td>
            </tr>
        {{/username}}
        {{#useremail}}
            <tr>
                <th>{{#str}}email{{/str}}</th>
                <td>{{{useremail}}}</td>
            </tr>
        {{/useremail}}
        {{#name}}
            <tr>
                <th>{{#str}}validate_certificate_name,certificatebeautiful{{/str}}</th>
                <td>{{{name}}}</td>
            </tr>
        {{/name}}
        {{#course}}
            <tr>
                <th>{{#str}}validate_certificate_course,certificatebeautiful{{/str}}</th>
                <td>{{{course}}}</td>
            </tr>
        {{/course}}
    </table>
{{/code}}

{{^code}}
    {{> core/notification_error}}
{{/code}}