Verified Commit a08681ba authored by Mario Oenning's avatar Mario Oenning
Browse files

fix: Add "Show more..." link for "Required by"

Fix glitch on the package page:
"Show more..." not displayed for the "Required by" list

Fix test case:
Function name does not start with "test" hence it was never executed during test runs

Issue report: #363



Signed-off-by: Mario Oenning's avatarmoson-mo <mo-son@mailbox.org>
parent a832b3cd
Pipeline #40391 passed with stages
in 2 minutes and 47 seconds
......@@ -62,10 +62,12 @@
<em>{{ dep | dep_extra }}</em>
</li>
{% endfor %}
{% if not all_reqs and (required_by | length) > max_listing %}
<a href="/packages/{{ name }}?{{ q | extend_query(['all_reqs', '1']) | urlencode }}#pkgreqs">
{{ "Show %d more" | tr | format(reqs_count - (required_by | length)) }}...
</a>
{% if not all_reqs and reqs_count > max_listing %}
<li>
<a href="/packages/{{ package.Name }}?{{ q | extend_query(['all_reqs', '1']) | urlencode }}#pkgreqs">
{{ "Show %d more" | tr | format(reqs_count - (required_by | length)) }}...
</a>
</li>
{% endif %}
</ul>
</div>
......
......@@ -352,7 +352,7 @@ def test_package_split_description(client: TestClient, user: User):
assert row.text == pkg_b.Description
def paged_depends_required(client: TestClient, package: Package):
def test_paged_depends_required(client: TestClient, package: Package):
maint = package.PackageBase.Maintainer
new_pkgs = []
......@@ -360,7 +360,7 @@ def paged_depends_required(client: TestClient, package: Package):
# Create 25 new packages that'll be used to depend on our package.
for i in range(26):
base = db.create(PackageBase, Name=f"new_pkg{i}", Maintainer=maint)
new_pkgs.append(db.create(Package, Name=base.Name))
new_pkgs.append(db.create(Package, Name=base.Name, PackageBase=base))
# Create 25 deps.
for i in range(25):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment