# HG changeset patch # User Brian Neal # Date 1343091071 18000 # Node ID cebfaa23346234301439a6e6a118300a7223c76e # Parent 6a313b1f1201b3b92bc5960ceeb5fd4f060b5a9d Show non-active status on view profile page. Bitbucket issue #14. diff -r 6a313b1f1201 -r cebfaa233462 bio/templatetags/bio_tags.py --- a/bio/templatetags/bio_tags.py Mon Jul 23 19:50:38 2012 -0500 +++ b/bio/templatetags/bio_tags.py Mon Jul 23 19:51:11 2012 -0500 @@ -5,6 +5,7 @@ from django.conf import settings from django.core.cache import cache +import bio.models from bio.models import UserProfile @@ -80,3 +81,17 @@ """ return {'username': username, 'trailing_text': trailing_text } + + +@register.simple_tag +def profile_status(profile): + """Returns a string to indicate member status for use on the view profile + page. + + """ + if (profile.status == bio.models.STA_ACTIVE or + profile.status == bio.models.STA_STRANGER): + return u'' + else: + return u'(%s)' % profile.get_status_display() + diff -r 6a313b1f1201 -r cebfaa233462 sg101/templates/bio/view_profile.html --- a/sg101/templates/bio/view_profile.html Mon Jul 23 19:50:38 2012 -0500 +++ b/sg101/templates/bio/view_profile.html Mon Jul 23 19:51:11 2012 -0500 @@ -38,7 +38,7 @@ Full Name{{ subject.get_full_name }} Date Joined{{ subject.date_joined|date:"F d, Y" }} Last Login{% forum_date subject.last_login user %} - Active Member{% bool_icon subject.is_active %} + Active Member{% bool_icon subject.is_active %} {% profile_status profile %} Staff Member{% bool_icon subject.is_staff %} {% if profile.location %} Location{{ profile.location }}