Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More style/appearance cleanups to the profile pages.

  • Loading branch information...
commit fccdeb5e6280c832d9c081b59c6fa75c08501287 1 parent dc4c85b
@jacobian jacobian authored
View
2  django_website/accounts/views.py
@@ -13,7 +13,7 @@
def user_profile(request, username):
u = get_object_or_404(User, username=username)
ctx = {
- 'user': u,
+ 'profile': u,
'email_hash': hashlib.md5(u.email).hexdigest(),
'user_can_commit': u.has_perm('auth.commit'),
'clas': find_agreements(u),
View
34 django_website/templates/accounts/user_profile.html
@@ -1,10 +1,10 @@
{% extends "base_community.html" %}
-{% block title %}{{ user }} | djangoproject.com{% endblock %}
+{% block title %}{% firstof profile.get_full_name profile.username %} | djangoproject.com{% endblock %}
{% block extrahead %}
<style type="text/css">
#avatar { float: left; margin-top: 16px; }
- #user-info { padding-left: 180px; }
+ #user-info { padding-left: 160px; }
#user-info ul li { margin-left: 1em; }
h1 span.badge {
font-size: 12px;
@@ -16,7 +16,27 @@
}
</style>
{% endblock extrahead %}
-{% block content-related %}{% endblock %}
+{% block content-related %}
+{% if user.is_authenticated and user == profile %}
+ <h2>This is you!</h3>
+ <p>
+ Need to edit something? Here's how:
+ </p>
+ <ul>
+ <li>
+ The image is the <a href="http://en.gravatar.com/">Gravatar</a> linked
+ to the email address you signed up with. You can change the image over
+ at <a href="http://en.gravatar.com/">Gravatar</a>.
+ If you see a robot, that's because you don't have a Gravatar yet.
+ (Robots provided by <a href="http://robothash.org/">Robohash</a>.)
+ </li>
+ <li>
+ The rest of the data is read-only for the time being. If you see
+ outragous errors, please email <kbd>jacob</kbd> @ this domain.
+ </li>
+ </ul>
+{% endif %}
+{% endblock %}
{% block content %}
{% load humanize %}
@@ -24,15 +44,11 @@
src="http://robohash.org/{{ email_hash }}?gravatar=hashed&amp;set=set3">
<div id="user-info">
<h1>
- {% firstof user.get_full_name user.username %}
+ {% firstof profile.get_full_name profile.username %}
{% if user_can_commit %}<span class="badge" title="Core committer.">core</span>{% endif %}
{% if clas %}<span class="badge" title="Contributor License Agreement on file.">cla</span>{% endif %}
</h1>
- <h3 class="deck">
- Contributor since {{ user.date_joined.date }}.
- </h2>
-
{% if stats %}
<h2>Lies, damned lies, and statistics:</h2>
<ul>
@@ -42,7 +58,7 @@ <h3 class="deck">
</ul>
{% endif %}
- {% with user.owned_feeds.all as feeds %}
+ {% with proflie.owned_feeds.all as feeds %}
{% if feeds %}
<h2>Community feeds:</h2>
<ul>
View
3  django_website/trac/stats.py
@@ -5,6 +5,7 @@
from __future__ import absolute_import
import operator
import django.db
+from django.utils.datastructures import SortedDict
from .models import Revision, Ticket, TicketChange
_statfuncs = []
@@ -23,7 +24,7 @@ def _inner(f):
return _inner
def get_user_stats(username):
- stats = {}
+ stats = SortedDict()
for func in sorted(_statfuncs, key=operator.attrgetter('title')):
stats[func.title] = func(username)
return stats
Please sign in to comment.
Something went wrong with that request. Please try again.