##// END OF EJS Templates
fixed sort of permissions summary it's now perm+name...
marcink -
r3666:fda60c2a beta
parent child Browse files
Show More
@@ -0,0 +1,63 b''
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>
@@ -104,63 +104,8 b''
104 104 </div>
105 105
106 106 ## permissions overview
107 <div id="perms" class="table">
108 %for section in sorted(c.perm_user.permissions.keys()):
109 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
110 %if not c.perm_user.permissions[section]:
111 <span class="empty_data">${_('Nothing here yet')}</span>
112 %else:
113 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
114 <table id="tbl_list_${section}">
115 <thead>
116 <tr>
117 <th class="left">${_('Name')}</th>
118 <th class="left">${_('Permission')}</th>
119 <th class="left">${_('Edit Permission')}</th>
120 </thead>
121 <tbody>
122 %for k in sorted(c.perm_user.permissions[section], key=lambda s: s.lower):
123 <%
124 if section != 'global':
125 section_perm = c.perm_user.permissions[section].get(k)
126 _perm = section_perm.split('.')[-1]
127 else:
128 _perm = section_perm = None
129 %>
130 <tr>
131 <td>
132 %if section == 'repositories':
133 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
134 %elif section == 'repositories_groups':
135 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
136 %else:
137 ${h.get_permission_name(k)}
138 %endif
139 </td>
140 <td>
141 %if section == 'global':
142 ${h.boolicon(k.split('.')[-1] != 'none')}
143 %else:
144 <span class="perm_tag ${_perm}">${section_perm}</span>
145 %endif
146 </td>
147 <td>
148 %if section == 'repositories':
149 <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a>
150 %elif section == 'repositories_groups':
151 <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a>
152 %else:
153 --
154 %endif
155 </td>
156 </tr>
157 %endfor
158 </tbody>
159 </table>
160 </div>
161 %endif
162 %endfor
163 </div>
107 <%include file="/base/perms_summary.html"/>
108
164 109 </div>
165 110 <div class="box box-left" style="clear:left">
166 111 <!-- box / title -->
@@ -190,63 +190,9 b''
190 190 ${h.end_form()}
191 191
192 192 ## permissions overview
193 <div id="perms" class="table">
194 %for section in sorted(c.perm_user.permissions.keys()):
195 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
196 %if not c.perm_user.permissions[section]:
197 <span class="empty_data">${_('Nothing here yet')}</span>
198 %else:
199 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
200 <table id="tbl_list_${section}">
201 <thead>
202 <tr>
203 <th class="left">${_('Name')}</th>
204 <th class="left">${_('Permission')}</th>
205 <th class="left">${_('Edit Permission')}</th>
206 </thead>
207 <tbody>
208 %for k in sorted(c.perm_user.permissions[section], key=lambda s: s.lower):
209 <%
210 if section != 'global':
211 section_perm = c.perm_user.permissions[section].get(k)
212 _perm = section_perm.split('.')[-1]
213 else:
214 _perm = section_perm = None
215 %>
216 <tr>
217 <td>
218 %if section == 'repositories':
219 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
220 %elif section == 'repositories_groups':
221 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
222 %else:
223 ${h.get_permission_name(k)}
224 %endif
225 </td>
226 <td>
227 %if section == 'global':
228 ${h.boolicon(k.split('.')[-1] != 'none')}
229 %else:
230 <span class="perm_tag ${_perm}">${section_perm}</span>
231 %endif
232 </td>
233 <td>
234 %if section == 'repositories':
235 <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a>
236 %elif section == 'repositories_groups':
237 <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a>
238 %else:
239 --
240 %endif
241 </td>
242 </tr>
243 %endfor
244 </tbody>
245 </table>
246 </div>
247 %endif
248 %endfor
249 </div>
193 <%namespace name="p" file="/base/perms_summary.html"/>
194 ${p.perms_summary(c.perm_user.permissions)}
195
250 196 </div>
251 197 <div class="box box-left" style="clear:left">
252 198 <!-- box / title -->
@@ -43,54 +43,10 b''
43 43 </ul>
44 44 </div>
45 45 <!-- end box / title -->
46 <div id="perms_container">
47 <div id="perms" class="table">
48 %for section in sorted(c.rhodecode_user.permissions.keys()):
49 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
46 ## permissions overview
47 <%namespace name="p" file="/base/perms_summary.html"/>
48 ${p.perms_summary(c.perm_user.permissions)}
50 49
51 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
52 <table id="tbl_list_${section}">
53 <thead>
54 <tr>
55 <th class="left">${_('Name')}</th>
56 <th class="left">${_('Permission')}</th>
57 </thead>
58 <tbody>
59 %for k in sorted(c.rhodecode_user.permissions[section], key=lambda s: s.lower):
60 <%
61 if section != 'global':
62 section_perm = c.rhodecode_user.permissions[section].get(k)
63 _perm = section_perm.split('.')[-1]
64 else:
65 _perm = section_perm = None
66 %>
67 %if _perm not in ['none']:
68 <tr>
69 <td>
70 %if section == 'repositories':
71 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
72 %elif section == 'repositories_groups':
73 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
74 %else:
75 ${k}
76 %endif
77 </td>
78 <td>
79 %if section == 'global':
80 ${h.boolicon(True)}
81 %else:
82 <span class="perm_tag ${_perm}">${section_perm}</span>
83 %endif
84 </td>
85 </tr>
86 %endif
87 %endfor
88 </tbody>
89 </table>
90 </div>
91 %endfor
92 </div>
93 </div>
94 50 <div id="my_container" style="display:none">
95 51 <div class="table yui-skin-sam" id="repos_list_wrap"></div>
96 52 <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div>
@@ -138,9 +138,13 b''
138 138 </div>
139 139 </div>
140 140 ${h.end_form()}
141
142 ## permissions overview
143 <%namespace name="p" file="/base/perms_summary.html"/>
144 ${p.perms_summary(c.users_group.permissions)}
141 145 </div>
142 146
143 <div class="box box-right">
147 <div class="box box-right" style="clear:right">
144 148 <!-- box / title -->
145 149 <div class="title">
146 150 <h5>${_('Group members')}</h5>
@@ -165,63 +169,6 b''
165 169 </div>
166 170 </div>
167 171
168 <div class="box box-left">
169 <!-- box / title -->
170 <div class="title">
171 <h5>${_('Permissions defined for this group')}</h5>
172 </div>
173 ## permissions overview
174 <div id="perms" class="table">
175 %for section in sorted(c.users_group.permissions.keys()):
176 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
177 %if not c.users_group.permissions:
178 <span class="empty_data">${_('No permissions set yet')}</span>
179 %else:
180 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
181 <table id="tbl_list_repository">
182 <thead>
183 <tr>
184 <th class="left">${_('Name')}</th>
185 <th class="left">${_('Permission')}</th>
186 <th class="left">${_('Edit Permission')}</th>
187 </thead>
188 <tbody>
189 %for k in sorted(c.users_group.permissions[section], key=lambda s: s.lower):
190 <%
191 section_perm = c.users_group.permissions[section].get(k)
192 _perm = section_perm.split('.')[-1]
193 %>
194 <tr>
195 <td>
196 %if section == 'repositories':
197 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
198 %elif section == 'repositories_groups':
199 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
200 %endif
201 </td>
202 <td>
203 <span class="perm_tag ${_perm}">${section_perm}</span>
204 </td>
205 <td>
206 %if section == 'repositories':
207 <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a>
208 %elif section == 'repositories_groups':
209 <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a>
210 %else:
211 --
212 %endif
213 </td>
214 </tr>
215 %endfor
216 </tbody>
217 </table>
218 </div>
219 %endif
220 %endfor
221 </div>
222 </div>
223
224
225 172 <script type="text/javascript">
226 173 MultiSelectWidget('users_group_members','available_members','edit_users_group');
227 174 </script>
General Comments 0
You need to be logged in to leave comments. Login now