mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: /packages search ordering links
This was not including other parameters that should be persisted for users. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
040c9bc3e6
commit
361163098f
2 changed files with 8 additions and 8 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue