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 @@

Package Search

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

We couldn't find any packages matching your query. Try searching again -- cgit v1.2.3-54-g00ecf 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 --- packages/views/search.py | 6 ++++++ templates/packages/search.html | 36 ++++++++++++++++++++++++++++++++ templates/packages/search_paginator.html | 4 ++-- 3 files changed, 44 insertions(+), 2 deletions(-) (limited to 'templates/packages/search.html') diff --git a/packages/views/search.py b/packages/views/search.py index b3778172..0b776d79 100644 --- a/packages/views/search.py +++ b/packages/views/search.py @@ -45,6 +45,12 @@ def __init__(self, *args, **kwargs): [('', 'All'), ('unknown', 'Unknown')] + \ [(m.username, m.get_full_name()) for m in maints] + def exact_matches(self): + # only do exact match search if 'q' is sole parameter + if self.changed_data != ['q']: + return [] + return Package.objects.normal().filter(pkgname=self.cleaned_data['q']) + def parse_form(form, packages): if form.cleaned_data['repo']: 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 @@

Package Search

+{% 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" %} diff --git a/templates/packages/search_paginator.html b/templates/packages/search_paginator.html index 4c2bef03..a748d26b 100644 --- a/templates/packages/search_paginator.html +++ b/templates/packages/search_paginator.html @@ -1,6 +1,6 @@
{% if is_paginated %} -

{{ paginator.count }} packages found. +

{{ paginator.count }} matching packages found. Page {{ page_obj.number }} of {{ paginator.num_pages }}.

@@ -22,6 +22,6 @@
{% else %} -

{{ package_list|length }} packages found.

+

{{ package_list|length }} matching package{{ package_list|pluralize }} found.

{% endif %}
-- cgit v1.2.3-54-g00ecf 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 --- sitestatic/archweb.css | 4 ++++ templates/packages/search.html | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'templates/packages/search.html') diff --git a/sitestatic/archweb.css b/sitestatic/archweb.css index 53fa6274..edabcfb7 100644 --- a/sitestatic/archweb.css +++ b/sitestatic/archweb.css @@ -701,6 +701,10 @@ table.results { color: red; } + .results tr.empty td { + text-align: center; + } + /* pkglist: layout */ #pkglist-about { margin-top: 1.5em; 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 @@

Package Search

- {% 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 @@

Package Search

{{ 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 @@

Package Search

- {% for pkg in package_list %} + {% for pkg in package_list %} + {% if perms.main.change_package %} {% endif %} @@ -116,7 +118,10 @@

Package Search

{{ 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 @@

Package Search

{% 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-54-g00ecf From 65e3ef63f7475a217da5205a788f52f3888ebea7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 14 Apr 2015 02:17:54 -0400 Subject: Replace usage of parabolagnulinux.org with parabola.nu, also replace repo.parabola.nu/isos/ with /iso/, in settings.py --- common.mk | 2 +- main/templatetags/wiki.py | 4 ++-- packages/templatetags/jinja2.py | 4 ++-- public/views.py | 2 +- settings.py | 14 +++++++------- templates/packages/search.html | 2 +- templates/public/art.html | 2 +- templates/public/https.html | 2 +- templates/public/index.html | 4 ++-- urls.py | 6 +++--- 10 files changed, 21 insertions(+), 21 deletions(-) (limited to 'templates/packages/search.html') diff --git a/common.mk b/common.mk index 35f0b3bb..92f26337 100644 --- a/common.mk +++ b/common.mk @@ -22,7 +22,7 @@ $(www)/https/%: touch '$@' $(branding)/%: - gitget checkout 'git://projects.parabolagnulinux.org/artwork.git#branch=master' '$(artwork)' + gitget checkout 'git://projects.parabola.nu/artwork.git#branch=master' '$(artwork)' make -C '$(branding)' .PHONY: PHONY diff --git a/main/templatetags/wiki.py b/main/templatetags/wiki.py index 4a3b2f83..e3ffb138 100644 --- a/main/templatetags/wiki.py +++ b/main/templatetags/wiki.py @@ -4,6 +4,6 @@ @register.simple_tag def wiki_url(article=""): if article == "": - return "https://wiki.parabolagnulinux.org/" + return "https://wiki.parabola.nu/" else: - return "https://wiki.parabolagnulinux.org/"+article.replace(' ', '_') + return "https://wiki.parabola.nu/"+article.replace(' ', '_') diff --git a/packages/templatetags/jinja2.py b/packages/templatetags/jinja2.py index c9d602a6..86bbd03e 100644 --- a/packages/templatetags/jinja2.py +++ b/packages/templatetags/jinja2.py @@ -33,13 +33,13 @@ def pgp_key_link(key_id, link_text=None): def scm_link(package, operation): parts = ("abslibre", operation, package.repo.name.lower(), package.pkgbase) linkbase = ( - "https://projects.parabolagnulinux.org/%s.git/%s/%s/%s") + "https://projects.parabola.nu/%s.git/%s/%s/%s") return linkbase % tuple(urlquote(part.encode('utf-8')) for part in parts) @library.global_function def wiki_link(package): - url = "https://wiki.parabolagnulinux.org/index.php" + url = "https://wiki.parabola.nu/index.php" data = { 'title': "Special:Search", 'search': package.pkgname, diff --git a/public/views.py b/public/views.py index 7414b330..1197322d 100644 --- a/public/views.py +++ b/public/views.py @@ -83,7 +83,7 @@ def _mirror_urls(): @cache_control(max_age=307) def download(request): - return HttpResponseRedirect('https://wiki.parabolagnulinux.org/get') + return HttpResponseRedirect('https://wiki.parabola.nu/get') @cache_control(max_age=307) def feeds(request): diff --git a/settings.py b/settings.py index dc93eb1e..d0738e7b 100644 --- a/settings.py +++ b/settings.py @@ -13,7 +13,7 @@ MANAGERS = ADMINS # Package out-of-date emails for orphans -NOTIFICATIONS = ['dev@lists.parabolagnulinux.org'] +NOTIFICATIONS = ['dev@lists.parabola.nu'] # Full path to the data directory DEPLOY_PATH = os.path.dirname(os.path.realpath(__file__)) @@ -161,17 +161,17 @@ PGP_SERVER = 'pgp.mit.edu:11371' # URL to fetch a current list of available ISOs -ISO_LIST_URL = 'https://repo.parabolagnulinux.org/isos/' +ISO_LIST_URL = 'https://repo.parabola.nu/iso/' # URL to the PXE netboot instructions -PXEBOOT_URL = 'http://repo.parabolagnulinux.org/pxeboot/' +PXEBOOT_URL = 'http://repo.parabola.nu/pxeboot/' # URL for SVN access for fetching commit messages (note absence of packages or # community bit on the end, repo.svn_root is appended) #SVN_BASE_URL = 'svn://svn.archlinux.org/' # URL for linking to mailing lists -MAILMAN_BASE_URL = 'https://lists.parabolagnulinux.org/' +MAILMAN_BASE_URL = 'https://lists.parabola.nu/' # URL for linking to the bugtracker BUGTRACKER_URL = 'https://labs.parabola.nu/' @@ -180,7 +180,7 @@ BUGTRACKER_RELENG_URL = 'https://labs.parabola.nu/projects/isos' # URL for linking to projects in git -PROJECTS_URL = 'https://projects.parabolagnulinux.org' +PROJECTS_URL = 'https://projects.parabola.nu' # Trackers used for ISO download magnet links TORRENT_TRACKERS = ( @@ -189,14 +189,14 @@ 'udp://tracker.istole.it:80', ) -DOMAIN_RE = r'^(.+\.)?parabolagnulinux.org$' +DOMAIN_RE = r'^(.+\.)?parabola(\.nu|gnulinux\.org)$' BRANDING_APPNAME = 'parabolaweb' BRANDING_DISTRONAME = 'Parabola GNU/Linux-libre' BRANDING_SHORTNAME = 'Parabola' BRANDING_SLUG = 'parabola' BRANDING_WIKINAME = 'ParabolaWiki' -BRANDING_EMAIL = 'Parabola Website Notification ' +BRANDING_EMAIL = 'Parabola Website Notification ' BRANDING_OSEARCH_TAGS = 'gnu linuxlibre parabola package software' ## Import local settings diff --git a/templates/packages/search.html b/templates/packages/search.html index 7509864e..41e36193 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -141,7 +141,7 @@

Package Search

You are browsing the {{ BRANDING_DISTRONAME }} package database. From here you can find detailed information about packages located in the official supported repositories. If you need the sourceball from where a package is built, you can look at our sources repo.

{% endblock %} diff --git a/templates/public/art.html b/templates/public/art.html index 80c5ac95..32acc172 100644 --- a/templates/public/art.html +++ b/templates/public/art.html @@ -10,7 +10,7 @@

{{ BRANDING_DISTRONAME }} Logos and Artwork

You can help by creating artwork for {{ BRANDING_DISTRONAME }}.

-

Send your designs to dev@lists.parabolagnulinux.org and state they are CC-by-sa +

Send your designs to dev@lists.parabola.nu and state they are CC-by-sa or another free culture friendly license.

{% comment %} diff --git a/templates/public/https.html b/templates/public/https.html index df3e2c73..88056346 100644 --- a/templates/public/https.html +++ b/templates/public/https.html @@ -11,7 +11,7 @@

This is the unsecure version of the website

is the only page on the whole site that can be accessed without a secure connection, all other pages will redirect to the secure version.

-

Enter the secure site

+

Enter the secure site

But my browser says the secure site is untrusted

diff --git a/templates/public/index.html b/templates/public/index.html index 6ef6b4bf..64d19e6d 100644 --- a/templates/public/index.html +++ b/templates/public/index.html @@ -28,9 +28,9 @@

A fully free, simple, and lightweight operating system

Our community is friendly and helpful. Please hop on IRC channel and check out our - mailing + mailing lists to get your feet wet. Also glance through our - wiki if you want to learn + wiki if you want to learn more about Parabola.