diff options
-rw-r--r-- | packages/templatetags/jinja2.py | 26 | ||||
-rw-r--r-- | templates/packages/details.html.jinja | 14 |
2 files changed, 8 insertions, 32 deletions
diff --git a/packages/templatetags/jinja2.py b/packages/templatetags/jinja2.py index 263fc156..22f9914b 100644 --- a/packages/templatetags/jinja2.py +++ b/packages/templatetags/jinja2.py @@ -25,32 +25,6 @@ def link_encode(url, query): @library.global_function -def maintainer_link(user): - if user: - # TODO don't hardcode - title = escape('View packages maintained by ' + user.get_full_name()) - return '<a href="/packages/?maintainer=%s" title="%s">%s</a>' % ( - user.username, - title, - user.get_full_name(), - ) - return '' - - -@library.global_function -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 '' - - -@library.global_function def pgp_key_link(key_id, link_text=None): return pgp.pgp_key_link(key_id, link_text) diff --git a/templates/packages/details.html.jinja b/templates/packages/details.html.jinja index 7ca5629c..52d13f14 100644 --- a/templates/packages/details.html.jinja +++ b/templates/packages/details.html.jinja @@ -149,11 +149,10 @@ <tr> <th>Maintainers:</th> {% with maints = pkg.maintainers %} - <td>{% if maints %} - {% for m in maints %} - {{ maintainer_link(m)|safe }}<br/> - {% endfor %} - {% else %}Orphan{% endif %} + <td>{% if maints %}{% for m in maints %} + <a href="/packages/?maintainer={{ m.username }}" + title="View packages maintained by {{ m.get_full_name() }}">{{ m.get_full_name() }}</a><br/> + {% endfor %}{% else %}Orphan{% endif %} </td> {% endwith %} </tr><tr> @@ -164,7 +163,10 @@ <td>{{ pkg.installed_size|filesizeformat }}</td> </tr><tr> <th>Last Packager:</th> - <td>{% with pkgr = pkg.packager %}{% if pkgr %}{{ packager_link(pkgr)|safe }}{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td> + <td>{% with pkgr = pkg.packager %}{% if pkgr %} + <a href="/packages/?packager={{ pkgr.username }}" + title="View packages packaged by {{ pkgr.get_full_name() }}">{{ pkgr.get_full_name() }}</a> + {% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td> </tr><tr> <th>Build Date:</th> <td>{{ pkg.build_date|date("DATETIME_FORMAT") }} UTC</td> |