This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/settings/advanced/deactivate.twig

71 lines
2.7 KiB
Twig

{% extends 'settings/advanced/master.twig' %}
{% set mode = 'Deactivate' %}
{% block description %}
<p>You can deactivate your account here if you want to leave.</p>
<p>This will remove your account from every rank it's a part of.</p>
<p>If you have an active Tenshi tag on your account it won't pause while your account is deactivated.</p>
<p>You can reactivate your account by logging in within 30 days, after that period your account will be removed.</p>
{% endblock %}
{% block js %}
<script>
function yuunoDeactivate(form) {
var confirm = new Sakura.Dialogue;
confirm.SetType(Sakura.DialogueType.Confirm);
confirm.Text = "Are you really sure? You can reactivate your account within 30 days of deactivated, after that it'll be permanently deleted!";
confirm.AddCallback(Sakura.DialogueButton.No, function () {
this.Close();
});
confirm.AddCallback(Sakura.DialogueButton.Yes, function () {
var ajax = new Sakura.AJAX;
ajax.SetUrl("{{ route('settings.advanced.deactivate') }}");
ajax.SetFormData(new FormData(form));
ajax.AddCallback(200, function () {
var result = ajax.JSON();
confirm.Close();
if (result.error) {
var error = new Sakura.Dialogue;
error.Text = result.error;
error.SetType(Sakura.DialogueType.Info);
error.AddCallback(Sakura.DialogueButton.Ok, function () {
this.Close();
if (result.go) {
window.location.assign(result.go);
}
});
error.Display();
} else {
window.location.reload();
}
});
ajax.Start(Sakura.HTTPMethod.POST);
});
confirm.Display();
}
</script>
{% endblock %}
{% block settingsContent %}
<form enctype="multipart/form-data" method="post" action="javascript:void(0);" onsubmit="yuunoDeactivate(this)">
<input type="hidden" name="session" value="{{ session_id() }}">
<div class="profile-field">
<div><h2>Enter your password to continue</h2></div>
<div><input type="password" name="password" class="input__text"></div>
</div>
<div style="text-align: center; margin: 2em;">
<button class="input__button input__button--danger">I understand, deactivate my account</button>
</div>
</form>
{% endblock %}