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: moson-mo <mo-son@mailbox.org>
This commit is contained in:
moson-mo 2022-11-25 12:24:04 +01:00
parent a832b3cddb
commit a08681ba23
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
2 changed files with 8 additions and 6 deletions

View file

@ -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>