diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index 9d56a90b..3cb04190 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -164,6 +164,10 @@ def view(package): if package.state != PackageState.APPROVED: validation = validate_package_for_approval(package) + favorites_count = Collection.query.filter( + Collection.packages.contains(package), + Collection.name == "favorites").count() + is_favorited = current_user.is_authenticated and \ Collection.query.filter( Collection.author == current_user, @@ -173,7 +177,7 @@ 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, is_favorited=is_favorited) + has_review=has_review, favorites_count=favorites_count, is_favorited=is_favorited) @bp.route("/packages///shields//") diff --git a/app/templates/packages/view.html b/app/templates/packages/view.html index 2b5ceb11..f213fee7 100644 --- a/app/templates/packages/view.html +++ b/app/templates/packages/view.html @@ -385,8 +385,12 @@
-