diff --git a/src/accounts/models.py b/src/accounts/models.py index 9416823..31d4524 100644 --- a/src/accounts/models.py +++ b/src/accounts/models.py @@ -1,7 +1,8 @@ +import urlparse + from django.db import models from django.contrib.auth.models import AbstractUser - from django.core.urlresolvers import reverse @@ -17,6 +18,12 @@ class User(AbstractUser): def get_absolute_url(self): return reverse('user_profile', kwargs={'username': self.username}) + def twitter_link(self): + return urlparse.urljoin('https://twitter.com', self.twitter) + + def facebook_link(self): + return urlparse.urljoin('https://www.facebook.com', self.facebook) + # We need to have `email` field set as unique but Django does not # support field overriding (at least not until 1.6). # The following workaroud allows to change email field to unique diff --git a/src/accounts/templates/accounts/user_detail.html b/src/accounts/templates/accounts/user_detail.html index adbfcad..ab68684 100644 --- a/src/accounts/templates/accounts/user_detail.html +++ b/src/accounts/templates/accounts/user_detail.html @@ -9,7 +9,7 @@ {% block main-content %}
-
+
{% gravatar user_.email 200 %}
@@ -43,23 +43,26 @@ {% endif %} {% if request.user.is_active %} +
  • {% if user_.twitter %} -
  • {{ user_.twitter }}
  • + {{ user_.twitter }} {% endif %} {% if user_.facebook %} -
  • {{ user_.facebook }}
  • + {{ user_.facebook }} {% endif %} + + {% if user_.google_talk %}
  • {{ user_.google_talk }}
  • {% endif %} {% if user_.webpage %} -
  • {{ user_.webpage }}
  • +
  • {{ user_.webpage }}
  • {% endif %} {% endif %}
    -
    +

    {% trans "Contributions by Area" %}

    -- libgit2 0.21.2