Changeset - 2196aa27954b
[Not reviewed]
beta
0 4 0
Marcin Kuzminski - 14 years ago 2011-10-31 22:10:11
marcin@python-works.com
implements #293 gravatar link should be disabled when use_gravatar = false
4 files changed with 17 insertions and 9 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/base.py
Show inline comments
 
@@ -11,6 +11,7 @@ from pylons.templating import render_mak
 
from paste.deploy.converters import asbool
 

	
 
from rhodecode import __version__
 
from rhodecode.lib import str2bool
 
from rhodecode.lib.auth import AuthUser, get_container_username
 
from rhodecode.lib.utils import get_repo_slug
 
from rhodecode.model import meta
 
@@ -25,6 +26,7 @@ class BaseController(WSGIController):
 
    def __before__(self):
 
        c.rhodecode_version = __version__
 
        c.rhodecode_name = config.get('rhodecode_title')
 
        c.use_gravatar = str2bool(config.get('use_gravatar'))
 
        c.ga_code = config.get('rhodecode_ga_code')
 
        c.repo_name = get_repo_slug(request)
 
        c.backends = BACKENDS.keys()
rhodecode/lib/helpers.py
Show inline comments
 
@@ -454,9 +454,8 @@ HasRepoPermissionAny, HasRepoPermissionA
 
#==============================================================================
 

	
 
def gravatar_url(email_address, size=30):
 
    if not str2bool(config['app_conf'].get('use_gravatar')) or \
 
            not email_address or \
 
            email_address == 'anonymous@rhodecode.org':
 
    if (not str2bool(config['app_conf'].get('use_gravatar')) or
 
        not email_address or email_address == 'anonymous@rhodecode.org'):
 
        return url("/images/user%s.png" % size)
 

	
 
    ssl_enabled = 'https' == request.environ.get('wsgi.url_scheme')
rhodecode/templates/admin/users/user_edit.html
Show inline comments
 
@@ -29,10 +29,13 @@
 
        <div class="field">
 
           <div class="gravatar_box">
 
               <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
 
               <p>
 
               <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong><br/> 
 
               ${_('Using')} ${c.user.email}
 
               </p>
 
                <p>
 
                %if c.use_gravatar:
 
                <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
 
                <br/>${_('Using')} ${c.user.email}
 
                %else:
 
                <br/>${c.user.email}
 
                %endif 
 
           </div>
 
        </div>
 
        <div class="field">
rhodecode/templates/admin/users/user_edit_my_account.html
Show inline comments
 
@@ -29,8 +29,12 @@
 
                <div class="gravatar_box">
 
                    <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
 
                    <p>
 
                    <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong><br/> 
 
                    ${_('Using')} ${c.user.email}
 
                    %if c.use_gravatar:
 
                    <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
 
                    <br/>${_('Using')} ${c.user.email}
 
                    %else:
 
                    <br/>${c.user.email}
 
                    %endif 
 
                    </p>
 
                </div>
 
             </div>   	    
0 comments (0 inline, 0 general)