Add account form to account settings page

This commit is contained in:
rubenwardy
2021-01-01 17:02:08 +00:00
parent 12bcdf2d47
commit 0054f362a7
3 changed files with 67 additions and 40 deletions

View File

@@ -7,6 +7,32 @@
{% block pane %}
<h2 class="mt-0">{{ _("Account and Security") }}</h2>
{% if form %}
<h3>
{{ _("Edit Account") }}
<small class="fas fa-user-shield ml-2 text-muted"></small>
</h3>
{% from "macros/forms.html" import render_field, render_field_prefix, render_submit_field %}
<form action="" method="POST" class="form" role="form">
{{ form.hidden_tag() }}
{% if user.checkPerm(current_user, "CHANGE_USERNAMES") %}
{{ render_field(form.display_name, tabindex=230) }}
{{ render_field(form.forums_username, tabindex=230) }}
{{ render_field_prefix(form.github_username, tabindex=230) }}
{% endif %}
{% if user.checkPerm(current_user, "CHANGE_RANK") %}
{{ render_field(form.rank, tabindex=250) }}
{% endif %}
<p>
{{ render_submit_field(form.submit, tabindex=280) }}
</p>
</form>
{% endif %}
<h3>{{ _("Password") }}</h3>
{% if user == current_user %}
{% if user.password %}

View File

@@ -48,21 +48,11 @@
<form action="" method="POST" class="form" role="form">
{{ form.hidden_tag() }}
{% if user.checkPerm(current_user, "CHANGE_USERNAMES") %}
{{ render_field(form.display_name, tabindex=230) }}
{{ render_field(form.forums_username, tabindex=230) }}
{{ render_field_prefix(form.github_username, tabindex=230) }}
{% endif %}
{% if user.checkPerm(current_user, "CHANGE_PROFILE_URLS") %}
{{ render_field(form.website_url, tabindex=232) }}
{{ render_field(form.donate_url, tabindex=233) }}
{% endif %}
{% if user.checkPerm(current_user, "CHANGE_RANK") %}
{{ render_field(form.rank, tabindex=250) }}
{% endif %}
<p>
{{ render_submit_field(form.submit, tabindex=280) }}
</p>