{% 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 Etiqueta') }}</title>

        {{ current_theme.local_style() }}
        <!-- Custom styles for this template -->
        <link href="{{ url_for('static', filename='css/form-validation') }}" rel="stylesheet" />
    </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 etiqueta') }}.</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="nombre" class="form-label">{{ _('Etiqueta') }}</label>
                            {{ form.nombre(class="form-control", id="nombre", placeholder=_('Etiqueta')) }} {{
                            render_field_errors(form.nombre) }}
                        </div>

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

                    <br />
                    <a href="/tags" class="w-10 btn btn-lg btn-danger btn-block" type="submit">{{ _('Cancelar') }}</a>
                    <button class="w-10 btn btn-lg btn-primary btn-block" type="submit">{{ _('Editar Etiqueta') }}</button>
                </form>
            </div>
        </main>
    </body>
</html>
