Add user rank colors, sort user list

This commit is contained in:
rubenwardy 2018-05-15 15:00:07 +01:00
parent f79c14ece8
commit e669b18062
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C
4 changed files with 24 additions and 4 deletions

@ -198,3 +198,23 @@ table tfoot {
table tfoot td { table tfoot td {
font-size: 12px; font-size: 12px;
} }
.userlist li.NOT_JOINED {
color: #aaa;
}
.NOT_JOINED a, a.NOT_JOINED {
color: #7ac;
}
.ADMIN a, a.ADMIN{
color: #e30;
}
.MODERATOR a, a.MODERATOR {
color: #e90;
}
.EDITOR a, a.EDITOR {
color: #b6f;
}

@ -39,7 +39,7 @@
</tr> </tr>
<tr> <tr>
<td>Author</td> <td>Author</td>
<td> <td class="{{ package.author.rank }}">
<a href="{{ url_for('user_profile_page', username=package.author.username) }}"> <a href="{{ url_for('user_profile_page', username=package.author.username) }}">
{{ package.author.display_name }} {{ package.author.display_name }}
</a> </a>

@ -5,9 +5,9 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<ul> <ul class="userlist">
{% for user in users %} {% for user in users %}
<li> <li class="{{ user.rank }}">
<a href="{{ url_for('user_profile_page', username=user.username) }}"> <a href="{{ url_for('user_profile_page', username=user.username) }}">
{{ user.display_name }} {{ user.display_name }}
</a> - </a> -

@ -22,7 +22,7 @@ class UserProfileForm(FlaskForm):
@app.route("/users/", methods=["GET"]) @app.route("/users/", methods=["GET"])
@rank_required(UserRank.MODERATOR) @rank_required(UserRank.MODERATOR)
def user_list_page(): def user_list_page():
users = User.query.all() users = User.query.order_by(db.asc(User.rank), db.asc(User.display_name)).all()
return render_template("users/list.html", users=users) return render_template("users/list.html", users=users)