diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2013-08-01 16:59:03 +0000 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2013-08-02 10:54:23 +0200 |
commit | 544cde185f9f55deab7b0738561e0b073e765c6a (patch) | |
tree | e24a03f8792a65c59a0d10e4c5e3f4527049d160 /hyperkitty | |
parent | c14775c638735fd719a97f53cb119ccea37f2ba4 (diff) | |
download | hyperkitty-544cde185f9f55deab7b0738561e0b073e765c6a.tar.gz hyperkitty-544cde185f9f55deab7b0738561e0b073e765c6a.tar.xz hyperkitty-544cde185f9f55deab7b0738561e0b073e765c6a.zip |
Add the Gravatar on the public profile page
Diffstat (limited to 'hyperkitty')
-rw-r--r-- | hyperkitty/static/hyperkitty/css/hyperkitty-user.css | 21 | ||||
-rw-r--r-- | hyperkitty/templates/user_profile.html | 2 | ||||
-rw-r--r-- | hyperkitty/templates/user_public_profile.html | 8 | ||||
-rw-r--r-- | hyperkitty/views/accounts.py | 5 |
4 files changed, 25 insertions, 11 deletions
diff --git a/hyperkitty/static/hyperkitty/css/hyperkitty-user.css b/hyperkitty/static/hyperkitty/css/hyperkitty-user.css index 23a8c2c..1f04c70 100644 --- a/hyperkitty/static/hyperkitty/css/hyperkitty-user.css +++ b/hyperkitty/static/hyperkitty/css/hyperkitty-user.css @@ -39,33 +39,33 @@ * User profile page */ -#user-profile { +.user-profile { padding: 0 2em; } -#user-profile h1 { +.user-profile h1 { margin-bottom: 1em; } -#user-profile h3 { +.user-profile h3 { margin-top: 2em; } -#user-profile form { +.user-profile form { float: left; } -#user-profile div.gravatar { +.user-profile div.gravatar { /*float: right;*/ float: left; width: auto; font-size: 95%; margin-left: 4em; } -#user-profile img.gravatar { +.user-profile img.gravatar { width: auto; } -#user-profile .gravatar p { +.user-profile .gravatar p { text-align: center; } @@ -86,13 +86,16 @@ table.user-data input { } -#user-profile .ajaxloader { +.user-profile .ajaxloader { margin-top: 0; margin-left: 0; position: absolute; } -#user-profile table.subscriptions { +.user-profile table.subscriptions { width: auto; } +.user-public-profile table.user-data { + float: left; +} diff --git a/hyperkitty/templates/user_profile.html b/hyperkitty/templates/user_profile.html index 667e252..c7d7550 100644 --- a/hyperkitty/templates/user_profile.html +++ b/hyperkitty/templates/user_profile.html @@ -11,7 +11,7 @@ {% block content %} -<div id="user-profile"> +<div class="user-profile"> <h1>User profile <small>for {{ user }}</small></h1> diff --git a/hyperkitty/templates/user_public_profile.html b/hyperkitty/templates/user_public_profile.html index 0e4f7af..4172969 100644 --- a/hyperkitty/templates/user_public_profile.html +++ b/hyperkitty/templates/user_public_profile.html @@ -11,7 +11,7 @@ {% block content %} -<div id="user-profile"> +<div class="user-profile user-public-profile"> <h1>User profile <small>for {{ fullname }}</small></h1> @@ -34,6 +34,12 @@ </tbody> </table> + <div class="gravatar"> + {% gravatar email 100 %} + </div> + + <div class="clearfix"></div> + <h3>Subscriptions</h3> {% if subscriptions %} <table class="table table-striped table-bordered table-condensed subscriptions"> diff --git a/hyperkitty/views/accounts.py b/hyperkitty/views/accounts.py index c7772ec..3106b14 100644 --- a/hyperkitty/views/accounts.py +++ b/hyperkitty/views/accounts.py @@ -267,9 +267,14 @@ def public_profile(request, user_id): likestatus = "likealot" elif likes - dislikes > 0: likestatus = "like" + try: + email = unicode(mm_user.addresses[0]) + except KeyError: + email = None context = { "fullname": fullname, "mm_user": mm_user, + "email": email, "creation": dateutil.parser.parse(mm_user.created_on), "subscriptions": subscriptions, "posts_count": sum([s["posts_count"] for s in subscriptions]), |