diff options
author | Dan McGee <dan@archlinux.org> | 2010-02-27 10:08:04 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-02-27 13:36:58 -0600 |
commit | 8314777c5858b8f9dd954ef906e19de1322a61d0 (patch) | |
tree | b4ba12ced99c71ea844a05396abc9d4b64793223 /packages | |
parent | 1cea5fc32e5fe213137cac0323d27bcc9cbc7d8b (diff) |
Make files view AJAX if supported
This will put the filelist inline on the package details page if using a
capable browser. It should still fallback to a separate page if necessary
(e.g. all those users using links on the site).
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/views.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/views.py b/packages/views.py index 9956b6ce..c5f87865 100644 --- a/packages/views.py +++ b/packages/views.py @@ -182,7 +182,10 @@ def files(request, name='', repo='', arch=''): pkg = get_object_or_404(Package, pkgname=name, repo__name__iexact=repo, arch__name=arch) files = PackageFile.objects.filter(pkg=pkg).order_by('path') - return render_to_response('packages/files.html', RequestContext(request, {'pkg':pkg,'files':files})) + template = 'packages/files.html' + if request.is_ajax(): + template = 'packages/files-ajax.html' + return render_to_response(template, RequestContext(request, {'pkg':pkg,'files':files})) @permission_required('main.change_package') def unflag(request, pkgid): |