Mercurial > kallithea
comparison rhodecode/templates/base/perms_summary.html @ 3666:fda60c2ad65f beta
fixed sort of permissions summary it's now perm+name
unified permissions summary for users and user groups
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 04 Apr 2013 14:08:58 +0200 |
parents | |
children | a8f520540ab0 |
comparison
equal
deleted
inserted
replaced
3665:690a955ba785 | 3666:fda60c2ad65f |
---|---|
1 ## snippet for displaying permissions overview for users | |
2 | |
3 <%def name="perms_summary(permissions)"> | |
4 <div id="perms" class="table"> | |
5 %for section in sorted(permissions.keys()): | |
6 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> | |
7 %if not permissions[section]: | |
8 <span class="empty_data">${_('No permissions defined yet')}</span> | |
9 %else: | |
10 <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> | |
11 <table id="tbl_list_${section}"> | |
12 <thead> | |
13 <tr> | |
14 <th class="left">${_('Name')}</th> | |
15 <th class="left">${_('Permission')}</th> | |
16 <th class="left">${_('Edit Permission')}</th> | |
17 </thead> | |
18 <tbody> | |
19 %if section == 'global': | |
20 %for k in sorted(permissions[section], key=lambda s: s.lower()): | |
21 <tr> | |
22 <td> | |
23 ${h.get_permission_name(k)} | |
24 </td> | |
25 <td> | |
26 ${h.boolicon(k.split('.')[-1] != 'none')} | |
27 </td> | |
28 <td> | |
29 <a href="${h.url('edit_permission', id='default')}">${_('edit')}</a> | |
30 </td> | |
31 </tr> | |
32 %endfor | |
33 %else: | |
34 %for k, section_perm in sorted(permissions[section].items(), key=lambda s: s[1]+s[0].lower()): | |
35 <tr> | |
36 <td> | |
37 %if section == 'repositories': | |
38 <a href="${h.url('summary_home',repo_name=k)}">${k}</a> | |
39 %elif section == 'repositories_groups': | |
40 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a> | |
41 %endif | |
42 </td> | |
43 <td> | |
44 <span class="perm_tag ${section_perm.split('.')[-1]}">${section_perm}</span> | |
45 </td> | |
46 <td> | |
47 %if section == 'repositories': | |
48 <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a> | |
49 %elif section == 'repositories_groups': | |
50 <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a> | |
51 %endif | |
52 </td> | |
53 </tr> | |
54 %endfor | |
55 %endif | |
56 | |
57 </tbody> | |
58 </table> | |
59 </div> | |
60 %endif | |
61 %endfor | |
62 </div> | |
63 </%def> |