diff options
author | Dan McGee <dan@archlinux.org> | 2011-12-03 12:50:55 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-12-03 12:50:55 -0600 |
commit | ff371bd37628ab6f66cf4add79bb67c276e49035 (patch) | |
tree | 908054f7a59123410e3e44a16597251f5610f170 | |
parent | 7911fd4ef7a0aece6f0b1963e6513d741382cd0d (diff) |
Convert packager link to search by packager
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | packages/templatetags/package_extras.py | 15 | ||||
-rw-r--r-- | templates/packages/details.html | 4 |
2 files changed, 16 insertions, 3 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 67c7fbbc..3eb7578d 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()) @@ -73,6 +73,19 @@ def userpkgs(user): return '' @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 scm_link(package, operation): parts = (package.repo.svn_root, operation, package.pkgbase) linkbase = ( diff --git a/templates/packages/details.html b/templates/packages/details.html index a9908012..ef6ee982 100644 --- a/templates/packages/details.html +++ b/templates/packages/details.html @@ -137,7 +137,7 @@ {% with pkg.maintainers as maints %} <td>{% if maints %} {% for m in maints %} - {% userpkgs m %}<br/> + {% maintainer_link m %}<br/> {% endfor %} {% else %}Orphan{% endif %} </td> @@ -150,7 +150,7 @@ <td>{{ pkg.installed_size|filesizeformat }}</td> </tr><tr> <th>Last Packager:</th> - <td>{% with pkg.packager as pkgr %}{% if pkgr %}{% userpkgs pkgr %}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td> + <td>{% with pkg.packager as pkgr %}{% if pkgr %}{% packager_link pkgr %}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td> </tr><tr> <th>Signed:</th> <td>{{ pkg.is_signed|yesno|capfirst }}</td> |