mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Move create and work queue to user drop down
This commit is contained in:
parent
67f028f6fc
commit
57c43e7994
@ -120,6 +120,11 @@ class User(db.Model, UserMixin):
|
|||||||
self.display_name = username
|
self.display_name = username
|
||||||
self.rank = UserRank.NOT_JOINED
|
self.rank = UserRank.NOT_JOINED
|
||||||
|
|
||||||
|
def canAccessTodoList(self):
|
||||||
|
return Permission.APPROVE_NEW.check(self) or \
|
||||||
|
Permission.APPROVE_RELEASE.check(self) or \
|
||||||
|
Permission.APPROVE_CHANGES.check(self)
|
||||||
|
|
||||||
def isClaimed(self):
|
def isClaimed(self):
|
||||||
return self.rank.atLeast(UserRank.NEW_MEMBER)
|
return self.rank.atLeast(UserRank.NEW_MEMBER)
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
{% if current_user.is_authenticated %}
|
{% if current_user.is_authenticated %}
|
||||||
<li><a href="{{ url_for('notifications_page') }}">({{ current_user.notifications | length }})</a></li>
|
<li><a href="{{ url_for('notifications_page') }}">({{ current_user.notifications | length }})</a></li>
|
||||||
|
<li><a href="{{ url_for('create_edit_package_page') }}">+</a></li>
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a href="{{ url_for('user_profile_page', username=current_user.username) }}"
|
<a href="{{ url_for('user_profile_page', username=current_user.username) }}"
|
||||||
class="dropdown-toggle"
|
class="dropdown-toggle"
|
||||||
@ -53,6 +54,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{{ url_for('user_profile_page', username=current_user.username) }}">Profile</a>
|
<a href="{{ url_for('user_profile_page', username=current_user.username) }}">Profile</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% if current_user.canAccessTodoList() %}
|
||||||
|
<li><a href="{{ url_for('todo_page') }}">Work Queue</a></li>
|
||||||
|
{% endif %}
|
||||||
{% if current_user.rank == current_user.rank.ADMIN %}
|
{% if current_user.rank == current_user.rank.ADMIN %}
|
||||||
<li><a href="{{ url_for('admin_page') }}">Admin</a></li>
|
<li><a href="{{ url_for('admin_page') }}">Admin</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -63,13 +63,6 @@ def packages_page():
|
|||||||
return render_template("packages/list.html", title=title, packages=query.all(), \
|
return render_template("packages/list.html", title=title, packages=query.all(), \
|
||||||
query=search, tags=tags, type=None if type is None else type.toName())
|
query=search, tags=tags, type=None if type is None else type.toName())
|
||||||
|
|
||||||
|
|
||||||
def canSeeWorkQueue():
|
|
||||||
return Permission.APPROVE_NEW.check(current_user) or \
|
|
||||||
Permission.APPROVE_RELEASE.check(current_user) or \
|
|
||||||
Permission.APPROVE_CHANGES.check(current_user)
|
|
||||||
|
|
||||||
@menu.register_menu(app, ".todo", "Work Queue", order=20, visible_when=canSeeWorkQueue)
|
|
||||||
@app.route("/todo/")
|
@app.route("/todo/")
|
||||||
@login_required
|
@login_required
|
||||||
def todo_page():
|
def todo_page():
|
||||||
@ -138,7 +131,6 @@ class PackageForm(FlaskForm):
|
|||||||
forums = IntegerField("Forum Topic ID", [InputRequired(), NumberRange(0,999999)])
|
forums = IntegerField("Forum Topic ID", [InputRequired(), NumberRange(0,999999)])
|
||||||
submit = SubmitField("Save")
|
submit = SubmitField("Save")
|
||||||
|
|
||||||
@menu.register_menu(app, ".new", "Create", order=21, visible_when=lambda: current_user.is_authenticated)
|
|
||||||
@app.route("/packages/new/", methods=["GET", "POST"])
|
@app.route("/packages/new/", methods=["GET", "POST"])
|
||||||
@app.route("/packages/<author>/<name>/edit/", methods=["GET", "POST"])
|
@app.route("/packages/<author>/<name>/edit/", methods=["GET", "POST"])
|
||||||
@login_required
|
@login_required
|
||||||
|
Loading…
Reference in New Issue
Block a user