mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 14:37:36 +01:00
Add settings template
This commit is contained in:
parent
0082870864
commit
f75bdec756
@ -25,6 +25,7 @@ from wtforms.validators import *
|
|||||||
from app.models import db, User, APIToken, Package, Permission
|
from app.models import db, User, APIToken, Package, Permission
|
||||||
from app.utils import randomString
|
from app.utils import randomString
|
||||||
from . import bp
|
from . import bp
|
||||||
|
from ..users.profile import get_setting_tabs
|
||||||
|
|
||||||
|
|
||||||
class CreateAPIToken(FlaskForm):
|
class CreateAPIToken(FlaskForm):
|
||||||
@ -50,7 +51,7 @@ def list_tokens(username):
|
|||||||
if not user.checkPerm(current_user, Permission.CREATE_TOKEN):
|
if not user.checkPerm(current_user, Permission.CREATE_TOKEN):
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
return render_template("api/list_tokens.html", user=user)
|
return render_template("api/list_tokens.html", user=user, tabs=get_setting_tabs(), current_tab="api_tokens")
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/users/<username>/tokens/new/", methods=["GET", "POST"])
|
@bp.route("/users/<username>/tokens/new/", methods=["GET", "POST"])
|
||||||
|
@ -76,6 +76,21 @@ def profile(username):
|
|||||||
user=user, packages=packages, topics_to_add=topics_to_add)
|
user=user, packages=packages, topics_to_add=topics_to_add)
|
||||||
|
|
||||||
|
|
||||||
|
def get_setting_tabs():
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
"id": "edit_profile",
|
||||||
|
"title": "Edit Profile",
|
||||||
|
"url": url_for("users.profile_edit", username=current_user.username)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "api_tokens",
|
||||||
|
"title": "API Tokens",
|
||||||
|
"url": url_for("api.list_tokens", username=current_user.username)
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/users/<username>/edit/", methods=["GET", "POST"])
|
@bp.route("/users/<username>/edit/", methods=["GET", "POST"])
|
||||||
def profile_edit(username):
|
def profile_edit(username):
|
||||||
user : User = User.query.filter_by(username=username).first()
|
user : User = User.query.filter_by(username=username).first()
|
||||||
@ -139,7 +154,7 @@ def profile_edit(username):
|
|||||||
return redirect(url_for("users.profile", username=username))
|
return redirect(url_for("users.profile", username=username))
|
||||||
|
|
||||||
# Process GET or invalid POST
|
# Process GET or invalid POST
|
||||||
return render_template("users/profile_edit.html", user=user, form=form)
|
return render_template("users/profile_edit.html", user=user, form=form, tabs=get_setting_tabs(), current_tab="edit_profile")
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/users/<username>/check/", methods=["POST"])
|
@bp.route("/users/<username>/check/", methods=["POST"])
|
||||||
|
@ -31,7 +31,7 @@ Audit Log
|
|||||||
|
|
||||||
<div class="col-sm-2 text-muted">
|
<div class="col-sm-2 text-muted">
|
||||||
<img
|
<img
|
||||||
class="img-responsive user-photo img-thumbnail img-thumbnail-1"
|
class="img-fluid user-photo img-thumbnail img-thumbnail-1"
|
||||||
style="max-height: 22px;"
|
style="max-height: 22px;"
|
||||||
src="{{ entry.causer.getProfilePicURL() }}" />
|
src="{{ entry.causer.getProfilePicURL() }}" />
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ Audit Log
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
class="img-responsive"
|
class="img-fluid"
|
||||||
style="max-height: 22px; max-width: 22px;"
|
style="max-height: 22px; max-width: 22px;"
|
||||||
src="{{ entry.package.getThumbnailURL(1) }}" />
|
src="{{ entry.package.getThumbnailURL(1) }}" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "users/settings_base.html" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{{ _("List tokens for %(username)s", username=user.username) }}
|
{{ _("API Tokens | %(username)s", username=user.username) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block pane %}
|
||||||
{% block content %}
|
|
||||||
<a class="btn btn-primary float-right" href="{{ url_for('api.create_edit_token', username=user.username) }}">Create</a>
|
<a class="btn btn-primary float-right" href="{{ url_for('api.create_edit_token', username=user.username) }}">Create</a>
|
||||||
<h1 class="mt-0">{{ self.title() }}</h1>
|
<h2 class="mt-0">{{ _("API Tokens") }}</h2>
|
||||||
|
|
||||||
<ul>
|
<div class="list-group">
|
||||||
{% for token in user.tokens %}
|
{% for token in user.tokens %}
|
||||||
<li>
|
<a class="list-group-item list-group-item-action" href="{{ url_for('api.create_edit_token', username=user.username, id=token.id) }}">
|
||||||
<a href="{{ url_for('api.create_edit_token', username=user.username, id=token.id) }}">{{ token.name }}</a>
|
{{ token.name }}
|
||||||
</li>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li>
|
<span class="list-group-item">
|
||||||
<i>No tokens created</i>
|
<i>No tokens created</i>
|
||||||
</li>
|
</span>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<li class="row my-2 mx-0">
|
<li class="row my-2 mx-0">
|
||||||
<div class="col-md-1 p-1">
|
<div class="col-md-1 p-1">
|
||||||
<a href="{{ url_for('users.profile', username=review.author.username) }}">
|
<a href="{{ url_for('users.profile', username=review.author.username) }}">
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ review.author.getProfilePicURL() }}">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ review.author.getProfilePicURL() }}">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-auto pl-1 pr-3 pt-2 text-center" style=" font-size: 200%;">
|
<div class="col-md-auto pl-1 pr-3 pt-2 text-center" style=" font-size: 200%;">
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<li class="row my-2 mx-0">
|
<li class="row my-2 mx-0">
|
||||||
<div class="col-md-1 p-1">
|
<div class="col-md-1 p-1">
|
||||||
<a href="{{ url_for('users.profile', username=r.author.username) }}">
|
<a href="{{ url_for('users.profile', username=r.author.username) }}">
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ r.author.getProfilePicURL() }}">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ r.author.getProfilePicURL() }}">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col pr-0">
|
<div class="col pr-0">
|
||||||
@ -59,7 +59,7 @@
|
|||||||
{% if current_user.is_authenticated %}
|
{% if current_user.is_authenticated %}
|
||||||
<div class="row mt-0 mb-4 comments mx-0">
|
<div class="row mt-0 mb-4 comments mx-0">
|
||||||
<div class="col-md-1 p-1">
|
<div class="col-md-1 p-1">
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
@ -22,7 +22,7 @@ Notifications
|
|||||||
|
|
||||||
<div class="col-sm-auto text-muted">
|
<div class="col-sm-auto text-muted">
|
||||||
<img
|
<img
|
||||||
class="img-responsive"
|
class="img-fluid"
|
||||||
style="max-height: 22px; max-width: 22px;"
|
style="max-height: 22px; max-width: 22px;"
|
||||||
src="{{ n.package.getThumbnailURL(1) }}" />
|
src="{{ n.package.getThumbnailURL(1) }}" />
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Notifications
|
|||||||
<div class="col-sm-auto text-muted text-right">
|
<div class="col-sm-auto text-muted text-right">
|
||||||
<span class="pr-2">{{ n.causer.display_name }}</span>
|
<span class="pr-2">{{ n.causer.display_name }}</span>
|
||||||
<img
|
<img
|
||||||
class="img-responsive user-photo img-thumbnail img-thumbnail-1"
|
class="img-fluid user-photo img-thumbnail img-thumbnail-1"
|
||||||
style="max-height: 22px;"
|
style="max-height: 22px;"
|
||||||
src="{{ n.causer.getProfilePicURL() }}" />
|
src="{{ n.causer.getProfilePicURL() }}" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<div class="row mt-0 mb-4 comments mx-0">
|
<div class="row mt-0 mb-4 comments mx-0">
|
||||||
<div class="col-md-1 p-1">
|
<div class="col-md-1 p-1">
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<div class="row mt-0 mb-4 comments mx-0">
|
<div class="row mt-0 mb-4 comments mx-0">
|
||||||
<div class="col-md-1 p-1">
|
<div class="col-md-1 p-1">
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ current_user.getProfilePicURL() }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
<article class="row mb-5">
|
<article class="row mb-5">
|
||||||
<div class="col-auto image mx-0">
|
<div class="col-auto image mx-0">
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<h1 class="ml-3 my-0">
|
<h1 class="ml-3 my-0">
|
||||||
|
@ -1,176 +1,158 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "users/settings_base.html" %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
Edit Profile | {{ user.username }}
|
{{ _("Edit Profile | %(username)s", username=user.username) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block pane %}
|
||||||
|
<h2 class="mt-0">{{ _("Edit Profile") }}</h2>
|
||||||
|
|
||||||
<h1 class="mb-5">
|
<div class="card">
|
||||||
Editing <a href="{{ url_for('users.profile', username=user.username) }}">{{ user.display_name }}</a>'s profile
|
<h2 class="card-header">{{ _("Profile Picture") }}</h2>
|
||||||
</h1>
|
<div class="card-body row">
|
||||||
|
<div class="col-md-2">
|
||||||
<div class="row mb-3">
|
{% if user.forums_username %}
|
||||||
<div class="col-sm-6">
|
<a href="https://forum.minetest.net/ucp.php?i=profile&mode=avatar">
|
||||||
<div class="card">
|
{% elif user.email %}
|
||||||
<h2 class="card-header">{{ _("Profile Picture") }}</h2>
|
<a href="https://en.gravatar.com/">
|
||||||
<div class="card-body row">
|
{% endif %}
|
||||||
<div class="col-md-2">
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}">
|
||||||
{% if user.forums_username %}
|
{% if user.forums_username or user.email %}
|
||||||
<a href="https://forum.minetest.net/ucp.php?i=profile&mode=avatar">
|
</a>
|
||||||
{% elif user.email %}
|
{% endif %}
|
||||||
<a href="https://en.gravatar.com/">
|
|
||||||
{% endif %}
|
|
||||||
<img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}">
|
|
||||||
{% if user.forums_username or user.email %}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
{% if user.forums_username %}
|
|
||||||
<form method="post" action="{{ url_for('users.user_check', username=user.username) }}" class="" style="display:inline-block;">
|
|
||||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
||||||
<input type="submit" class="btn btn-primary" value="Sync with Forums" />
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
{% if user.email %}
|
|
||||||
<a class="btn btn-primary" href="https://en.gravatar.com/">
|
|
||||||
Gravatar
|
|
||||||
</a>
|
|
||||||
{% else %}
|
|
||||||
<a class="btn btn-primary disabled"
|
|
||||||
data-toggle="tooltip" data-placement="bottom"
|
|
||||||
title="Please add an email address to use Gravatar"
|
|
||||||
style="pointer-events: all;">
|
|
||||||
Gravatar
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col">
|
||||||
<div class="card my-4">
|
{% if user.forums_username %}
|
||||||
<h2 class="card-header">{{ _("Passwords and Security") }}</h2>
|
<form method="post" action="{{ url_for('users.user_check', username=user.username) }}" class="" style="display:inline-block;">
|
||||||
<table class="table">
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||||
{% if user == current_user %}
|
<input type="submit" class="btn btn-primary" value="Sync with Forums" />
|
||||||
<tr>
|
|
||||||
<td>Password:</td>
|
|
||||||
<td>
|
|
||||||
{% if user.password %}
|
|
||||||
Set | <a href="{{ url_for('users.change_password') }}">Change</a>
|
|
||||||
{% else %}
|
|
||||||
Not set | <a href="{{ url_for('users.set_password') }}">Set</a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endif %}
|
|
||||||
{% if user.checkPerm(current_user, "CREATE_TOKEN") %}
|
|
||||||
<tr>
|
|
||||||
<td>API Tokens:</td>
|
|
||||||
<td>
|
|
||||||
<a href="{{ url_for('api.list_tokens', username=user.username) }}">Manage</a>
|
|
||||||
<span class="badge badge-primary">{{ user.tokens.count() }}</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endif %}
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card my-4">
|
|
||||||
<h2 class="card-header">{{ _("Linked Accounts") }}</h2>
|
|
||||||
<table class="table">
|
|
||||||
<tr>
|
|
||||||
<td>Forums</td>
|
|
||||||
<td>
|
|
||||||
{% if user.forums_username %}
|
|
||||||
<a href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
|
|
||||||
Connected
|
|
||||||
</a>
|
|
||||||
{% elif user == current_user %}
|
|
||||||
None
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>GitHub</td>
|
|
||||||
<td>
|
|
||||||
{% if user.github_username %}
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/{{ user.github_username }}">Connected</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{% if user == current_user %}
|
|
||||||
<p class="mb-0">
|
|
||||||
<a href="{{ url_for('github.view_permissions') }}">View ContentDB's GitHub Permissions</a>
|
|
||||||
</p>
|
|
||||||
{% endif %}
|
|
||||||
{% elif user == current_user %}
|
|
||||||
<a href="{{ url_for('github.start') }}">Link Github</a>
|
|
||||||
{% else %}
|
|
||||||
None
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
{% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.MODERATOR) %}
|
|
||||||
<tr>
|
|
||||||
<td>Admin</td>
|
|
||||||
<td>
|
|
||||||
{% if user.email %}
|
|
||||||
<a class="btn btn-primary" href="{{ url_for('users.send_email', username=user.username) }}">
|
|
||||||
Email
|
|
||||||
</a>
|
|
||||||
{% else %}
|
|
||||||
<a class="btn btn-primary disabled"
|
|
||||||
data-toggle="tooltip" data-placement="bottom"
|
|
||||||
title="No email address for user"
|
|
||||||
style="pointer-events: all;">
|
|
||||||
Email
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endif %}
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% from "macros/forms.html" import render_field, render_submit_field %}
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">Edit Details</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<form action="" method="POST" class="form box-body" 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(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_EMAIL") %}
|
|
||||||
{{ render_field(form.email, tabindex=240) }}
|
|
||||||
<i>We'll send you an email to verify it if changed.</i>
|
|
||||||
{% 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>
|
</form>
|
||||||
</div>
|
{% endif %}
|
||||||
|
{% if user.email %}
|
||||||
|
<a class="btn btn-primary" href="https://en.gravatar.com/">
|
||||||
|
Gravatar
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="btn btn-primary disabled"
|
||||||
|
data-toggle="tooltip" data-placement="bottom"
|
||||||
|
title="Please add an email address to use Gravatar"
|
||||||
|
style="pointer-events: all;">
|
||||||
|
Gravatar
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="card my-4">
|
||||||
|
<h2 class="card-header">{{ _("Passwords and Security") }}</h2>
|
||||||
|
<table class="table">
|
||||||
|
{% if user == current_user %}
|
||||||
|
<tr>
|
||||||
|
<td>Password:</td>
|
||||||
|
<td>
|
||||||
|
{% if user.password %}
|
||||||
|
Set | <a href="{{ url_for('users.change_password') }}">Change</a>
|
||||||
|
{% else %}
|
||||||
|
Not set | <a href="{{ url_for('users.set_password') }}">Set</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card my-4">
|
||||||
|
<h2 class="card-header">{{ _("Linked Accounts") }}</h2>
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<td>Forums</td>
|
||||||
|
<td>
|
||||||
|
{% if user.forums_username %}
|
||||||
|
<a href="https://forum.minetest.net/memberlist.php?mode=viewprofile&un={{ user.forums_username }}">
|
||||||
|
Connected
|
||||||
|
</a>
|
||||||
|
{% elif user == current_user %}
|
||||||
|
None
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>GitHub</td>
|
||||||
|
<td>
|
||||||
|
{% if user.github_username %}
|
||||||
|
<p>
|
||||||
|
<a href="https://github.com/{{ user.github_username }}">Connected</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{% if user == current_user %}
|
||||||
|
<p class="mb-0">
|
||||||
|
<a href="{{ url_for('github.view_permissions') }}">View ContentDB's GitHub Permissions</a>
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
{% elif user == current_user %}
|
||||||
|
<a href="{{ url_for('github.start') }}">Link Github</a>
|
||||||
|
{% else %}
|
||||||
|
None
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
{% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.MODERATOR) %}
|
||||||
|
<tr>
|
||||||
|
<td>Admin</td>
|
||||||
|
<td>
|
||||||
|
{% if user.email %}
|
||||||
|
<a class="btn btn-primary" href="{{ url_for('users.send_email', username=user.username) }}">
|
||||||
|
Email
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="btn btn-primary disabled"
|
||||||
|
data-toggle="tooltip" data-placement="bottom"
|
||||||
|
title="No email address for user"
|
||||||
|
style="pointer-events: all;">
|
||||||
|
Email
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% from "macros/forms.html" import render_field, render_submit_field %}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">Edit Details</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="" method="POST" class="form box-body" 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(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_EMAIL") %}
|
||||||
|
{{ render_field(form.email, tabindex=240) }}
|
||||||
|
<i>We'll send you an email to verify it if changed.</i>
|
||||||
|
{% 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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
30
app/templates/users/settings_base.html
Normal file
30
app/templates/users/settings_base.html
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-2">
|
||||||
|
<div class="list-group">
|
||||||
|
<a class="list-group-item list-group-item-action" href="{{ url_for('users.profile', username=user.username) }}">
|
||||||
|
<span class="row m-0 p-0">
|
||||||
|
<span class="col-auto m-0 p-0">
|
||||||
|
<img class="img-fluid user-photo img-thumbnail img-thumbnail-1" src="{{ user.getProfilePicURL() }}" alt="Profile picture" style="max-height: 20px;">
|
||||||
|
</span>
|
||||||
|
<span class="col m-0 p-0 pl-2">
|
||||||
|
{{ user.display_name }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
{% for item in tabs %}
|
||||||
|
<a href="{{ item.url }}"
|
||||||
|
class="list-group-item list-group-item-action {% if item.id == current_tab %}active{% endif %}">
|
||||||
|
{{ item.title }}
|
||||||
|
</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% block pane %}
|
||||||
|
{% endblock %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user