Verified Commit 36116309 authored by Kevin Morris's avatar Kevin Morris
Browse files

fix: /packages search ordering links



This was not including other parameters that should be persisted for
users.

Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
parent 040c9bc3
......@@ -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)
......
......@@ -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>
......
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