mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Merge branch 'master' into live
This commit is contained in:
commit
7c1b8b0afe
6 changed files with 14 additions and 12 deletions
|
@ -6,7 +6,7 @@ from typing import Any
|
|||
# Publicly visible version of aurweb. This is used to display
|
||||
# aurweb versioning in the footer and must be maintained.
|
||||
# Todo: Make this dynamic/automated.
|
||||
AURWEB_VERSION = "v6.0.13"
|
||||
AURWEB_VERSION = "v6.0.14"
|
||||
|
||||
_parser = None
|
||||
|
||||
|
|
|
@ -201,9 +201,11 @@ def handle_request(request: Request, reqtype_id: int,
|
|||
# This is done to increase tracking of actions occurring
|
||||
# through the website.
|
||||
if not to_accept:
|
||||
utcnow = time.utcnow()
|
||||
with db.begin():
|
||||
pkgreq = db.create(PackageRequest,
|
||||
ReqTypeID=reqtype_id,
|
||||
RequestTS=utcnow,
|
||||
User=request.user,
|
||||
PackageBase=pkgbase,
|
||||
PackageBaseName=pkgbase.Name,
|
||||
|
|
|
@ -15,7 +15,7 @@ from aurweb.packages.search import PackageSearch
|
|||
from aurweb.packages.util import get_pkg_or_base
|
||||
from aurweb.pkgbase import actions as pkgbase_actions
|
||||
from aurweb.pkgbase import util as pkgbaseutil
|
||||
from aurweb.templates import make_context, render_template
|
||||
from aurweb.templates import make_context, make_variable_context, render_template
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
router = APIRouter()
|
||||
|
@ -125,7 +125,7 @@ async def packages_get(request: Request, context: Dict[str, Any],
|
|||
|
||||
@router.get("/packages")
|
||||
async def packages(request: Request) -> Response:
|
||||
context = make_context(request, "Packages")
|
||||
context = await make_variable_context(request, "Packages")
|
||||
return await packages_get(request, context)
|
||||
|
||||
|
||||
|
|
|
@ -150,13 +150,13 @@ async def pkgbase_flag_post(request: Request, name: str,
|
|||
|
||||
has_cred = request.user.has_credential(creds.PKGBASE_FLAG)
|
||||
if has_cred and not pkgbase.OutOfDateTS:
|
||||
notif = notify.FlagNotification(request.user.ID, pkgbase.ID)
|
||||
now = time.utcnow()
|
||||
with db.begin():
|
||||
pkgbase.OutOfDateTS = now
|
||||
pkgbase.Flagger = request.user
|
||||
pkgbase.FlaggerComment = comments
|
||||
notif.send()
|
||||
|
||||
notify.FlagNotification(request.user.ID, pkgbase.ID).send()
|
||||
|
||||
return RedirectResponse(f"/pkgbase/{name}",
|
||||
status_code=HTTPStatus.SEE_OTHER)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
[tool.poetry]
|
||||
name = "aurweb"
|
||||
version = "v6.0.13"
|
||||
version = "v6.0.14"
|
||||
license = "GPL-2.0-only"
|
||||
description = "Source code for the Arch User Repository's website"
|
||||
homepage = "https://aur.archlinux.org"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% if SB == "n" %}
|
||||
{% set order = "d" if order == "a" else "a" %}
|
||||
{% endif %}
|
||||
<a href="/packages/?SB=n&SO={{ order }}">
|
||||
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'n'), ('SO', order)) | urlencode }}">
|
||||
{{ "Name" | tr }}
|
||||
</a>
|
||||
</th>
|
||||
|
@ -19,7 +19,7 @@
|
|||
{% if SB == "v" %}
|
||||
{% set order = "d" if order == "a" else "a" %}
|
||||
{% endif %}
|
||||
<a href="/packages/?SB=v&SO={{ order }}">
|
||||
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'v'), ('SO', order)) | urlencode }}">
|
||||
{{ "Votes" | tr }}
|
||||
</a>
|
||||
</th>
|
||||
|
@ -28,7 +28,7 @@
|
|||
{% if SB == "p" %}
|
||||
{% set order = "d" if order == "a" else "a" %}
|
||||
{% endif %}
|
||||
<a href="/packages/?SB=p&SO={{ order }}">{{ "Popularity" | tr }}</a><span title="{{ 'Popularity is calculated as the sum of all votes with each vote being weighted with a factor of %.2f per day since its creation.' | format(0.98) }}" class="hover-help"><sup>?</sup></span>
|
||||
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'p'), ('SO', order)) | urlencode }}">{{ "Popularity" | tr }}</a><span title="{{ 'Popularity is calculated as the sum of all votes with each vote being weighted with a factor of %.2f per day since its creation.' | format(0.98) }}" class="hover-help"><sup>?</sup></span>
|
||||
</th>
|
||||
{% if request.user.is_authenticated() %}
|
||||
<th>
|
||||
|
@ -36,7 +36,7 @@
|
|||
{% if SB == "w" %}
|
||||
{% set order = "d" if order == "a" else "a" %}
|
||||
{% endif %}
|
||||
<a href="/packages/?SB=w&SO={{ order }}">
|
||||
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'w'), ('SO', order)) | urlencode }}">
|
||||
{{ "Voted" | tr }}
|
||||
</a>
|
||||
</th>
|
||||
|
@ -45,7 +45,7 @@
|
|||
{% if SB == "o" %}
|
||||
{% set order = "d" if order == "a" else "a" %}
|
||||
{% endif %}
|
||||
<a href="/packages/?SB=o&SO={{ order }}">
|
||||
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'o'), ('SO', order)) | urlencode }}">
|
||||
{{ "Notify" | tr }}
|
||||
</a>
|
||||
</th>
|
||||
|
@ -56,7 +56,7 @@
|
|||
{% if SB == "m" %}
|
||||
{% set order = "d" if order == "a" else "a" %}
|
||||
{% endif %}
|
||||
<a href="/packages/?SB=m&SO={{ order }}">
|
||||
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'm'), ('SO', order)) | urlencode }}">
|
||||
{{ "Maintainer" | tr }}
|
||||
</a>
|
||||
</th>
|
||||
|
|
Loading…
Add table
Reference in a new issue