Changeset - 32cb8d45f330
[Not reviewed]
beta
0 7 0
Mads Kiilerich - 13 years ago 2013-03-28 01:10:45
madski@unity3d.com
helpers: show boolean value of value as icon, not just the True and False singletons
7 files changed with 13 insertions and 16 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/users.py
Show inline comments
 
@@ -99,9 +99,9 @@ class UsersController(BaseController):
 
                "lastname": user.lastname,
 
                "last_login": h.fmt_date(user.last_login),
 
                "last_login_raw": datetime_to_time(user.last_login),
 
                "active": h.bool2icon(user.active),
 
                "admin": h.bool2icon(user.admin),
 
                "ldap": h.bool2icon(bool(user.ldap_dn)),
 
                "active": h.boolicon(user.active),
 
                "admin": h.boolicon(user.admin),
 
                "ldap": h.boolicon(bool(user.ldap_dn)),
 
                "action": user_actions(user.user_id, user.username),
 
            })
 

	
rhodecode/lib/helpers.py
Show inline comments
 
@@ -494,23 +494,20 @@ def desc_stylize(value):
 
    return value
 

	
 

	
 
def bool2icon(value):
 
    """Returns True/False values represented as small html image of true/false
 
def boolicon(value):
 
    """Returns boolean value of a value, represented as small html image of true/false
 
    icons
 

	
 
    :param value: bool value
 
    :param value: value
 
    """
 

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

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

	
 
    return value
 

	
 

	
 
def action_parser(user_log, feed=False, parse_cs=False):
 
    """
rhodecode/templates/admin/permissions/permissions.html
Show inline comments
 
@@ -139,7 +139,7 @@
 
                        </td>
 
                        <td>
 
                            %if section == 'global':
 
                             ${h.bool2icon(k.split('.')[-1] != 'none')}
 
                             ${h.boolicon(k.split('.')[-1] != 'none')}
 
                            %else:
 
                             <span class="perm_tag ${_perm}">${section_perm}</span>
 
                            %endif
rhodecode/templates/admin/repos/repo_edit.html
Show inline comments
 
@@ -221,7 +221,7 @@ ${self.context_bar('options')}
 
                  <tr>
 
                    <td>${cache.get_prefix() or '-'}</td>
 
                    <td>${cache.cache_key}</td>
 
                    <td>${h.bool2icon(cache.cache_active)}</td>
 
                    <td>${h.boolicon(cache.cache_active)}</td>
 
                  </tr>
 
              %endfor
 
              </table>
rhodecode/templates/admin/users/user_edit.html
Show inline comments
 
@@ -225,7 +225,7 @@
 
                        </td>
 
                        <td>
 
                            %if section == 'global':
 
                             ${h.bool2icon(k.split('.')[-1] != 'none')}
 
                             ${h.boolicon(k.split('.')[-1] != 'none')}
 
                            %else:
 
                             <span class="perm_tag ${_perm}">${section_perm}</span>
 
                            %endif
rhodecode/templates/admin/users/user_edit_my_account.html
Show inline comments
 
@@ -77,7 +77,7 @@
 
                    </td>
 
                    <td>
 
                        %if section == 'global':
 
                         ${h.bool2icon(True)}
 
                         ${h.boolicon(True)}
 
                        %else:
 
                        <span class="perm_tag ${_perm}">${section_perm}</span>
 
                        %endif
rhodecode/templates/admin/users_groups/users_groups.html
Show inline comments
 
@@ -40,7 +40,7 @@
 
                <tr class="parity${cnt%2}">
 
                    <td>${h.link_to(u_group.users_group_name,h.url('edit_users_group', id=u_group.users_group_id))}</td>
 
                    <td><span class="tooltip" title="${h.tooltip(', '.join(map(h.safe_unicode,[x.user.username for x in u_group.members[:50]])))}">${len(u_group.members)}</span></td>
 
                    <td>${h.bool2icon(u_group.users_group_active)}</td>
 
                    <td>${h.boolicon(u_group.users_group_active)}</td>
 
                    <td>
 
                        ${h.form(url('users_group', id=u_group.users_group_id),method='delete')}
 
                            ${h.submit('remove_',_('delete'),id="remove_group_%s" % u_group.users_group_id,
0 comments (0 inline, 0 general)