From 4def86ec76d9975be8a357b6fc06104cc2b31fed Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 18:03:42 -0500 Subject: Package search HTML cleanups Signed-off-by: Dan McGee --- templates/packages/search.html | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'templates/packages/search.html') diff --git a/templates/packages/search.html b/templates/packages/search.html index d312c374..db86fb67 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -2,7 +2,7 @@ {% load cycle from future %} {% load package_extras %} -{% block title %}Arch Linux - Package Database{% endblock %} +{% block title %}Arch Linux - Package Search{% endblock %} {% block navbarclass %}anb-packages{% endblock %} {% block head %} @@ -12,10 +12,7 @@ {% block content %} - - + {% if package_list %}
{% include "packages/search_paginator.html" %}
{% csrf_token %} - @@ -96,10 +91,8 @@

{% endif %} - - - + {% else %}

We couldn't find any packages matching your query. Try searching again -- cgit v1.2.3-2-g168b From 061805aa73d3d5b418a61fa6d6591d1a7d03d9ed Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 18:28:26 -0500 Subject: FS#30773: put exact matches at top There have been a few proposed solutions to this, but there really isn't anything without a drawback. Things break pagination, require loading the entire result set from the database, etc. Just plop a new table on the page if someone did a so-called "simple" search and we have a match. Only show on the first page of the search results. This results in a relatively fast experience for someone doing something like searching for the "perl" package. Signed-off-by: Dan McGee --- templates/packages/search.html | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'templates/packages/search.html') diff --git a/templates/packages/search.html b/templates/packages/search.html index db86fb67..ca95c3f0 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -40,6 +40,42 @@

+{% if not is_paginated or page_obj.number == 1 %}{% with search_form.exact_matches as exact_matches %}{% if exact_matches %} +
+
+

{{ exact_matches|length }} exact match{{ exact_matches|pluralize:"es" }} found.

+
+
+ + + + + + + + + + + + + {% for pkg in exact_matches %} + + + + {% if pkg.flag_date %} + + {% else %} + + {% endif %} + + + + {% endfor %} + +
ArchRepoNameVersionDescriptionLast UpdatedFlag Date
{{ pkg.arch.name }}{{ pkg.repo.name|capfirst }}{% pkg_details_link pkg %}{{ pkg.full_version }}{{ pkg.full_version }}{{ pkg.pkgdesc }}{{ pkg.last_update|date }}{{ pkg.flag_date|date }}
+
+{% endif %}{% endwith %}{% endif %} + {% if package_list %}
{% include "packages/search_paginator.html" %} -- cgit v1.2.3-2-g168b From 21b8ff5cf2b60f862e3fc3cfb43d8d8af0d6189f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 19:21:26 -0500 Subject: Tweak search results page a bit more Signed-off-by: Dan McGee --- templates/packages/search.html | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'templates/packages/search.html') diff --git a/templates/packages/search.html b/templates/packages/search.html index ca95c3f0..d4a47b26 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -58,7 +58,8 @@ - {% for pkg in exact_matches %} + {% for pkg in exact_matches %} + {{ pkg.arch.name }} {{ pkg.repo.name|capfirst }} {% pkg_details_link pkg %} @@ -70,13 +71,13 @@ {{ pkg.pkgdesc }} {{ pkg.last_update|date }} {{ pkg.flag_date|date }} - {% endfor %} + + {% endfor %}
{% endif %}{% endwith %}{% endif %} -{% if package_list %}
{% include "packages/search_paginator.html" %}
{% csrf_token %} @@ -101,7 +102,8 @@ - {% for pkg in package_list %} + {% for pkg in package_list %} + {% if perms.main.change_package %} {% endif %} @@ -116,7 +118,10 @@ {{ pkg.pkgdesc }} {{ pkg.last_update|date }} {{ pkg.flag_date|date }} - {% endfor %} + + {% empty %} + No matching packages found + {% endfor %} {% include "packages/search_paginator.html" %} @@ -129,21 +134,16 @@ {% endif %}
-{% else %} -
-

We couldn't find any packages matching your query. Try searching again + +

+

Can't find what you are looking for? Try searching again using different criteria, or try {% if search_form.q.data %} searching the AUR {% else %}searching the AUR{% endif %} to see if the package can be found there.

-
-{% endif %} -

You are browsing the Arch Linux package database. From here you can find - detailed information about packages located in the official supported repositories. - For unsupported packages, browse the Arch User Repository (AUR).

+ detailed information about packages located in the official supported repositories.

{% endblock %} -- cgit v1.2.3-2-g168b