diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index 3cb04190..1f604195 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -168,6 +168,10 @@ def view(package): Collection.packages.contains(package), Collection.name == "favorites").count() + public_collection_count = Collection.query.filter( + Collection.packages.contains(package), + Collection.private == False).count() + is_favorited = current_user.is_authenticated and \ Collection.query.filter( Collection.author == current_user, @@ -177,7 +181,8 @@ def view(package): return render_template("packages/view.html", package=package, releases=releases, packages_uses=packages_uses, review_thread=review_thread, threads=threads.all(), validation=validation, - has_review=has_review, favorites_count=favorites_count, is_favorited=is_favorited) + has_review=has_review, favorites_count=favorites_count, is_favorited=is_favorited, + public_collection_count=public_collection_count) @bp.route("/packages///shields//") diff --git a/app/templates/packages/view.html b/app/templates/packages/view.html index f213fee7..63a5897a 100644 --- a/app/templates/packages/view.html +++ b/app/templates/packages/view.html @@ -381,8 +381,8 @@ {{ self.download_btn() }} - {% if current_user.is_authenticated %} -
+
+
- {% endif %} + {% if public_collection_count > 0 %} +

+ + + {{ _("View %(count)d collections", count=public_collection_count) }} + + +

+ {% endif %} +
{% if package.check_perm(current_user, "MAKE_RELEASE") and package.update_config and package.update_config.outdated_at %} {% set config = package.update_config %}