<!doctype html>
<html lang="{{ get_locale() }}" class="h-100">
    {% set current_theme = current_theme() %} {% from "macros/form_buttons.j2" import render_form_buttons %} {% from
    "macros/form_errors.j2" import render_field_errors, render_form_errors %}

    <head>
        {{ current_theme.headertags() }} {{ mde.css }}
        <title>{{_("Editar apariencia del sitio web")}}</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 apariencia del sitio web")}}.</h4>
                <form method="post" enctype="multipart/form-data">
                    <div class="row">
                        <h4>{{_("Logo y Favicon del sitio web")}}.</h4>
                        <div class="col-sm-6">
                            {% if logo_personalizado() and site_logo() %}
                            <div>
                                <img
                                    src="{{ url_for('static', filename='/files/public/images/' + site_logo() ) }}"
                                    alt="NOW LMS"
                                />
                            </div>
                            <a href="{{ url_for('setting.elimina_logo') }}">{{_("Eliminar Logo actual")}}</a>
                            {% else %}
                            <label for="logo" class="form-label">{{_("Logotipo")}}</label>
                            <input
                                type="file"
                                name="logo"
                                class="form-control"
                                accept="image/jpeg, image/png, image/gif, image/webp, image/bmp, image/svg+xml"
                            />
                            {% endif %}
                        </div>
                        <div class="col-sm-6">
                            {% if favicon_personalizado() and site_favicon() %}
                            <div>
                                <img
                                    src="{{ url_for('static', filename='/files/public/images/' + site_favicon() ) }}"
                                    alt="NOW LMS Favicon"
                                />
                            </div>
                            {% else %}
                            <label for="favicon" class="form-label">{{_("Favicon")}}</label>
                            <input type="file" name="favicon" class="form-control" accept="image/png" />
                            {% endif %}
                        </div>
                    </div>
                    <br />
                    <div class="row">
                        <h4>{{_("Tema del sitio web")}}.</h4>
                        <div class="col-sm-6">
                            <label for="style" class="form-label">{{_("Tema")}}.</label>
                            {{ form.style(class="form-control", id="style") }} {{ render_field_errors(form.style) }}
                            <div class="form-text">{{_("Los temas cambian varios aspectos visuales del sitio web")}}.</div>
                        </div>
                    </div>
                    <br />

                    {{ render_form_buttons(_("Actualizar Tema"), url_for('admin_profile.pagina_admin')) }}
                </form>
            </div>
        </main>
    </body>
</html>
