summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-30 13:55:36 -0600
committerDan McGee <dan@archlinux.org>2011-11-30 13:55:36 -0600
commit6b8ef446bcd6a1cbc794d0846968e806034d3aad (patch)
treeb9e6fcba31717369953fa330f179cd48fc4fbea1 /main
parentda61fed4be6a28c870580f448c7c486f46d7b088 (diff)
downloadarchweb-6b8ef446bcd6a1cbc794d0846968e806034d3aad.tar.gz
archweb-6b8ef446bcd6a1cbc794d0846968e806034d3aad.zip
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')
-rw-r--r--main/models.py12
-rw-r--r--main/templatetags/pgp.py13
2 files changed, 25 insertions, 0 deletions
diff --git a/main/models.py b/main/models.py
index 990cc8ca..9156fb51 100644
--- a/main/models.py
+++ b/main/models.py
@@ -53,6 +53,18 @@ class UserProfile(models.Model):
verbose_name = 'Additional Profile Data'
verbose_name_plural = 'Additional Profile Data'
+ def get_absolute_url(self):
+ # TODO: this is disgusting. find a way to consolidate this logic with
+ # public.views.userlist among other places, and make some constants or
+ # something so we aren't using copies of string names everywhere.
+ group_names = self.user.groups.values_list('name', flat=True)
+ if "Developers" in group_names:
+ prefix = "developers"
+ elif "Trusted Users" in group_names:
+ prefix = "trustedusers"
+ else:
+ prefix = "fellows"
+ return '/%s/#%s' % (prefix, self.user.username)
class TodolistManager(models.Manager):
def incomplete(self):
diff --git a/main/templatetags/pgp.py b/main/templatetags/pgp.py
index 67f5e08d..d69e2918 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: