diff options
author | Dan McGee <dan@archlinux.org> | 2011-08-09 22:53:01 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-09 22:53:01 -0500 |
commit | 21461e78608bb687d7101dd55e72d44cbebf2ff6 (patch) | |
tree | 6e2f9be8148a177272b5b5d6ce3421fffc6bea20 /packages | |
parent | 0f6c80e9a36bc5770e95543b4374c5ace4383cf5 (diff) |
Add package details link tag
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/package_extras.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index e089b723..14a519d4 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -37,6 +37,11 @@ def do_buildsortqs(parser, token): return BuildQueryStringNode(sortfield[1:-1]) @register.simple_tag +def pkg_details_link(pkg): + template = '<a href="%s" title="View package details for %s">%s</a>' + return template % (pkg.get_absolute_url(), pkg.pkgname, pkg.pkgname) + +@register.simple_tag def userpkgs(user): if user: # TODO don't hardcode @@ -48,7 +53,6 @@ def userpkgs(user): ) return '' - def svn_link(package, svnpath): '''Helper function for the two real SVN link methods.''' parts = (package.repo.svn_root, package.pkgbase, svnpath) |