changeset 1110:5351a3a32381 beta

#21 added optional flag to disable gravatar, and use local icon
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 02 Mar 2011 11:50:13 +0100
parents 41a695e604ba
children fcb5054937f6
files development.ini production.ini rhodecode/config/deployment.ini_tmpl rhodecode/lib/helpers.py rhodecode/public/images/user14.png rhodecode/public/images/user20.png rhodecode/public/images/user24.png rhodecode/public/images/user30.png
diffstat 8 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Tue Mar 01 14:14:10 2011 +0100
+++ b/development.ini	Wed Mar 02 11:50:13 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	Tue Mar 01 14:14:10 2011 +0100
+++ b/production.ini	Wed Mar 02 11:50:13 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	Tue Mar 01 14:14:10 2011 +0100
+++ b/rhodecode/config/deployment.ini_tmpl	Wed Mar 02 11:50:13 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	Tue Mar 01 14:14:10 2011 +0100
+++ b/rhodecode/lib/helpers.py	Wed Mar 02 11:50:13 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
@@ -562,6 +563,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/"
Binary file rhodecode/public/images/user14.png has changed
Binary file rhodecode/public/images/user20.png has changed
Binary file rhodecode/public/images/user24.png has changed
Binary file rhodecode/public/images/user30.png has changed