Changeset - ce9a226e0867
[Not reviewed]
beta
0 4 0
Mads Kiilerich - 13 years ago 2013-03-28 01:10:45
madski@unity3d.com
sort permission lists by (repository) name

This also exhibits too much code in templates and code/template duplication.
4 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/admin/permissions/permissions.html
Show inline comments
 
@@ -110,25 +110,25 @@
 
              %if not c.perm_user.permissions[section]:
 
                  <span class="empty_data">${_('Nothing here yet')}</span>
 
              %else:
 
              <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
 
               <table id="tbl_list_${section}">
 
                <thead>
 
                    <tr>
 
                    <th class="left">${_('Name')}</th>
 
                    <th class="left">${_('Permission')}</th>
 
                    <th class="left">${_('Edit Permission')}</th>
 
                </thead>
 
                <tbody>
 
                %for k in c.perm_user.permissions[section]:
 
                %for k in sorted(c.perm_user.permissions[section], key=lambda s: s.lower):
 
                     <%
 
                     if section != 'global':
 
                         section_perm = c.perm_user.permissions[section].get(k)
 
                         _perm = section_perm.split('.')[-1]
 
                     else:
 
                         _perm = section_perm = None
 
                     %>
 
                    <tr>
 
                        <td>
 
                            %if section == 'repositories':
 
                                <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
 
                            %elif section == 'repositories_groups':
rhodecode/templates/admin/users/user_edit.html
Show inline comments
 
@@ -196,25 +196,25 @@
 
              %if not c.perm_user.permissions[section]:
 
                  <span class="empty_data">${_('Nothing here yet')}</span>
 
              %else:
 
              <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
 
               <table id="tbl_list_${section}">
 
                <thead>
 
                    <tr>
 
                    <th class="left">${_('Name')}</th>
 
                    <th class="left">${_('Permission')}</th>
 
                    <th class="left">${_('Edit Permission')}</th>
 
                </thead>
 
                <tbody>
 
                %for k in c.perm_user.permissions[section]:
 
                %for k in sorted(c.perm_user.permissions[section], key=lambda s: s.lower):
 
                     <%
 
                     if section != 'global':
 
                         section_perm = c.perm_user.permissions[section].get(k)
 
                         _perm = section_perm.split('.')[-1]
 
                     else:
 
                         _perm = section_perm = None
 
                     %>
 
                    <tr>
 
                        <td>
 
                            %if section == 'repositories':
 
                                <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
 
                            %elif section == 'repositories_groups':
rhodecode/templates/admin/users/user_edit_my_account.html
Show inline comments
 
@@ -47,25 +47,25 @@
 
        <div id="perms" class="table">
 
           %for section in sorted(c.rhodecode_user.permissions.keys()):
 
            <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
 

	
 
            <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
 
            <table id="tbl_list_${section}">
 
              <thead>
 
                  <tr>
 
                  <th class="left">${_('Name')}</th>
 
                  <th class="left">${_('Permission')}</th>
 
              </thead>
 
              <tbody>
 
            %for k in c.rhodecode_user.permissions[section]:
 
            %for k in sorted(c.rhodecode_user.permissions[section], key=lambda s: s.lower):
 
           <%
 
           if section != 'global':
 
               section_perm = c.rhodecode_user.permissions[section].get(k)
 
               _perm = section_perm.split('.')[-1]
 
           else:
 
               _perm = section_perm = None
 
           %>
 
            %if _perm not in ['none']:
 
                <tr>
 
                    <td>
 
                        %if section == 'repositories':
 
                            <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
rhodecode/templates/admin/users_groups/users_group_edit.html
Show inline comments
 
@@ -177,25 +177,25 @@ ${h.end_form()}
 
          %if not c.users_group.permissions:
 
              <span class="empty_data">${_('No permissions set yet')}</span>
 
          %else:
 
          <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
 
           <table id="tbl_list_repository">
 
            <thead>
 
                <tr>
 
                <th class="left">${_('Name')}</th>
 
                <th class="left">${_('Permission')}</th>
 
                <th class="left">${_('Edit Permission')}</th>
 
            </thead>
 
            <tbody>
 
            %for k in c.users_group.permissions[section]:
 
            %for k in sorted(c.users_group.permissions[section], key=lambda s: s.lower):
 
                 <%
 
                     section_perm = c.users_group.permissions[section].get(k)
 
                     _perm = section_perm.split('.')[-1]
 
                 %>
 
                <tr>
 
                    <td>
 
                        %if section == 'repositories':
 
                            <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
 
                        %elif section == 'repositories_groups':
 
                            <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
 
                        %endif
 
                    </td>
0 comments (0 inline, 0 general)