mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 22:47:36 +01:00
Sort meta list, and packages on profile
This commit is contained in:
parent
edd51b86d0
commit
c80ea2c1b1
@ -7,7 +7,7 @@ Meta Packages
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for meta in mpackages %}
|
{% for meta in mpackages %}
|
||||||
<li><a href="{{ url_for('meta_package_page', name=meta.name) }}">{{ meta.name }}</a> ({{ meta.packages | count }} packages)</li>
|
<li><a href="{{ url_for('meta_package_page', name=meta.name) }}">{{ meta.name }}</a> ({{ meta.packages.filter_by(soft_deleted=False, approved=True).all() | count }} packages)</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li><i>No meta packages found.</i></li>
|
<li><i>No meta packages found.</i></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -22,7 +22,7 @@ from app.models import *
|
|||||||
|
|
||||||
@app.route("/metapackages/")
|
@app.route("/metapackages/")
|
||||||
def meta_package_list_page():
|
def meta_package_list_page():
|
||||||
mpackages = MetaPackage.query.order_by(db.desc(MetaPackage.name)).all()
|
mpackages = MetaPackage.query.order_by(db.asc(MetaPackage.name)).all()
|
||||||
return render_template("meta/list.html", mpackages=mpackages)
|
return render_template("meta/list.html", mpackages=mpackages)
|
||||||
|
|
||||||
@app.route("/metapackages/<name>/")
|
@app.route("/metapackages/<name>/")
|
||||||
|
@ -27,7 +27,7 @@ from app.utils import rank_required
|
|||||||
@app.route("/tags/")
|
@app.route("/tags/")
|
||||||
@rank_required(UserRank.MODERATOR)
|
@rank_required(UserRank.MODERATOR)
|
||||||
def tag_list_page():
|
def tag_list_page():
|
||||||
return render_template("tags/list.html", tags=Tag.query.all())
|
return render_template("tags/list.html", tags=Tag.query.order_by(db.asc(Tag.title)).all())
|
||||||
|
|
||||||
class TagForm(FlaskForm):
|
class TagForm(FlaskForm):
|
||||||
title = StringField("Title", [InputRequired(), Length(3,100)])
|
title = StringField("Title", [InputRequired(), Length(3,100)])
|
||||||
|
@ -54,6 +54,8 @@ def user_profile_page(username):
|
|||||||
if not current_user.is_authenticated or (user != current_user and not current_user.canAccessTodoList()):
|
if not current_user.is_authenticated or (user != current_user and not current_user.canAccessTodoList()):
|
||||||
packages = packages.filter_by(approved=True)
|
packages = packages.filter_by(approved=True)
|
||||||
|
|
||||||
|
packages = packages.order_by(db.asc(Package.title))
|
||||||
|
|
||||||
form = None
|
form = None
|
||||||
if user.checkPerm(current_user, Permission.CHANGE_DNAME) or \
|
if user.checkPerm(current_user, Permission.CHANGE_DNAME) or \
|
||||||
user.checkPerm(current_user, Permission.CHANGE_EMAIL) or \
|
user.checkPerm(current_user, Permission.CHANGE_EMAIL) or \
|
||||||
|
Loading…
Reference in New Issue
Block a user