summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-02-28 21:05:13 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-02-28 21:05:13 -0500
commit9e90f1968802d350157bcbeef0cebd7d96eb1ada (patch)
tree1153f677b807c9d7f40ef2ce4f9ab692ac6979a0 /packages
parent60f9b3fe60d5e5b6049ef71d1dfb25dade4fd6a3 (diff)
parent20e9a83e05e352ec6e6f8fbe70457951cf9cd047 (diff)
Merge commit '20e9a83' from Archweb
Conflicts: main/fixtures/groups.json packages/templatetags/package_extras.py
Diffstat (limited to 'packages')
-rw-r--r--packages/templatetags/package_extras.py14
-rw-r--r--packages/views/__init__.py6
2 files changed, 18 insertions, 2 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index a2f2387e..a8a8bd0f 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -61,7 +61,7 @@ def multi_pkg_details(pkgs):
return ', '.join([pkg_details_link(pkg) for pkg in pkgs])
@register.simple_tag
-def userpkgs(user):
+def maintainer_link(user):
if user:
# TODO don't hardcode
title = escape('View packages maintained by ' + user.get_full_name())
@@ -85,6 +85,18 @@ def get_download_link(package):
return linkbase % parts
@register.simple_tag
+def packager_link(user):
+ if user:
+ # TODO don't hardcode
+ title = escape('View packages packaged by ' + user.get_full_name())
+ return '<a href="/packages/?packager=%s" title="%s">%s</a>' % (
+ user.username,
+ title,
+ user.get_full_name(),
+ )
+ return ''
+
+@register.simple_tag
def get_wiki_link(package):
url = "//wiki.parabolagnulinux.org/index.php"
data = {
diff --git a/packages/views/__init__.py b/packages/views/__init__.py
index bbfe7c9f..7a8dabd5 100644
--- a/packages/views/__init__.py
+++ b/packages/views/__init__.py
@@ -169,13 +169,17 @@ def files(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
fileslist = PackageFile.objects.filter(pkg=pkg).order_by('directory', 'filename')
+ dir_count = sum(1 for f in fileslist if f.is_directory)
+ files_count = len(fileslist) - dir_count
context = {
'pkg': pkg,
'files': fileslist,
+ 'files_count': files_count,
+ 'dir_count': dir_count,
}
template = 'packages/files.html'
if request.is_ajax():
- template = 'packages/files-list.html'
+ template = 'packages/files_list.html'
return direct_to_template(request, template, context)
def details_json(request, name, repo, arch):