contentdb/app/templates/users/account.html

108 lines
3.2 KiB
HTML
Raw Normal View History

2020-12-09 20:50:11 +01:00
{% extends "users/settings_base.html" %}
{% block title %}
2022-01-08 00:27:00 +01:00
{{ _("Account and Security - %(username)s", username=user.username) }}
{% endblock %}
{% block ruben_link %}
<a href="https://forum.minetest.net/ucp.php?i=pm&mode=compose&u=2051">rubenwardy</a>
2020-12-09 20:50:11 +01:00
{% endblock %}
{% block pane %}
<h2 class="mt-0">{{ _("Account and Security") }}</h2>
<h3>{{ _("Password") }}</h3>
{% if user == current_user %}
{% if user.password %}
2022-01-08 00:27:00 +01:00
<a class="btn btn-primary" href="{{ url_for('users.change_password') }}">
{{ _("Change Password") }}
</a>
2020-12-09 20:50:11 +01:00
{% else %}
2022-01-08 00:27:00 +01:00
<a class="btn btn-primary" href="{{ url_for('users.set_password') }}">
{{ _("Set Password") }}
</a>
2020-12-09 20:50:11 +01:00
{% endif %}
{% else %}
{% if user.password %}
<p>{{ _("Has password") }}</p>
{% else %}
<p class="text-danger">{{ _("Doesn't have password") }}</p>
{% endif %}
{% endif %}
2024-05-01 00:13:22 +02:00
<h3 class="mt-5">{{ _("Linked Accounts") }}</h3>
2020-12-09 20:50:11 +01:00
<table class="table">
<tr>
<td>Forums</td>
<td>
{% if user.forums_username %}
2024-05-01 00:13:22 +02:00
<a href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
{{ user.forums_username }}
2020-12-09 20:50:11 +01:00
</a>
{% else %}
2022-01-08 00:27:00 +01:00
{{ _("Please PM %(rubenwardy)s on the forums to link your account.", rubenwardy=self.ruben_link()) }}
2020-12-09 20:50:11 +01:00
{% endif %}
</td>
</tr>
<tr>
<td>GitHub</td>
<td>
{% if user.github_username %}
2024-05-01 00:13:22 +02:00
<p>
<a href="https://github.com/{{ user.github_username }}">
{{ user.github_username }}
</a>
</p>
2020-12-09 20:50:11 +01:00
{% if user == current_user %}
<a class="btn btn-secondary" href="{{ url_for('vcs.github_view_permissions') }}">
2022-01-08 00:27:00 +01:00
{{ _("View ContentDB's GitHub Permissions") }}
</a>
2020-12-09 20:50:11 +01:00
{% endif %}
2024-05-01 00:13:22 +02:00
{% if user.forums_username %}
<form method="post" action="{{ url_for('users.disconnect_github', username=user.username) }}" class="d-inline-block">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="btn btn-secondary" value="{{ _('Disconnect') }}" />
</form>
{% endif %}
2020-12-09 20:50:11 +01:00
{% elif user == current_user %}
<a class="btn btn-secondary" href="{{ url_for('vcs.github_start') }}">
2022-01-08 00:27:00 +01:00
{{ _("Link Github") }}
</a>
2020-12-09 20:50:11 +01:00
{% else %}
2022-01-08 00:27:00 +01:00
{{ _("None") }}
2020-12-09 20:50:11 +01:00
{% endif %}
</td>
</tr>
</table>
2020-12-09 20:59:14 +01:00
2024-05-01 00:13:22 +02:00
<h3 class="mt-5">{{ _("Account Deletion and Deactivation") }}</h3>
2020-12-09 20:50:11 +01:00
2023-06-19 22:27:49 +02:00
{% if current_user.rank.at_least(current_user.rank.ADMIN) %}
2022-01-08 00:27:00 +01:00
<a class="btn btn-danger" href="{{ url_for('users.delete', username=user.username) }}">
{{ _("Delete or Deactivate") }}</a>
2020-12-09 20:50:11 +01:00
{% else %}
<p>
{{ _("Account Deletion and Deactivation isn't available to users yet.") }}
{{ _("Please raise a report to request account deletion.") }}
</p>
<p>
<a class="btn btn-secondary" href="{{ url_for('report.report', url=url_current(), message="Delete my account") }}">{{ _("Report") }}</a>
2020-12-09 20:50:11 +01:00
</p>
{% endif %}
2024-05-01 00:13:22 +02:00
<h3 class="mt-5">{{ _("Recent Account Actions") }}</h3>
{% from "macros/audit_log.html" import render_audit_log %}
{{ render_audit_log(user.audit_log_entries.limit(10).all(), current_user) }}
{% if current_user.rank.at_least(current_user.rank.MODERATOR) %}
<p class="mt-4">
<a class="btn btn-secondary" href="{{ url_for('admin.audit', username=user.username) }}">
{{ _("View All") }}
</a>
</p>
{% endif %}
2020-12-09 20:50:11 +01:00
{% endblock %}