mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Add missing screenshots item to user todo
This commit is contained in:
parent
c0447cdcd2
commit
9b7f1e6e88
@ -173,6 +173,9 @@ def view_user(username=None):
|
||||
Package.state == PackageState.CHANGES_NEEDED)) \
|
||||
.order_by(db.asc(Package.created_at)).all()
|
||||
|
||||
packages_with_no_screenshots = user.maintained_packages.filter(
|
||||
~Package.screenshots.any(), Package.state == PackageState.APPROVED).all()
|
||||
|
||||
packages_with_small_screenshots = user.maintained_packages \
|
||||
.filter(Package.screenshots.any(and_(PackageScreenshot.width < PackageScreenshot.SOFT_MIN_SIZE[0],
|
||||
PackageScreenshot.height < PackageScreenshot.SOFT_MIN_SIZE[1]))) \
|
||||
@ -190,12 +193,13 @@ def view_user(username=None):
|
||||
.all()
|
||||
|
||||
needs_tags = user.maintained_packages \
|
||||
.filter(Package.state != PackageState.DELETED, Package.tags==None) \
|
||||
.filter(Package.state != PackageState.DELETED, ~Package.tags.any()) \
|
||||
.order_by(db.asc(Package.title)).all()
|
||||
|
||||
return render_template("todo/user.html", current_tab="user", user=user,
|
||||
unapproved_packages=unapproved_packages, outdated_packages=outdated_packages,
|
||||
needs_tags=needs_tags, topics_to_add=topics_to_add,
|
||||
packages_with_no_screenshots=packages_with_no_screenshots,
|
||||
packages_with_small_screenshots=packages_with_small_screenshots,
|
||||
screenshot_min_size=PackageScreenshot.HARD_MIN_SIZE, screenshot_rec_size=PackageScreenshot.SOFT_MIN_SIZE)
|
||||
|
||||
|
@ -64,6 +64,26 @@
|
||||
{{ render_outdated_packages(outdated_packages, current_user) }}
|
||||
|
||||
|
||||
<div class="mt-5"></div>
|
||||
<h2 id="missing-screenshots">{{ _("Missing Screenshots") }}</h2>
|
||||
<div class="list-group mt-3 mb-5">
|
||||
{% for package in packages_with_no_screenshots %}
|
||||
<a class="list-group-item list-group-item-action" href="{{ package.getURL('packages.screenshots') }}">
|
||||
<img
|
||||
class="img-fluid"
|
||||
style="max-height: 22px; max-width: 22px;"
|
||||
src="{{ package.getThumbnailOrPlaceholder() }}" />
|
||||
|
||||
<span class="pl-2">
|
||||
{{ package.title }}
|
||||
</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<p class="text-muted">{{ _("Nothing to do :)") }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5"></div>
|
||||
<h2 id="small-screenshots">{{ _("Small Screenshots") }}</h2>
|
||||
{% if packages_with_small_screenshots %}
|
||||
|
Loading…
Reference in New Issue
Block a user