Skip to content

Commit

Permalink
[#1396,user/read][xs]: format member since date in a nice way.
Browse files Browse the repository at this point in the history
  • Loading branch information
rufuspollock committed Feb 2, 2012
1 parent f51eefe commit 0f803f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions ckan/controllers/user.py
Expand Up @@ -83,13 +83,10 @@ def index(self):
return render('user/list.html')

def read(self, id=None):

context = {'model': model,
'user': c.user or c.author}

data_dict = {'id':id,
'user_obj':c.userobj}

try:
check_access('user_show',context, data_dict)
except NotAuthorized:
Expand All @@ -103,7 +100,7 @@ def read(self, id=None):
c.user_dict = user_dict
c.is_myself = user_dict['name'] == c.user
c.about_formatted = self._format_about(user_dict['about'])

c.created_formatted = h.date_str_to_datetime(user_dict['created']).strftime('%b %d, %Y')
return render('user/read.html')

def me(self):
Expand Down
4 changes: 2 additions & 2 deletions ckan/templates/user/read.html
Expand Up @@ -36,10 +36,10 @@ <h3>Activity</h3>
<py:if test="c.user_dict['email']">
${h.mail_to(c.user_dict['email'], encode='javascript')}
</py:if>
<em>No email</em>
No email
</dd>
<dt>Member since</dt>
<dd>${c.user_dict['created']}</dd>
<dd>${c.created_formatted}</dd>
<dt>About</dt>
<dd>${c.about_formatted}</dd>
<py:if test="c.is_myself">
Expand Down

0 comments on commit 0f803f9

Please sign in to comment.