diff --git a/gittip/models/participant.py b/gittip/models/participant.py index 625dd3145f..66ace60ab5 100644 --- a/gittip/models/participant.py +++ b/gittip/models/participant.py @@ -304,6 +304,21 @@ def get_age_in_seconds(self): out = (now - self.claimed_time).total_seconds() return out + def get_teams(self): + """Return a list of teams this user is a member of. + """ + return list(gittip.db.fetchall(""" + + SELECT team AS name + , ( SELECT count(*) + FROM current_memberships + WHERE team=team + ) AS nmembers + FROM current_memberships + WHERE member=%s; + + """, (self.username,))) + # Participant as Team # =================== diff --git a/scss/modules.scss b/scss/modules.scss index 9f9603ffc1..8a29cc4745 100644 --- a/scss/modules.scss +++ b/scss/modules.scss @@ -149,8 +149,8 @@ a.mini-user:hover { } } -UL.community-memberships { - margin: 1em 0; +UL.memberships { + margin: 0 0 2em; padding: 0; float: left; width: 100%; diff --git a/templates/profile-edit.html b/templates/profile-edit.html index ef0db7497e..e184bd18fa 100644 --- a/templates/profile-edit.html +++ b/templates/profile-edit.html @@ -55,10 +55,12 @@
At least {{ THRESHOLD }} members
-