mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Gravatar's on pages, let's see how people react
This commit is contained in:
@@ -5,6 +5,7 @@ from webhelpers import *
|
||||
|
||||
from galaxy.util.json import to_json_string
|
||||
from datetime import datetime, timedelta
|
||||
import hashlib
|
||||
|
||||
# If the date is more than one week ago, then display the actual date instead of in words
|
||||
def time_ago( x ):
|
||||
@@ -43,3 +44,12 @@ def js( *args ):
|
||||
"""
|
||||
return "\n".join( [ javascript_include_tag( "/static/scripts/" + name + ".js?v=2" ) for name in args ] )
|
||||
|
||||
# Hashes
|
||||
|
||||
def md5( s ):
|
||||
"""
|
||||
Return hex encoded md5 hash of string s
|
||||
"""
|
||||
m = hashlib.md5()
|
||||
m.update( s )
|
||||
return m.hexdigest()
|
||||
@@ -152,6 +152,14 @@
|
||||
|
||||
%if item.published:
|
||||
<div style="padding: 10px;">
|
||||
<h4>Author</h4>
|
||||
|
||||
<p>${item.user.username}</p>
|
||||
|
||||
<div><img src="http://www.gravatar.com/avatar/${h.md5(item.user.email)}?s=150"></div>
|
||||
|
||||
|
||||
|
||||
## Page meta.
|
||||
<h4>Related ${item_plural}</h4>
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user