mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 11:47:28 +01:00
Add link to collections search to package page
This commit is contained in:
parent
e9193aefb8
commit
c782e59531
@ -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/<author>/<name>/shields/<type>/")
|
||||
|
@ -381,8 +381,8 @@
|
||||
{{ self.download_btn() }}
|
||||
</div>
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
<div class="d-flex mt-3 mb-4">
|
||||
<div class="mt-3 mb-3">
|
||||
<div class="d-flex">
|
||||
<form method="POST" action="{{ package.get_url('collections.package_toggle_favorite') }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<button type="submit" class="btn {% if is_favorited %}text-info{% endif %} btn-secondary me-2"
|
||||
@ -399,7 +399,16 @@
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% if public_collection_count > 0 %}
|
||||
<p class="text-center mt-1">
|
||||
<a href="{{ url_for('collections.list_all', package=package.get_id()) }}">
|
||||
<small>
|
||||
{{ _("View %(count)d collections", count=public_collection_count) }}
|
||||
</small>
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if package.check_perm(current_user, "MAKE_RELEASE") and package.update_config and package.update_config.outdated_at %}
|
||||
{% set config = package.update_config %}
|
||||
|
Loading…
Reference in New Issue
Block a user