From bb010b9438a007a934aa1ed3a1d379d5ae1792fd Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Sun, 11 Sep 2011 13:32:55 -0500 Subject: [PATCH] Added CLA info and gravator/robohash to user profile pages. --- django_website/accounts/views.py | 9 +++- .../templates/accounts/user_profile.html | 54 ++++++++++++++----- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/django_website/accounts/views.py b/django_website/accounts/views.py index 8025008f5..7d3fcce53 100644 --- a/django_website/accounts/views.py +++ b/django_website/accounts/views.py @@ -1,7 +1,14 @@ +import hashlib from django.shortcuts import render, get_object_or_404 from django.contrib.auth.models import User +from ..cla.models import find_agreements def user_profile(request, username): u = get_object_or_404(User, username=username) - ctx = {'user': u, 'user_can_commit': u.has_perm('auth.commit')} + ctx = { + 'user': u, + 'email_hash': hashlib.md5(u.email).hexdigest(), + 'user_can_commit': u.has_perm('auth.commit'), + 'clas': find_agreements(u), + } return render(request, "accounts/user_profile.html", ctx) diff --git a/django_website/templates/accounts/user_profile.html b/django_website/templates/accounts/user_profile.html index ab0d4c6c0..d2be0930d 100644 --- a/django_website/templates/accounts/user_profile.html +++ b/django_website/templates/accounts/user_profile.html @@ -1,20 +1,50 @@ {% extends "base_community.html" %} {% block title %}{{ user }} | djangoproject.com{% endblock %} +{% block extrahead %} + +{% endblock extrahead %} {% block content-related %}{% endblock %} {% block content %} -

{% firstof user.get_full_name user.username %}

-

Member since {{ user.date_joined.date }}.

- {% if user_can_commit %}

Committer!

{% endif %} - {% with user.owned_feeds.all as feeds %} - {% if feeds %} -

Community feeds:

-
  • - {% for f in feeds %} -
  • {{ f.title }}
  • - {% endfor %} - + +
    +

    {% firstof user.get_full_name user.username %}

    +

    + Member since {{ user.date_joined.date }}. +

    + {% if user_can_commit %}

    Committer!

    {% endif %} + {% if clas %} + {% for cla in clas %} + {% if cla.ccla %} + {# it's a corporate cla #} +

    + Contributions covered by CLA on file for {{ cla.ccla.company_name }} + (signed {{ cla.ccla.date_signed }}). +

    + {% else %} +

    + CLA on file (signed {{ cla.date_signed }}). +

    + {% endif %} + {% endfor %} {% endif %} - {% endwith %} + {% with user.owned_feeds.all as feeds %} + {% if feeds %} +

    Community feeds:

    + + {% endif %} + {% endwith %} +
    {% endblock content %}