mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add /pkgbase/{name} route
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
ae3d302c47
commit
88569b6d09
4 changed files with 88 additions and 0 deletions
|
@ -96,3 +96,20 @@ async def package(request: Request, name: str) -> Response:
|
|||
context["conflicts"] = conflicts
|
||||
|
||||
return render_template(request, "packages/show.html", context)
|
||||
|
||||
|
||||
@router.get("/pkgbase/{name}")
|
||||
async def package_base(request: Request, name: str) -> Response:
|
||||
# Get the PackageBase.
|
||||
pkgbase = get_pkgbase(name)
|
||||
|
||||
# If this is not a split package, redirect to /packages/{name}.
|
||||
if pkgbase.packages.count() == 1:
|
||||
return RedirectResponse(f"/packages/{name}",
|
||||
status_code=int(HTTPStatus.SEE_OTHER))
|
||||
|
||||
# Add our base information.
|
||||
context = await make_single_context(request, pkgbase)
|
||||
context["packages"] = pkgbase.packages.all() # Doesn't need to be here.
|
||||
|
||||
return render_template(request, "pkgbase.html", context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue