summaryrefslogtreecommitdiffstats
path: root/main/templatetags
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-30 20:55:36 +0100
committerDan McGee <dan@archlinux.org>2011-11-30 20:55:36 +0100
commit6b8ef446bcd6a1cbc794d0846968e806034d3aad (patch)
treeb9e6fcba31717369953fa330f179cd48fc4fbea1 /main/templatetags
parentda61fed4be6a28c870580f448c7c486f46d7b088 (diff)
downloadarchweb-6b8ef446bcd6a1cbc794d0846968e806034d3aad.tar.gz
archweb-6b8ef446bcd6a1cbc794d0846968e806034d3aad.tar.xz
Add master key overview page
And a bunch of text that may suck, but is better than nothing. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/templatetags')
-rw-r--r--main/templatetags/pgp.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py
index 67f5e08..d69e291 100644
--- a/main/templatetags/pgp.py
+++ b/main/templatetags/pgp.py
@@ -1,5 +1,7 @@
from django import template
from django.conf import settings
+from django.utils.html import conditional_escape
+from django.utils.safestring import mark_safe
register = template.Library()
@@ -26,4 +28,15 @@ def pgp_key_link(key_id):
values = (url, format_key(key_id), key_id[-8:])
return '<a href="%s" title="PGP key search for %s">0x%s</a>' % values
+@register.filter
+def pgp_fingerprint(key_id, autoescape=True):
+ if not key_id:
+ return u''
+ if autoescape:
+ esc = conditional_escape
+ else:
+ esc = lambda x: x
+ return mark_safe(format_key(esc(key_id)))
+pgp_fingerprint.needs_autoescape = True
+
# vim: set ts=4 sw=4 et: