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
|
# Publicly visible version of aurweb. This is used to display
|
||||||
# aurweb versioning in the footer and must be maintained.
|
# aurweb versioning in the footer and must be maintained.
|
||||||
# Todo: Make this dynamic/automated.
|
# Todo: Make this dynamic/automated.
|
||||||
AURWEB_VERSION = "v6.0.13"
|
AURWEB_VERSION = "v6.0.14"
|
||||||
|
|
||||||
_parser = None
|
_parser = None
|
||||||
|
|
||||||
|
|
|
@ -201,9 +201,11 @@ def handle_request(request: Request, reqtype_id: int,
|
||||||
# This is done to increase tracking of actions occurring
|
# This is done to increase tracking of actions occurring
|
||||||
# through the website.
|
# through the website.
|
||||||
if not to_accept:
|
if not to_accept:
|
||||||
|
utcnow = time.utcnow()
|
||||||
with db.begin():
|
with db.begin():
|
||||||
pkgreq = db.create(PackageRequest,
|
pkgreq = db.create(PackageRequest,
|
||||||
ReqTypeID=reqtype_id,
|
ReqTypeID=reqtype_id,
|
||||||
|
RequestTS=utcnow,
|
||||||
User=request.user,
|
User=request.user,
|
||||||
PackageBase=pkgbase,
|
PackageBase=pkgbase,
|
||||||
PackageBaseName=pkgbase.Name,
|
PackageBaseName=pkgbase.Name,
|
||||||
|
|
|
@ -15,7 +15,7 @@ from aurweb.packages.search import PackageSearch
|
||||||
from aurweb.packages.util import get_pkg_or_base
|
from aurweb.packages.util import get_pkg_or_base
|
||||||
from aurweb.pkgbase import actions as pkgbase_actions
|
from aurweb.pkgbase import actions as pkgbase_actions
|
||||||
from aurweb.pkgbase import util as pkgbaseutil
|
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__)
|
logger = logging.get_logger(__name__)
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
@ -125,7 +125,7 @@ async def packages_get(request: Request, context: Dict[str, Any],
|
||||||
|
|
||||||
@router.get("/packages")
|
@router.get("/packages")
|
||||||
async def packages(request: Request) -> Response:
|
async def packages(request: Request) -> Response:
|
||||||
context = make_context(request, "Packages")
|
context = await make_variable_context(request, "Packages")
|
||||||
return await packages_get(request, context)
|
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)
|
has_cred = request.user.has_credential(creds.PKGBASE_FLAG)
|
||||||
if has_cred and not pkgbase.OutOfDateTS:
|
if has_cred and not pkgbase.OutOfDateTS:
|
||||||
notif = notify.FlagNotification(request.user.ID, pkgbase.ID)
|
|
||||||
now = time.utcnow()
|
now = time.utcnow()
|
||||||
with db.begin():
|
with db.begin():
|
||||||
pkgbase.OutOfDateTS = now
|
pkgbase.OutOfDateTS = now
|
||||||
pkgbase.Flagger = request.user
|
pkgbase.Flagger = request.user
|
||||||
pkgbase.FlaggerComment = comments
|
pkgbase.FlaggerComment = comments
|
||||||
notif.send()
|
|
||||||
|
notify.FlagNotification(request.user.ID, pkgbase.ID).send()
|
||||||
|
|
||||||
return RedirectResponse(f"/pkgbase/{name}",
|
return RedirectResponse(f"/pkgbase/{name}",
|
||||||
status_code=HTTPStatus.SEE_OTHER)
|
status_code=HTTPStatus.SEE_OTHER)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#
|
#
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "aurweb"
|
name = "aurweb"
|
||||||
version = "v6.0.13"
|
version = "v6.0.14"
|
||||||
license = "GPL-2.0-only"
|
license = "GPL-2.0-only"
|
||||||
description = "Source code for the Arch User Repository's website"
|
description = "Source code for the Arch User Repository's website"
|
||||||
homepage = "https://aur.archlinux.org"
|
homepage = "https://aur.archlinux.org"
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
{% if SB == "n" %}
|
{% if SB == "n" %}
|
||||||
{% set order = "d" if order == "a" else "a" %}
|
{% set order = "d" if order == "a" else "a" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/packages/?SB=n&SO={{ order }}">
|
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'n'), ('SO', order)) | urlencode }}">
|
||||||
{{ "Name" | tr }}
|
{{ "Name" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
{% if SB == "v" %}
|
{% if SB == "v" %}
|
||||||
{% set order = "d" if order == "a" else "a" %}
|
{% set order = "d" if order == "a" else "a" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/packages/?SB=v&SO={{ order }}">
|
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'v'), ('SO', order)) | urlencode }}">
|
||||||
{{ "Votes" | tr }}
|
{{ "Votes" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
{% if SB == "p" %}
|
{% if SB == "p" %}
|
||||||
{% set order = "d" if order == "a" else "a" %}
|
{% set order = "d" if order == "a" else "a" %}
|
||||||
{% endif %}
|
{% 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>
|
</th>
|
||||||
{% if request.user.is_authenticated() %}
|
{% if request.user.is_authenticated() %}
|
||||||
<th>
|
<th>
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
{% if SB == "w" %}
|
{% if SB == "w" %}
|
||||||
{% set order = "d" if order == "a" else "a" %}
|
{% set order = "d" if order == "a" else "a" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/packages/?SB=w&SO={{ order }}">
|
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'w'), ('SO', order)) | urlencode }}">
|
||||||
{{ "Voted" | tr }}
|
{{ "Voted" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
{% if SB == "o" %}
|
{% if SB == "o" %}
|
||||||
{% set order = "d" if order == "a" else "a" %}
|
{% set order = "d" if order == "a" else "a" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/packages/?SB=o&SO={{ order }}">
|
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'o'), ('SO', order)) | urlencode }}">
|
||||||
{{ "Notify" | tr }}
|
{{ "Notify" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
{% if SB == "m" %}
|
{% if SB == "m" %}
|
||||||
{% set order = "d" if order == "a" else "a" %}
|
{% set order = "d" if order == "a" else "a" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="/packages/?SB=m&SO={{ order }}">
|
<a href="/packages?{{ q | extend_query(('O', 0), ('SB', 'm'), ('SO', order)) | urlencode }}">
|
||||||
{{ "Maintainer" | tr }}
|
{{ "Maintainer" | tr }}
|
||||||
</a>
|
</a>
|
||||||
</th>
|
</th>
|
||||||
|
|
Loading…
Add table
Reference in a new issue