{% extends 'base.html.twig' %}

{% block title %}Settings{% endblock %}

{% block content %}
    <section class="section-settings">
        {% for label, messages in app.flashes %}
            {% for message in messages %}
                <div class="flashbang flashbang-{{ label }}">
                    {{ message }}
                </div>
            {% endfor %}
        {% endfor %}

        <form action="" method="POST" class="settings-box">
            <div class="settings-title">General</div>
            <div class="settings-item">
                <div class="settings-label">Email</div>
                <div class="settings-input">
                    <input type="email" name="email" value="{{ my.email }}" required />
                </div>
            </div>
            <div class="settings-item">
                <div class="settings-label">Username</div>
                <div class="settings-input">
                    <input type="text" name="username" value="{{ my.username }}" required />
                </div>
            </div>
            <div class="settings-save">
                <button>Save</button>
            </div>

            <input type="hidden" name="save" value="general" />
        </form>
        <form action="" method="POST" class="settings-box">
            <div class="settings-title">Login</div>
            <div class="settings-item">
                <div class="settings-label">New password</div>
                <div class="settings-input">
                    <input type="password" name="newPassword" value="" required />
                </div>
            </div>
            <div class="settings-item">
                <div class="settings-label">New password (again)</div>
                <div class="settings-input">
                    <input type="password" name="newPasswordAgain" value="" required />
                </div>
            </div>
            <div class="settings-save">
                <button>Save</button>
            </div>
            
            <input type="hidden" name="save" value="login" />
        </form>
    </section>
{% endblock %}

{% block styles %}
    <link rel="stylesheet" href="{{ asset('assets/css/settings.css') }}" />
{% endblock %}