<?= $this->layout('_layout', ['title' => $title]); ?>

<main class="main">
    <?= $this->insert('includes/aside_info') ?>
    <div class="content">
        <div class="h2-title h2-title-content flex-s-c">
            <span>My Account</span>
        </div>

        <?= $this->insert('user/_user'); ?>
        <br>

        <div class="h2-title h2-title-content flex-s-c">
            <span>Alter Avatar</span>
        </div>

        <div class="_links">
            <a class="button" href="<?= __redirect("user/manage/character/{$character['name']}") ?>">To go back</a>
        </div>

        <div>
            <?php if ($active) : ?>
                <form action="<?= __redirect("auth/manage/avatar/{$character['name']}") ?>" method="post" enctype="multipart/form-data">
                    <?= __csrf(); ?>

                    <div class="fields">
                        <div class="fieldGroup">
                            <div>
                                <span>PNG, JPG or GIF (MAX. 100x100px) 150Kbs.</span>
                                <input type="file" name="image" />
                            </div>
                        </div>
                    </div>

                    <button type="submit"> Alterar</button>
                </form>
            <?php else : ?>
                <div class="warning">Funcionalidade indisponível no momento</div>
            <?php endif; ?>
        </div>
    </div>
</main>