summaryrefslogtreecommitdiff
path: root/packages/views
AgeCommit message (Collapse)Author
2015-08-05Merge branch 'archweb' into archweb-genericLuke Shumaker
2015-04-16Merge tag 'release_2015-04-13' into archweb-genericLuke Shumaker
Fix up 'None' display in places
2015-04-15Merge tag 'release_2014-12-08' into archweb-genericLuke Shumaker
Minor fixes and package updates
2015-04-15Fix error in test where HTTP_HOST doesn't existDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2015-04-13Merge tag 'release_2014-10-20' into archweb-genericLuke Shumaker
A few Jinja2 fixes and some perf changes
2015-04-13Merge tag 'release_2014-10-19' into archweb-genericLuke Shumaker
Jinja2 switch for some templates, exact matches in package search
2015-01-29Ensure packager=unknown query works as expectedDan McGee
I broke this in commit dca00e7aab, whoops! Signed-off-by: Dan McGee <dan@archlinux.org>
2014-12-02Filter maintainer list on packages page by allowed reposDan McGee
We do this elsewhere on the master keys page, so do the same thing here. Noticed-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2014-10-19Use varied prime numbers for caching lengthsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2014-10-18FS#30773: put exact matches at topDan McGee
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 <dan@archlinux.org>
2014-10-02Merge branch 'archweb' into archweb-genericLuke Shumaker
Conflicts: templates/public/download.html templates/public/index.html
2014-09-01More changes for move to Django 1.7Dan McGee
The removal of the root `__init__.py` file is so the testing framework does consistent imports of our models now that the loading strategy has changed. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-11-28Merge tag 'release_2013-11-25' into archweb-genericLuke Shumaker
Django 1.6 upgrade and other changes Conflicts: templates/news/list.html templates/public/index.html
2013-11-06Django 1.6 upgrade, deprecation cleanupDan McGee
PendingDeprecationWarning: commit_on_success is deprecated in favor of atomic. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-21Merge branch 'archweb' into archweb-generic2Luke Shumaker
2013-04-21Merge branch 'archweb' into archweb-generic2Luke Shumaker
Conflicts: devel/views.py feeds.py public/views.py settings.py sitestatic/archweb.js templates/base.html templates/devel/profile.html templates/mirrors/status.html templates/news/view.html templates/packages/flaghelp.html templates/packages/opensearch.xml templates/public/download.html templates/public/feeds.html templates/public/index.html templates/registration/login.html templates/releng/results.html templates/todolists/public_list.html
2013-04-16Various minor code cleanups and fixesrelease_2013-04-16Dan McGee
Most of these were suggested by PyCharm, and include everything from little syntax issues and other bad smells to dead or bad code. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-16Add shortcut for HEAD requests on slower viewsDan McGee
We sometimes see some web bots and crawlers make HEAD requests to verify existence of certain pages in the application. However, they are less than kind as 20-50 requests might arrive at the same time, and package search and details pages are some of the slowest rendering pages we have due to the Django template engine. Rather than waste time generating the content only to throw it away, response as soon as we can with either a 404 or 200 response as appropriate, omitting the 'Content-Length' header completely, which seems to be acceptable by the HTTP spec. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-16Use require_safe decorator rather than require_GETDan McGee
This was added in Django 1.4, and ensures both GET and HEAD requests, but not POST requests, are allowed through. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-13Show replacments for package if it has been removedDan McGee
This covers the case where we can't find the package in any other repositories, but it was removed recently enough that we have a found package update object. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-03-27Pull references to Arch Linux in code into BRANDING_ variables in settingsLuke Shumaker
This does not include templates
2013-02-26Use user.userprofile rather than user.get_profile()Dan McGee
The get_profile() function is deprecated as of Django 1.5. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-26Merge branch 'django-1.5'Dan McGee
Conflicts: requirements.txt requirements_prod.txt
2013-02-20Fix some fallout with moving page to query paramsDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-16Make page a query string parameter on package searchDan McGee
This is a bit silly to encode in the URL, or at least makes it much harder to screen out via robots.txt and other such things. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-16Remove configurable pagination for package searchDan McGee
Switch it to a hardcoded value of 100 for all searches instead. It didn't make much sense having a page number be part of the URL and a limit value being part of the query string. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-09Use 'update_fields' model.save() kwargDan McGee
This was added in Django 1.5 and allows saving only a subset of a model's fields. It makes sense in a few cases to utilize it. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-02-08Remove package seach by 'Last Updated After'Dan McGee
It is a lot easier to just sort the list rather than mess with this particular field, which didn't even allow you to specify a range or direction to search in. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Use more modern verison of string template formattingDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-23Use querysets for calls to get_object_or_404(Package)Dan McGee
This works better in most cases since we need the architecture and repository objects at some point during the view process. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-13Use content_type and not mimetype on HttpResponse()Dan McGee
Bug #16519 in Django deprecates mimetype, so update our code accordingly. Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-12Make packages JSON search more performantrelease_2013-01-12Dan McGee
We were peppering the database with a bunch of queries here; using prefetch_related and attach_maintainers can cut down the count significantly. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16Use python set comprehension syntax supported in 2.7Dan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16Use Python 2.7 dictionary comprehension syntaxDan McGee
Rather than the old idiom of dict((k, v) for <> in <>). Signed-off-by: Dan McGee <dan@archlinux.org>
2012-10-26Extract some common architecture grabbing logicDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-30Fix usage of naïve datetime objectDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-30Hide staging packages in search resultsDan McGee
This is for users that aren't logged in; developers will still see them. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25Don't show staging in package search repo listingDan McGee
This is temporary or at least a quick way to ensure regular users aren't confused by staging packages; later updates should re-enable display of this for logged in developers and trusted users. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-15Remove now unnecessary importrelease_2012-09-15Dan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-08p/v/flag: Add reply-to to out-of-date notificationsFlorian Pritz
Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-20Use case-insensitive search in opensearch suggestionsDan McGee
There is no real good reason not to do this, since our packages are lowercased by convention. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-13Attempt to screen for useless out-of-date messagesDan McGee
Things like ' ', '-', '.', etc. will no longer be accepted in this field. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-08-08Migrate flag request version info to new formatDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Revert "Fall back to 410 Gone for package files view as well"release_2012-07-31Dan McGee
This reverts commit 9ab460c53a1ac4c79da6f05f2850ee21beedbab2. This seemed like the right thing to do, but it doesn't really play well with our more general dispatch framework we now do on the package details pages. Just let it 404 like it always did, as these pages are less essential. We can perhaps add a full dispatcher later if we really feel the need.
2012-07-31Reuse removed template for packages with multiple replacementsDan McGee
For example, bitcoin-git in the Arch repos is currently marked replaced by both bitcoin-qt and bitcoin-daemon. This allows us to show a page with both options listed instead of a blank 404 page. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Add package details redirect for package replacementsDan McGee
This makes sense if there is only one available replacement. We could get more sophisticated and show the removed page if there are multiple replacements available. Additionally, automatically redirect if there was only one matching package for a given package update deletion object. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Rework package details dispatch codeDan McGee
We had a variety of fallback paths that we took if a details page didn't exist for the combination of URL parts passed in. Before I go adding a few more possibilities, rework this so it is more flexible. It is now as simple as adding a method to the dispatch options list in order to have further fallback options. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31Fix broken hidden input sort field on search formDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Replace deprecated list_detail usage in search with class-based viewDan McGee
We can convert the entire search view to a generic class-based ListView. This is still one of the more disgusting views in the application and has a ton of logic scattered buckshot across several methods, but this commit is not meant to address all of that in one go. This is the last of the deprecated pieces I know of we are still using in the codebase, so we should be relatively safe in the long run now for an upgrade to the eventual next major Django release. Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24Replace deprecated direct_to_template() with render() shortcutDan McGee
Now that Django actually provides a concise way to use a RequestContext object without instantiating it, we can use that rather than the old function-based generic view that worked well to do the same. Additionally, these function-based generic views will be gone in Django 1.5, so might as well make the move now. Signed-off-by: Dan McGee <dan@archlinux.org>