Add a configurable avatar system and add an internal avatar system for enterprise
This commit is contained in:
parent
f6dd8b0a4d
commit
e9cac407df
36 changed files with 241 additions and 92 deletions
|
@ -1,6 +1,5 @@
|
|||
from app import get_app_url
|
||||
from app import get_app_url, avatar
|
||||
from data import model
|
||||
from util.gravatar import compute_hash
|
||||
from util.names import parse_robot_username
|
||||
from jinja2 import Template, Environment, FileSystemLoader, contextfilter
|
||||
|
||||
|
@ -25,10 +24,10 @@ def user_reference(username):
|
|||
alt = 'Organization' if user.organization else 'User'
|
||||
return """
|
||||
<span>
|
||||
<img src="http://www.gravatar.com/avatar/%s?s=16&d=identicon"
|
||||
<img src="%s"
|
||||
style="vertical-align: middle; margin-left: 6px; margin-right: 4px;" alt="%s">
|
||||
<b>%s</b>
|
||||
</span>""" % (compute_hash(user.email), alt, username)
|
||||
</span>""" % (avatar.get_url(user.email, 16), alt, username)
|
||||
|
||||
|
||||
def repository_tag_reference(repository_path_and_tag):
|
||||
|
@ -55,10 +54,10 @@ def repository_reference(pair):
|
|||
|
||||
return """
|
||||
<span style="white-space: nowrap;">
|
||||
<img src="http://www.gravatar.com/avatar/%s?s=16&d=identicon" style="vertical-align: middle; margin-left: 6px; margin-right: 4px;">
|
||||
<img src="%s" style="vertical-align: middle; margin-left: 6px; margin-right: 4px;">
|
||||
<a href="%s/repository/%s/%s">%s/%s</a>
|
||||
</span>
|
||||
""" % (compute_hash(owner.email), get_app_url(), namespace, repository, namespace, repository)
|
||||
""" % (avatar.get_url(owner.email, 16), get_app_url(), namespace, repository, namespace, repository)
|
||||
|
||||
|
||||
def admin_reference(username):
|
||||
|
|
Reference in a new issue