summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-11-27 22:07:49 +0100
committerDan McGee <dan@archlinux.org>2013-11-27 22:07:49 +0100
commit58356ec5b38c71204895eb77856a45ffd7ac1725 (patch)
tree4b4700dc2d281fc61c1713b16204603334f442f2 /packages
parente557545ca803fa215b3a7f43f4c421dff1259fe3 (diff)
downloadarchweb-58356ec5b38c71204895eb77856a45ffd7ac1725.tar.gz
archweb-58356ec5b38c71204895eb77856a45ffd7ac1725.tar.xz
Allow pkg_details_link to honor package flag state
This allows the tag to be used in a few more places we weren't already able to use it, and hopefully speeds up rendering a tad on the package differences page. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/templatetags/package_extras.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py
index f7392a9..3ce6474 100644
--- a/packages/templatetags/package_extras.py
+++ b/packages/templatetags/package_extras.py
@@ -67,13 +67,16 @@ def do_buildsortqs(parser, token):
@register.simple_tag
-def pkg_details_link(pkg, link_title=None):
+def pkg_details_link(pkg, link_title=None, honor_flagged=False):
if not pkg:
return link_title or ''
if link_title is None:
link_title = pkg.pkgname
+ link_content = link_title
+ if honor_flagged and pkg.flag_date:
+ link_content = '<span class="flagged">%s</span>' % link_title
link = '<a href="%s" title="View package details for %s">%s</a>'
- return link % (pkg.get_absolute_url(), pkg.pkgname, link_title)
+ return link % (pkg.get_absolute_url(), pkg.pkgname, link_content)
@register.simple_tag