Changeset - 7eba3d1e4227
[Not reviewed]
default
0 5 0
Marcin Kuzminski - 15 years ago 2010-08-08 02:09:32
marcin@python-works.com
webhelpers import bugfix for gravatar
+some css fixes, and added gravatar for summary.
5 files changed with 17 insertions and 14 deletions:
0 comments (0 inline, 0 general)
pylons_app/lib/helpers.py
Show inline comments
 
@@ -296,28 +296,27 @@ time_ago = lambda x: util.datestr(_age(x
 

	
 
#===============================================================================
 
# PERMS
 
#===============================================================================
 
from pylons_app.lib.auth import HasPermissionAny, HasPermissionAll, \
 
HasRepoPermissionAny, HasRepoPermissionAll
 

	
 
#===============================================================================
 
# GRAVATAR URL
 
#===============================================================================
 
import hashlib
 
import urllib
 
from pylons import request
 

	
 
def gravatar_url(email):
 
def gravatar_url(email, size=30):
 
    ssl_enabled = 'https' == request.environ.get('HTTP_X_URL_SCHEME')
 
    default = 'identicon'
 
    size = 32
 
    baseurl_nossl = "http://www.gravatar.com/avatar/"
 
    baseurl_ssl = "https://secure.gravatar.com/avatar/"
 
    
 
    baseurl = baseurl_ssl if ssl_enabled else baseurl_nossl
 
        
 
    
 
    # construct the url
 
    gravatar_url = baseurl + hashlib.md5(email.lower()).hexdigest() + "?"
 
    gravatar_url += urllib.urlencode({'d':default, 's':str(size)})
 

	
 
    return gravatar_url
pylons_app/public/css/style.css
Show inline comments
 
@@ -3437,30 +3437,31 @@ table#permissions_manage span.private_re
 
table#permissions_manage td.private_repo_msg{
 
    font-size: 0.8em;
 
    
 
}
 
table#permissions_manage tr#add_perm_input td{
 
    vertical-align:middle;
 
 
}
 
 
/* -----------------------------------------------------------
 
    GRAVATARS
 
----------------------------------------------------------- */
 
.gravatar_box img{
 
 	float:left;
 
 	padding-right: 5px;
 
 	padding-top:3px;
 
}
 
 
div.gravatar{
 
	background-color:white;
 
	border:1px solid #D0D0D0;
 
	float:left;
 
	margin-right:0.7em;
 
	padding: 2px 2px 0px;
 
}
 
 
/* -----------------------------------------------------------
 
	jquery ui
 
----------------------------------------------------------- */
 
 
.ui-helper-hidden { display: none; }
 
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
 
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
 
 
/* -----------------------------------------------------------
 
	jquery ui -> icons
 
----------------------------------------------------------- */
pylons_app/templates/admin/users/user_edit.html
Show inline comments
 
@@ -21,25 +21,25 @@
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}       
 
    </div>
 
    <!-- end box / title -->
 
    ${h.form(url('user', id=c.user.user_id),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="fields">
 
             <div class="field">
 
                <div class="gravatar_box">
 
              		<img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/>
 
              		<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>
 
            	</div>
 
             </div>        
 
        
 
             <div class="field">
 
                <div class="label">
 
                    <label for="username">${_('Username')}:</label>
 
                </div>
 
                <div class="input">
pylons_app/templates/admin/users/users.html
Show inline comments
 
@@ -31,25 +31,25 @@
 
        <tr class="header">
 
        	<th></th>
 
            <th class="left">${_('username')}</th>
 
            <th class="left">${_('name')}</th>
 
            <th class="left">${_('lastname')}</th>
 
            <th class="left">${_('active')}</th>
 
            <th class="left">${_('admin')}</th>
 
            <th class="left">${_('action')}</th>
 
        </tr>
 
            %for cnt,user in enumerate(c.users_list):
 
             %if user.name !='default':
 
                <tr class="parity${cnt%2}">
 
                	<td> <img alt="gravatar" src="${h.gravatar_url(user.email)}"> </td>
 
                	<td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(user.email)}"> </div></td>
 
                    <td>${h.link_to(user.username,h.url('edit_user', id=user.user_id))}</td>
 
                    <td>${user.name}</td>
 
                    <td>${user.lastname}</td>
 
                    <td>${user.active}</td>
 
                    <td>${user.admin}</td>
 
                    <td>
 
                        ${h.form(url('user', id=user.user_id),method='delete')}
 
                            ${h.submit('remove','delete',class_="delete_icon action_button")}
 
                        ${h.end_form()}
 
                    </td>
 
                </tr>
 
             %endif
pylons_app/templates/summary/summary.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Mercurial Repository Overview')}
 
</%def>
 

	
 

	
 

	
 
<%def name="breadcrumbs_links()">
 
    ${h.link_to(u'Home',h.url('/'))}
 
    &raquo; 
 
    ${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
 
    &raquo;
 
    ${_('summary')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
	${self.menu('summary')}    
 
</%def>
 

	
 
@@ -55,25 +53,30 @@ E.onDOMReady(function(e){
 
			  </div>
 
			  <div class="input-short">
 
			      ${c.repo_info.description}
 
			  </div>
 
			 </div>
 
			
 
			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Contact')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			      ${c.repo_info.contact}
 
			  	<div class="gravatar">
 
			  		<img alt="gravatar" src="${h.gravatar_url(c.repo_info.dbrepo.user.email)}"/>
 
			  	</div>
 
			  		${_('Username')}: ${c.repo_info.dbrepo.user.username}<br/>
 
			  		${_('Name')}: ${c.repo_info.dbrepo.user.name} ${c.repo_info.dbrepo.user.lastname}<br/>
 
			  		${_('Email')}: <a href="mailto:${c.repo_info.dbrepo.user.email}">${c.repo_info.dbrepo.user.email}</a>
 
			  </div>
 
			 </div>
 
			
 
			 <div class="field">
 
			  <div class="label">
 
			      <label>${_('Last change')}:</label>
 
			  </div>
 
			  <div class="input-short">
 
			      ${h.age(c.repo_info.last_change)} - ${h.rfc822date(c.repo_info.last_change)}
 
			  </div>
 
			 </div>
 
			
0 comments (0 inline, 0 general)