Changeset - 131c1e335fa7
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2010-11-18 03:05:29
marcin@python-works.com
Added ldap info on admin users, added bool2icon helper for nicer representation of
True/False values. Fixed lock open icon to be more readable
3 files changed with 20 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/helpers.py
Show inline comments
 
@@ -368,12 +368,28 @@ capitalize = lambda x: x.capitalize()
 
email = util.email
 
email_or_none = lambda x: util.email(x) if util.email(x) != x else None
 
person = lambda x: _person(x)
 
short_id = lambda x: x[:12]
 

	
 

	
 
def bool2icon(value):
 
    """
 
    Returns True/False values represented as small html image of true/false
 
    icons
 
    :param value: bool value
 
    """
 

	
 
    if value is True:
 
        return HTML.tag('img', src="/images/icons/accept.png")
 

	
 
    if value is False:
 
        return HTML.tag('img', src="/images/icons/cancel.png")
 

	
 
    return value
 

	
 

	
 
def action_parser(user_log):
 
    """
 
    This helper will map the specified string action into translated
 
    fancy names with icons and links
 
    
 
    @param action:
rhodecode/public/images/icons/lock_open.png
Show inline comments
 
binary diff not shown
Show images
rhodecode/templates/admin/users/users.html
Show inline comments
 
@@ -32,23 +32,25 @@
 
        	<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">${_('ldap')}</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><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(user.email,24)}"> </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.bool2icon(user.active)}</td>
 
                    <td>${h.bool2icon(user.admin)}</td>
 
                    <td>${h.bool2icon(user.is_ldap)}</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>
0 comments (0 inline, 0 general)