Mercurial > public > src > rhodecode
changeset 1184:fcb5054937f6 beta
merge with optional gravatars
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 05 Mar 2011 23:02:15 +0100 |
parents | 4de3fa6290a7 (current diff) 5351a3a32381 (diff) |
children | 716911af91e1 |
files | rhodecode/lib/helpers.py |
diffstat | 8 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/development.ini Sat Mar 05 22:59:41 2011 +0100 +++ b/development.ini Sat Mar 05 23:02:15 2011 +0100 @@ -49,6 +49,7 @@ cut_off_limit = 256000 force_https = false commit_parse_limit = 25 +use_gravatar = true #################################### ### CELERY CONFIG ####
--- a/production.ini Sat Mar 05 22:59:41 2011 +0100 +++ b/production.ini Sat Mar 05 23:02:15 2011 +0100 @@ -48,6 +48,7 @@ cut_off_limit = 256000 force_https = false commit_parse_limit = 250 +use_gravatar = true #################################### ### CELERY CONFIG ####
--- a/rhodecode/config/deployment.ini_tmpl Sat Mar 05 22:59:41 2011 +0100 +++ b/rhodecode/config/deployment.ini_tmpl Sat Mar 05 23:02:15 2011 +0100 @@ -49,6 +49,7 @@ cut_off_limit = 256000 force_https = false commit_parse_limit = 50 +use_gravatar = true #################################### ### CELERY CONFIG ####
--- a/rhodecode/lib/helpers.py Sat Mar 05 22:59:41 2011 +0100 +++ b/rhodecode/lib/helpers.py Sat Mar 05 23:02:15 2011 +0100 @@ -10,7 +10,7 @@ from pygments.formatters import HtmlFormatter from pygments import highlight as code_highlight -from pylons import url, request +from pylons import url, request, config from pylons.i18n.translation import _, ungettext from webhelpers.html import literal, HTML, escape @@ -35,6 +35,7 @@ from vcs.utils.annotate import annotate_highlight from rhodecode.lib.utils import repo_name_slug +from rhodecode.lib import str2bool def _reset(name, value=None, id=NotGiven, type="reset", **attrs): """Reset button @@ -565,6 +566,9 @@ #============================================================================== def gravatar_url(email_address, size=30): + if not str2bool(config['app_conf'].get('use_gravatar')): + return "/images/user%s.png" % size + ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme') default = 'identicon' baseurl_nossl = "http://www.gravatar.com/avatar/"