{% set current_theme = current_theme() %} {% from "macros/form_errors.j2" import render_field_errors, render_form_errors %}

<!doctype html>
<html lang="{{ current_locale() }}" class="h-100">
    <head>
        {{ current_theme.headertags() }}
        <title>{{ _('Editar Plantilla de Certicado') }}.</title>

        {{ current_theme.local_style() }}
    </head>

    <body>
        {{ current_theme.navbar() }}

        <main>
            {{ current_theme.notify() }}

            <div class="container px-4 py-5" id="icon-grid">
                <h4 class="pb-2 border-bottom">{{ _('Editar Certificado') }}.</h4>
                <form method="post" enctype="multipart/form-data">
                    {{ form.csrf_token }} {{ render_form_errors(form) }}
                    <div class="row g-3">
                        <div class="col-sm-6">
                            <label for="titulo" class="form-label">{{ _('Certificado') }}</label>
                            {{ form.titulo(class="form-control", id="titulo", placeholder=_('Certificado')) }} {{
                            render_field_errors(form.titulo) }}
                        </div>

                        <div class="col-sm-6">
                            <label for="descripcion" class="form-label">{{ _('Descripcion') }}</label>
                            {{ form.descripcion(class="form-control", id="descripcion", placeholder=_('Descripcion')) }} {{
                            render_field_errors(form.descripcion) }}
                        </div>
                    </div>

                    <div class="row g-3">
                        <div class="col-sm-6">
                            <br />
                            <label for="habilitado" class="form-label">{{ _('Habilitado') }}</label>
                            {{ form.habilitado() }} {{ render_field_errors(form.habilitado) }}
                        </div>

                        <div class="col-sm-6">
                            <br />
                            <label for="publico" class="form-label">{{ _('Publico') }}</label>
                            {{ form.publico() }} {{ render_field_errors(form.publico) }}
                        </div>
                    </div>
                    <div class="row g-3">
                        <div class="col-sm-6">
                            <label for="tipo" class="form-label">{{ _('Tipo de Certificado') }}</label>
                            {{ form.tipo(class="form-control", id="tipo") }} {{ render_field_errors(form.tipo) }}
                        </div>
                    </div>
                    <div class="row g-3">
                        <label for="html" class="form-label">HTML</label>
                        {{ form.html(class="form-control", id="html", rows="15") | safe }} {{ render_field_errors(form.html)
                        }}
                    </div>
                    <div class="row g-3">
                        <br />
                        <label for="css" class="form-label">CSS</label>
                        {{ form.css(class="form-control", id="css", rows="15") | safe }} {{ render_field_errors(form.css) }}
                    </div>

                    <br />

                    <button class="w-10 btn btn-lg btn-primary btn-block" type="submit">
                        {{ _('Actualizar Certificado') }}
                    </button>
                    <a href="{{ url_for('certificate.certificados') }}" class="w-10 btn btn-lg btn-danger btn-block"
                        >{{ _('Cancelar') }}</a
                    >
                </form>
            </div>
        </main>
    </body>
</html>
