Show More
@@ -1,215 +1,215 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('Permissions administration')} · ${c.rhodecode_name} |
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | <%def name="breadcrumbs_links()"> |
|
9 | 9 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
10 | 10 | » |
|
11 | 11 | ${_('permissions')} |
|
12 | 12 | </%def> |
|
13 | 13 | |
|
14 | 14 | <%def name="page_nav()"> |
|
15 | 15 | ${self.menu('admin')} |
|
16 | 16 | </%def> |
|
17 | 17 | |
|
18 | 18 | <%def name="main()"> |
|
19 | 19 | <div class="box box-left"> |
|
20 | 20 | <!-- box / title --> |
|
21 | 21 | <div class="title"> |
|
22 | 22 | ${self.breadcrumbs()} |
|
23 | 23 | </div> |
|
24 | 24 | <h3>${_('Default permissions')}</h3> |
|
25 | 25 | ${h.form(url('permission', id='default'),method='put')} |
|
26 | 26 | <div class="form"> |
|
27 | 27 | <!-- fields --> |
|
28 | 28 | <div class="fields"> |
|
29 | 29 | <div class="field"> |
|
30 | 30 | <div class="label label-checkbox"> |
|
31 | 31 | <label for="anonymous">${_('Anonymous access')}:</label> |
|
32 | 32 | </div> |
|
33 | 33 | <div class="checkboxes"> |
|
34 | 34 | <div class="checkbox"> |
|
35 | 35 | ${h.checkbox('anonymous',True)} |
|
36 | 36 | </div> |
|
37 | 37 | </div> |
|
38 | 38 | </div> |
|
39 | 39 | <div class="field"> |
|
40 | 40 | <div class="label"> |
|
41 | 41 | <label for="default_repo_perm">${_('Repository')}:</label> |
|
42 | 42 | </div> |
|
43 | 43 | <div class="select"> |
|
44 | 44 | ${h.select('default_repo_perm','',c.repo_perms_choices)} |
|
45 | 45 | |
|
46 | 46 | ${h.checkbox('overwrite_default_repo','true')} |
|
47 | 47 | <label for="overwrite_default_repo"> |
|
48 | 48 | <span class="tooltip" |
|
49 | 49 | title="${h.tooltip(_('All default permissions on each repository will be reset to chosen permission, note that all custom default permission on repositories will be lost'))}"> |
|
50 | 50 | ${_('overwrite existing settings')}</span> </label> |
|
51 | 51 | </div> |
|
52 | 52 | </div> |
|
53 | 53 | <div class="field"> |
|
54 | 54 | <div class="label"> |
|
55 | 55 | <label for="default_group_perm">${_('Repository group')}:</label> |
|
56 | 56 | </div> |
|
57 | 57 | <div class="select"> |
|
58 | 58 | ${h.select('default_group_perm','',c.group_perms_choices)} |
|
59 | 59 | ${h.checkbox('overwrite_default_group','true')} |
|
60 | 60 | <label for="overwrite_default_group"> |
|
61 | 61 | <span class="tooltip" |
|
62 | 62 | title="${h.tooltip(_('All default permissions on each repository group will be reset to chosen permission, note that all custom default permission on repository groups will be lost'))}"> |
|
63 | 63 | ${_('overwrite existing settings')}</span> </label> |
|
64 | 64 | |
|
65 | 65 | </div> |
|
66 | 66 | </div> |
|
67 | 67 | <div class="field"> |
|
68 | 68 | <div class="label"> |
|
69 | 69 | <label for="default_register">${_('Registration')}:</label> |
|
70 | 70 | </div> |
|
71 | 71 | <div class="select"> |
|
72 | 72 | ${h.select('default_register','',c.register_choices)} |
|
73 | 73 | </div> |
|
74 | 74 | </div> |
|
75 | 75 | <div class="field"> |
|
76 | 76 | <div class="label"> |
|
77 | 77 | <label for="default_create">${_('Repository creation')}:</label> |
|
78 | 78 | </div> |
|
79 | 79 | <div class="select"> |
|
80 | 80 | ${h.select('default_create','',c.create_choices)} |
|
81 | 81 | </div> |
|
82 | 82 | </div> |
|
83 | 83 | <div class="field"> |
|
84 | 84 | <div class="label"> |
|
85 | 85 | <label for="default_fork">${_('Repository forking')}:</label> |
|
86 | 86 | </div> |
|
87 | 87 | <div class="select"> |
|
88 | 88 | ${h.select('default_fork','',c.fork_choices)} |
|
89 | 89 | </div> |
|
90 | 90 | </div> |
|
91 | 91 | <div class="buttons"> |
|
92 | 92 | ${h.submit('save',_('Save'),class_="ui-btn large")} |
|
93 | 93 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
94 | 94 | </div> |
|
95 | 95 | </div> |
|
96 | 96 | </div> |
|
97 | 97 | ${h.end_form()} |
|
98 | 98 | </div> |
|
99 | 99 | |
|
100 | 100 | <div style="min-height:780px" class="box box-right"> |
|
101 | 101 | <!-- box / title --> |
|
102 | 102 | <div class="title"> |
|
103 | 103 | <h5>${_('Default User Permissions')}</h5> |
|
104 | 104 | </div> |
|
105 | 105 | |
|
106 | 106 | ## permissions overview |
|
107 | 107 | <div id="perms" class="table"> |
|
108 | 108 | %for section in sorted(c.perm_user.permissions.keys()): |
|
109 | 109 | <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> |
|
110 | 110 | %if not c.perm_user.permissions[section]: |
|
111 | 111 | <span class="empty_data">${_('Nothing here yet')}</span> |
|
112 | 112 | %else: |
|
113 | 113 | <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> |
|
114 | 114 | <table id="tbl_list_${section}"> |
|
115 | 115 | <thead> |
|
116 | 116 | <tr> |
|
117 | 117 | <th class="left">${_('Name')}</th> |
|
118 | 118 | <th class="left">${_('Permission')}</th> |
|
119 | 119 | <th class="left">${_('Edit Permission')}</th> |
|
120 | 120 | </thead> |
|
121 | 121 | <tbody> |
|
122 | %for k in c.perm_user.permissions[section]: | |
|
122 | %for k in sorted(c.perm_user.permissions[section], key=lambda s: s.lower): | |
|
123 | 123 | <% |
|
124 | 124 | if section != 'global': |
|
125 | 125 | section_perm = c.perm_user.permissions[section].get(k) |
|
126 | 126 | _perm = section_perm.split('.')[-1] |
|
127 | 127 | else: |
|
128 | 128 | _perm = section_perm = None |
|
129 | 129 | %> |
|
130 | 130 | <tr> |
|
131 | 131 | <td> |
|
132 | 132 | %if section == 'repositories': |
|
133 | 133 | <a href="${h.url('summary_home',repo_name=k)}">${k}</a> |
|
134 | 134 | %elif section == 'repositories_groups': |
|
135 | 135 | <a href="${h.url('repos_group_home',group_name=k)}">${k}</a> |
|
136 | 136 | %else: |
|
137 | 137 | ${h.get_permission_name(k)} |
|
138 | 138 | %endif |
|
139 | 139 | </td> |
|
140 | 140 | <td> |
|
141 | 141 | %if section == 'global': |
|
142 | 142 | ${h.bool2icon(k.split('.')[-1] != 'none')} |
|
143 | 143 | %else: |
|
144 | 144 | <span class="perm_tag ${_perm}">${section_perm}</span> |
|
145 | 145 | %endif |
|
146 | 146 | </td> |
|
147 | 147 | <td> |
|
148 | 148 | %if section == 'repositories': |
|
149 | 149 | <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a> |
|
150 | 150 | %elif section == 'repositories_groups': |
|
151 | 151 | <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a> |
|
152 | 152 | %else: |
|
153 | 153 | -- |
|
154 | 154 | %endif |
|
155 | 155 | </td> |
|
156 | 156 | </tr> |
|
157 | 157 | %endfor |
|
158 | 158 | </tbody> |
|
159 | 159 | </table> |
|
160 | 160 | </div> |
|
161 | 161 | %endif |
|
162 | 162 | %endfor |
|
163 | 163 | </div> |
|
164 | 164 | </div> |
|
165 | 165 | <div class="box box-left" style="clear:left"> |
|
166 | 166 | <!-- box / title --> |
|
167 | 167 | <div class="title"> |
|
168 | 168 | <h5>${_('Allowed IP addresses')}</h5> |
|
169 | 169 | </div> |
|
170 | 170 | |
|
171 | 171 | <div class="ips_wrap"> |
|
172 | 172 | <table class="noborder"> |
|
173 | 173 | %if c.user_ip_map: |
|
174 | 174 | %for ip in c.user_ip_map: |
|
175 | 175 | <tr> |
|
176 | 176 | <td><div class="ip">${ip.ip_addr}</div></td> |
|
177 | 177 | <td><div class="ip">${h.ip_range(ip.ip_addr)}</div></td> |
|
178 | 178 | <td> |
|
179 | 179 | ${h.form(url('user_ips_delete', id=c.user.user_id),method='delete')} |
|
180 | 180 | ${h.hidden('del_ip',ip.ip_id)} |
|
181 | 181 | ${h.hidden('default_user', 'True')} |
|
182 | 182 | ${h.submit('remove_',_('delete'),id="remove_ip_%s" % ip.ip_id, |
|
183 | 183 | class_="delete_icon action_button", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")} |
|
184 | 184 | ${h.end_form()} |
|
185 | 185 | </td> |
|
186 | 186 | </tr> |
|
187 | 187 | %endfor |
|
188 | 188 | %else: |
|
189 | 189 | <tr><td><div class="ip">${_('All IP addresses are allowed')}</div></td></tr> |
|
190 | 190 | %endif |
|
191 | 191 | </table> |
|
192 | 192 | </div> |
|
193 | 193 | |
|
194 | 194 | ${h.form(url('user_ips', id=c.user.user_id),method='put')} |
|
195 | 195 | <div class="form"> |
|
196 | 196 | <!-- fields --> |
|
197 | 197 | <div class="fields"> |
|
198 | 198 | <div class="field"> |
|
199 | 199 | <div class="label"> |
|
200 | 200 | <label for="new_ip">${_('New ip address')}:</label> |
|
201 | 201 | </div> |
|
202 | 202 | <div class="input"> |
|
203 | 203 | ${h.hidden('default_user', 'True')} |
|
204 | 204 | ${h.text('new_ip', class_='medium')} |
|
205 | 205 | </div> |
|
206 | 206 | </div> |
|
207 | 207 | <div class="buttons"> |
|
208 | 208 | ${h.submit('save',_('Add'),class_="ui-btn large")} |
|
209 | 209 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
210 | 210 | </div> |
|
211 | 211 | </div> |
|
212 | 212 | </div> |
|
213 | 213 | ${h.end_form()} |
|
214 | 214 | </div> |
|
215 | 215 | </%def> |
@@ -1,343 +1,343 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('Edit user')} ${c.user.username} · ${c.rhodecode_name} |
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | <%def name="breadcrumbs_links()"> |
|
9 | 9 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
10 | 10 | » |
|
11 | 11 | ${h.link_to(_('Users'),h.url('users'))} |
|
12 | 12 | » |
|
13 | 13 | ${_('edit')} "${c.user.username}" |
|
14 | 14 | </%def> |
|
15 | 15 | |
|
16 | 16 | <%def name="page_nav()"> |
|
17 | 17 | ${self.menu('admin')} |
|
18 | 18 | </%def> |
|
19 | 19 | |
|
20 | 20 | <%def name="main()"> |
|
21 | 21 | <div class="box box-left"> |
|
22 | 22 | <!-- box / title --> |
|
23 | 23 | <div class="title"> |
|
24 | 24 | ${self.breadcrumbs()} |
|
25 | 25 | </div> |
|
26 | 26 | <!-- end box / title --> |
|
27 | 27 | ${h.form(url('update_user', id=c.user.user_id),method='put')} |
|
28 | 28 | <div class="form"> |
|
29 | 29 | <div class="field"> |
|
30 | 30 | <div class="gravatar_box"> |
|
31 | 31 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div> |
|
32 | 32 | <p> |
|
33 | 33 | %if c.use_gravatar: |
|
34 | 34 | <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong> |
|
35 | 35 | <br/>${_('Using')} ${c.user.email} |
|
36 | 36 | %else: |
|
37 | 37 | <br/>${c.user.email} |
|
38 | 38 | %endif |
|
39 | 39 | </div> |
|
40 | 40 | </div> |
|
41 | 41 | <div class="field"> |
|
42 | 42 | <div class="label"> |
|
43 | 43 | <label>${_('API key')}:</label> ${c.user.api_key} |
|
44 | 44 | </div> |
|
45 | 45 | </div> |
|
46 | 46 | ##show current ip just if we show ourself |
|
47 | 47 | %if c.rhodecode_user.username == c.user.username: |
|
48 | 48 | <div class="field"> |
|
49 | 49 | <div class="label"> |
|
50 | 50 | <label>${_('Current IP')}:</label> ${c.perm_user.ip_addr or "?"} |
|
51 | 51 | </div> |
|
52 | 52 | </div> |
|
53 | 53 | %endif |
|
54 | 54 | <div class="fields"> |
|
55 | 55 | <div class="field"> |
|
56 | 56 | <div class="label"> |
|
57 | 57 | <label for="username">${_('Username')}:</label> |
|
58 | 58 | </div> |
|
59 | 59 | <div class="input"> |
|
60 | 60 | %if c.ldap_dn: |
|
61 | 61 | ${h.text('username',class_='medium disabled', readonly="readonly")} |
|
62 | 62 | %else: |
|
63 | 63 | ${h.text('username',class_='medium')} |
|
64 | 64 | %endif: |
|
65 | 65 | </div> |
|
66 | 66 | </div> |
|
67 | 67 | |
|
68 | 68 | <div class="field"> |
|
69 | 69 | <div class="label"> |
|
70 | 70 | <label for="ldap_dn">${_('LDAP DN')}:</label> |
|
71 | 71 | </div> |
|
72 | 72 | <div class="input"> |
|
73 | 73 | ${h.text('ldap_dn',class_='medium disabled',readonly="readonly")} |
|
74 | 74 | </div> |
|
75 | 75 | </div> |
|
76 | 76 | |
|
77 | 77 | <div class="field"> |
|
78 | 78 | <div class="label"> |
|
79 | 79 | <label for="new_password">${_('New password')}:</label> |
|
80 | 80 | </div> |
|
81 | 81 | <div class="input"> |
|
82 | 82 | ${h.password('new_password',class_='medium',autocomplete="off")} |
|
83 | 83 | </div> |
|
84 | 84 | </div> |
|
85 | 85 | |
|
86 | 86 | <div class="field"> |
|
87 | 87 | <div class="label"> |
|
88 | 88 | <label for="password_confirmation">${_('New password confirmation')}:</label> |
|
89 | 89 | </div> |
|
90 | 90 | <div class="input"> |
|
91 | 91 | ${h.password('password_confirmation',class_="medium",autocomplete="off")} |
|
92 | 92 | </div> |
|
93 | 93 | </div> |
|
94 | 94 | |
|
95 | 95 | <div class="field"> |
|
96 | 96 | <div class="label"> |
|
97 | 97 | <label for="firstname">${_('First Name')}:</label> |
|
98 | 98 | </div> |
|
99 | 99 | <div class="input"> |
|
100 | 100 | ${h.text('firstname',class_='medium')} |
|
101 | 101 | </div> |
|
102 | 102 | </div> |
|
103 | 103 | |
|
104 | 104 | <div class="field"> |
|
105 | 105 | <div class="label"> |
|
106 | 106 | <label for="lastname">${_('Last Name')}:</label> |
|
107 | 107 | </div> |
|
108 | 108 | <div class="input"> |
|
109 | 109 | ${h.text('lastname',class_='medium')} |
|
110 | 110 | </div> |
|
111 | 111 | </div> |
|
112 | 112 | |
|
113 | 113 | <div class="field"> |
|
114 | 114 | <div class="label"> |
|
115 | 115 | <label for="email">${_('Email')}:</label> |
|
116 | 116 | </div> |
|
117 | 117 | <div class="input"> |
|
118 | 118 | ${h.text('email',class_='medium')} |
|
119 | 119 | </div> |
|
120 | 120 | </div> |
|
121 | 121 | |
|
122 | 122 | <div class="field"> |
|
123 | 123 | <div class="label label-checkbox"> |
|
124 | 124 | <label for="active">${_('Active')}:</label> |
|
125 | 125 | </div> |
|
126 | 126 | <div class="checkboxes"> |
|
127 | 127 | ${h.checkbox('active',value=True)} |
|
128 | 128 | </div> |
|
129 | 129 | </div> |
|
130 | 130 | |
|
131 | 131 | <div class="field"> |
|
132 | 132 | <div class="label label-checkbox"> |
|
133 | 133 | <label for="admin">${_('Admin')}:</label> |
|
134 | 134 | </div> |
|
135 | 135 | <div class="checkboxes"> |
|
136 | 136 | ${h.checkbox('admin',value=True)} |
|
137 | 137 | </div> |
|
138 | 138 | </div> |
|
139 | 139 | <div class="buttons"> |
|
140 | 140 | ${h.submit('save',_('Save'),class_="ui-btn large")} |
|
141 | 141 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
142 | 142 | </div> |
|
143 | 143 | </div> |
|
144 | 144 | </div> |
|
145 | 145 | ${h.end_form()} |
|
146 | 146 | </div> |
|
147 | 147 | <div style="min-height:780px" class="box box-right"> |
|
148 | 148 | <!-- box / title --> |
|
149 | 149 | <div class="title"> |
|
150 | 150 | <h5>${_('Permissions')}</h5> |
|
151 | 151 | </div> |
|
152 | 152 | ${h.form(url('user_perm', id=c.user.user_id),method='put')} |
|
153 | 153 | <div class="form"> |
|
154 | 154 | <!-- fields --> |
|
155 | 155 | <div class="fields"> |
|
156 | 156 | <div class="field"> |
|
157 | 157 | <div class="label label-checkbox"> |
|
158 | 158 | <label for="inherit_permissions">${_('Inherit default permissions')}:</label> |
|
159 | 159 | </div> |
|
160 | 160 | <div class="checkboxes"> |
|
161 | 161 | ${h.checkbox('inherit_default_permissions',value=True)} |
|
162 | 162 | </div> |
|
163 | 163 | <span class="help-block">${h.literal(_('Select to inherit permissions from %s settings. ' |
|
164 | 164 | 'With this selected below options does not have any action') % h.link_to('default', url('edit_permission', id='default')))}</span> |
|
165 | 165 | </div> |
|
166 | 166 | <div id="inherit_overlay" style="${'opacity:0.3' if c.user.inherit_default_permissions else ''}" > |
|
167 | 167 | <div class="field"> |
|
168 | 168 | <div class="label label-checkbox"> |
|
169 | 169 | <label for="create_repo_perm">${_('Create repositories')}:</label> |
|
170 | 170 | </div> |
|
171 | 171 | <div class="checkboxes"> |
|
172 | 172 | ${h.checkbox('create_repo_perm',value=True)} |
|
173 | 173 | </div> |
|
174 | 174 | </div> |
|
175 | 175 | <div class="field"> |
|
176 | 176 | <div class="label label-checkbox"> |
|
177 | 177 | <label for="fork_repo_perm">${_('Fork repositories')}:</label> |
|
178 | 178 | </div> |
|
179 | 179 | <div class="checkboxes"> |
|
180 | 180 | ${h.checkbox('fork_repo_perm',value=True)} |
|
181 | 181 | </div> |
|
182 | 182 | </div> |
|
183 | 183 | </div> |
|
184 | 184 | <div class="buttons"> |
|
185 | 185 | ${h.submit('save',_('Save'),class_="ui-btn large")} |
|
186 | 186 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
187 | 187 | </div> |
|
188 | 188 | </div> |
|
189 | 189 | </div> |
|
190 | 190 | ${h.end_form()} |
|
191 | 191 | |
|
192 | 192 | ## permissions overview |
|
193 | 193 | <div id="perms" class="table"> |
|
194 | 194 | %for section in sorted(c.perm_user.permissions.keys()): |
|
195 | 195 | <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> |
|
196 | 196 | %if not c.perm_user.permissions[section]: |
|
197 | 197 | <span class="empty_data">${_('Nothing here yet')}</span> |
|
198 | 198 | %else: |
|
199 | 199 | <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> |
|
200 | 200 | <table id="tbl_list_${section}"> |
|
201 | 201 | <thead> |
|
202 | 202 | <tr> |
|
203 | 203 | <th class="left">${_('Name')}</th> |
|
204 | 204 | <th class="left">${_('Permission')}</th> |
|
205 | 205 | <th class="left">${_('Edit Permission')}</th> |
|
206 | 206 | </thead> |
|
207 | 207 | <tbody> |
|
208 | %for k in c.perm_user.permissions[section]: | |
|
208 | %for k in sorted(c.perm_user.permissions[section], key=lambda s: s.lower): | |
|
209 | 209 | <% |
|
210 | 210 | if section != 'global': |
|
211 | 211 | section_perm = c.perm_user.permissions[section].get(k) |
|
212 | 212 | _perm = section_perm.split('.')[-1] |
|
213 | 213 | else: |
|
214 | 214 | _perm = section_perm = None |
|
215 | 215 | %> |
|
216 | 216 | <tr> |
|
217 | 217 | <td> |
|
218 | 218 | %if section == 'repositories': |
|
219 | 219 | <a href="${h.url('summary_home',repo_name=k)}">${k}</a> |
|
220 | 220 | %elif section == 'repositories_groups': |
|
221 | 221 | <a href="${h.url('repos_group_home',group_name=k)}">${k}</a> |
|
222 | 222 | %else: |
|
223 | 223 | ${h.get_permission_name(k)} |
|
224 | 224 | %endif |
|
225 | 225 | </td> |
|
226 | 226 | <td> |
|
227 | 227 | %if section == 'global': |
|
228 | 228 | ${h.bool2icon(k.split('.')[-1] != 'none')} |
|
229 | 229 | %else: |
|
230 | 230 | <span class="perm_tag ${_perm}">${section_perm}</span> |
|
231 | 231 | %endif |
|
232 | 232 | </td> |
|
233 | 233 | <td> |
|
234 | 234 | %if section == 'repositories': |
|
235 | 235 | <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a> |
|
236 | 236 | %elif section == 'repositories_groups': |
|
237 | 237 | <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a> |
|
238 | 238 | %else: |
|
239 | 239 | -- |
|
240 | 240 | %endif |
|
241 | 241 | </td> |
|
242 | 242 | </tr> |
|
243 | 243 | %endfor |
|
244 | 244 | </tbody> |
|
245 | 245 | </table> |
|
246 | 246 | </div> |
|
247 | 247 | %endif |
|
248 | 248 | %endfor |
|
249 | 249 | </div> |
|
250 | 250 | </div> |
|
251 | 251 | <div class="box box-left" style="clear:left"> |
|
252 | 252 | <!-- box / title --> |
|
253 | 253 | <div class="title"> |
|
254 | 254 | <h5>${_('Email addresses')}</h5> |
|
255 | 255 | </div> |
|
256 | 256 | |
|
257 | 257 | <div class="emails_wrap"> |
|
258 | 258 | <table class="noborder"> |
|
259 | 259 | %for em in c.user_email_map: |
|
260 | 260 | <tr> |
|
261 | 261 | <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(em.user.email,16)}"/> </div></td> |
|
262 | 262 | <td><div class="email">${em.email}</div></td> |
|
263 | 263 | <td> |
|
264 | 264 | ${h.form(url('user_emails_delete', id=c.user.user_id),method='delete')} |
|
265 | 265 | ${h.hidden('del_email',em.email_id)} |
|
266 | 266 | ${h.submit('remove_',_('delete'),id="remove_email_%s" % em.email_id, |
|
267 | 267 | class_="delete_icon action_button", onclick="return confirm('"+_('Confirm to delete this email: %s') % em.email+"');")} |
|
268 | 268 | ${h.end_form()} |
|
269 | 269 | </td> |
|
270 | 270 | </tr> |
|
271 | 271 | %endfor |
|
272 | 272 | </table> |
|
273 | 273 | </div> |
|
274 | 274 | |
|
275 | 275 | ${h.form(url('user_emails', id=c.user.user_id),method='put')} |
|
276 | 276 | <div class="form"> |
|
277 | 277 | <!-- fields --> |
|
278 | 278 | <div class="fields"> |
|
279 | 279 | <div class="field"> |
|
280 | 280 | <div class="label"> |
|
281 | 281 | <label for="new_email">${_('New email address')}:</label> |
|
282 | 282 | </div> |
|
283 | 283 | <div class="input"> |
|
284 | 284 | ${h.text('new_email', class_='medium')} |
|
285 | 285 | </div> |
|
286 | 286 | </div> |
|
287 | 287 | <div class="buttons"> |
|
288 | 288 | ${h.submit('save',_('Add'),class_="ui-btn large")} |
|
289 | 289 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
290 | 290 | </div> |
|
291 | 291 | </div> |
|
292 | 292 | </div> |
|
293 | 293 | ${h.end_form()} |
|
294 | 294 | </div> |
|
295 | 295 | <div class="box box-left" style="clear:left"> |
|
296 | 296 | <!-- box / title --> |
|
297 | 297 | <div class="title"> |
|
298 | 298 | <h5>${_('Allowed IP addresses')}</h5> |
|
299 | 299 | </div> |
|
300 | 300 | |
|
301 | 301 | <div class="ips_wrap"> |
|
302 | 302 | <table class="noborder"> |
|
303 | 303 | %if c.user_ip_map: |
|
304 | 304 | %for ip in c.user_ip_map: |
|
305 | 305 | <tr> |
|
306 | 306 | <td><div class="ip">${ip.ip_addr}</div></td> |
|
307 | 307 | <td><div class="ip">${h.ip_range(ip.ip_addr)}</div></td> |
|
308 | 308 | <td> |
|
309 | 309 | ${h.form(url('user_ips_delete', id=c.user.user_id),method='delete')} |
|
310 | 310 | ${h.hidden('del_ip',ip.ip_id)} |
|
311 | 311 | ${h.submit('remove_',_('delete'),id="remove_ip_%s" % ip.ip_id, |
|
312 | 312 | class_="delete_icon action_button", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")} |
|
313 | 313 | ${h.end_form()} |
|
314 | 314 | </td> |
|
315 | 315 | </tr> |
|
316 | 316 | %endfor |
|
317 | 317 | %else: |
|
318 | 318 | <tr><td><div class="ip">${_('All IP addresses are allowed')}</div></td></tr> |
|
319 | 319 | %endif |
|
320 | 320 | </table> |
|
321 | 321 | </div> |
|
322 | 322 | |
|
323 | 323 | ${h.form(url('user_ips', id=c.user.user_id),method='put')} |
|
324 | 324 | <div class="form"> |
|
325 | 325 | <!-- fields --> |
|
326 | 326 | <div class="fields"> |
|
327 | 327 | <div class="field"> |
|
328 | 328 | <div class="label"> |
|
329 | 329 | <label for="new_ip">${_('New ip address')}:</label> |
|
330 | 330 | </div> |
|
331 | 331 | <div class="input"> |
|
332 | 332 | ${h.text('new_ip', class_='medium')} |
|
333 | 333 | </div> |
|
334 | 334 | </div> |
|
335 | 335 | <div class="buttons"> |
|
336 | 336 | ${h.submit('save',_('Add'),class_="ui-btn large")} |
|
337 | 337 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
338 | 338 | </div> |
|
339 | 339 | </div> |
|
340 | 340 | </div> |
|
341 | 341 | ${h.end_form()} |
|
342 | 342 | </div> |
|
343 | 343 | </%def> |
@@ -1,284 +1,284 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('My account')} ${c.rhodecode_user.username} · ${c.rhodecode_name} |
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | <%def name="breadcrumbs_links()"> |
|
9 | 9 | ${_('My Account')} |
|
10 | 10 | </%def> |
|
11 | 11 | |
|
12 | 12 | <%def name="page_nav()"> |
|
13 | 13 | ${self.menu('admin')} |
|
14 | 14 | </%def> |
|
15 | 15 | |
|
16 | 16 | <%def name="main()"> |
|
17 | 17 | |
|
18 | 18 | <div class="box box-left"> |
|
19 | 19 | <!-- box / title --> |
|
20 | 20 | <div class="title"> |
|
21 | 21 | ${self.breadcrumbs()} |
|
22 | 22 | </div> |
|
23 | 23 | <!-- end box / title --> |
|
24 | 24 | ${c.form|n} |
|
25 | 25 | </div> |
|
26 | 26 | |
|
27 | 27 | <div class="box box-right"> |
|
28 | 28 | <!-- box / title --> |
|
29 | 29 | <div class="title"> |
|
30 | 30 | <h5> |
|
31 | 31 | <input class="q_filter_box" id="q_filter" size="15" type="text" name="filter" value="${_('quick filter...')}" style="display: none"/> |
|
32 | 32 | </h5> |
|
33 | 33 | <ul class="links" style="color:#DADADA"> |
|
34 | 34 | <li> |
|
35 | 35 | <span><a id="show_perms" class="link-white current" href="#perms">${_('My permissions')}</a> </span> |
|
36 | 36 | </li> |
|
37 | 37 | <li> |
|
38 | 38 | <span><a id="show_my" class="link-white" href="#my">${_('My repos')}</a> </span> |
|
39 | 39 | </li> |
|
40 | 40 | <li> |
|
41 | 41 | <span><a id="show_pullrequests" class="link-white" href="#pullrequests">${_('My pull requests')}</a> </span> |
|
42 | 42 | </li> |
|
43 | 43 | </ul> |
|
44 | 44 | </div> |
|
45 | 45 | <!-- end box / title --> |
|
46 | 46 | <div id="perms_container"> |
|
47 | 47 | <div id="perms" class="table"> |
|
48 | 48 | %for section in sorted(c.rhodecode_user.permissions.keys()): |
|
49 | 49 | <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> |
|
50 | 50 | |
|
51 | 51 | <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> |
|
52 | 52 | <table id="tbl_list_${section}"> |
|
53 | 53 | <thead> |
|
54 | 54 | <tr> |
|
55 | 55 | <th class="left">${_('Name')}</th> |
|
56 | 56 | <th class="left">${_('Permission')}</th> |
|
57 | 57 | </thead> |
|
58 | 58 | <tbody> |
|
59 | %for k in c.rhodecode_user.permissions[section]: | |
|
59 | %for k in sorted(c.rhodecode_user.permissions[section], key=lambda s: s.lower): | |
|
60 | 60 | <% |
|
61 | 61 | if section != 'global': |
|
62 | 62 | section_perm = c.rhodecode_user.permissions[section].get(k) |
|
63 | 63 | _perm = section_perm.split('.')[-1] |
|
64 | 64 | else: |
|
65 | 65 | _perm = section_perm = None |
|
66 | 66 | %> |
|
67 | 67 | %if _perm not in ['none']: |
|
68 | 68 | <tr> |
|
69 | 69 | <td> |
|
70 | 70 | %if section == 'repositories': |
|
71 | 71 | <a href="${h.url('summary_home',repo_name=k)}">${k}</a> |
|
72 | 72 | %elif section == 'repositories_groups': |
|
73 | 73 | <a href="${h.url('repos_group_home',group_name=k)}">${k}</a> |
|
74 | 74 | %else: |
|
75 | 75 | ${k} |
|
76 | 76 | %endif |
|
77 | 77 | </td> |
|
78 | 78 | <td> |
|
79 | 79 | %if section == 'global': |
|
80 | 80 | ${h.bool2icon(True)} |
|
81 | 81 | %else: |
|
82 | 82 | <span class="perm_tag ${_perm}">${section_perm}</span> |
|
83 | 83 | %endif |
|
84 | 84 | </td> |
|
85 | 85 | </tr> |
|
86 | 86 | %endif |
|
87 | 87 | %endfor |
|
88 | 88 | </tbody> |
|
89 | 89 | </table> |
|
90 | 90 | </div> |
|
91 | 91 | %endfor |
|
92 | 92 | </div> |
|
93 | 93 | </div> |
|
94 | 94 | <div id="my_container" style="display:none"> |
|
95 | 95 | <div class="table yui-skin-sam" id="repos_list_wrap"></div> |
|
96 | 96 | <div id="user-paginator" style="padding: 0px 0px 0px 20px"></div> |
|
97 | 97 | </div> |
|
98 | 98 | <div id="pullrequests_container" class="table" style="display:none"> |
|
99 | 99 | ## loaded via AJAX |
|
100 | 100 | ${_('Loading...')} |
|
101 | 101 | </div> |
|
102 | 102 | </div> |
|
103 | 103 | |
|
104 | 104 | <script type="text/javascript"> |
|
105 | 105 | pyroutes.register('admin_settings_my_pullrequests', "${url('admin_settings_my_pullrequests')}", []); |
|
106 | 106 | |
|
107 | 107 | var show_perms = function(e){ |
|
108 | 108 | YUD.addClass('show_perms', 'current'); |
|
109 | 109 | YUD.removeClass('show_my','current'); |
|
110 | 110 | YUD.removeClass('show_pullrequests','current'); |
|
111 | 111 | |
|
112 | 112 | YUD.setStyle('my_container','display','none'); |
|
113 | 113 | YUD.setStyle('pullrequests_container','display','none'); |
|
114 | 114 | YUD.setStyle('perms_container','display',''); |
|
115 | 115 | YUD.setStyle('q_filter','display','none'); |
|
116 | 116 | } |
|
117 | 117 | YUE.on('show_perms','click',function(e){ |
|
118 | 118 | show_perms(); |
|
119 | 119 | }) |
|
120 | 120 | |
|
121 | 121 | var show_my = function(e){ |
|
122 | 122 | YUD.addClass('show_my', 'current'); |
|
123 | 123 | YUD.removeClass('show_perms','current'); |
|
124 | 124 | YUD.removeClass('show_pullrequests','current'); |
|
125 | 125 | |
|
126 | 126 | YUD.setStyle('perms_container','display','none'); |
|
127 | 127 | YUD.setStyle('pullrequests_container','display','none'); |
|
128 | 128 | YUD.setStyle('my_container','display',''); |
|
129 | 129 | YUD.setStyle('q_filter','display',''); |
|
130 | 130 | if(!YUD.hasClass('show_my', 'loaded')){ |
|
131 | 131 | table_renderer(${c.data |n}); |
|
132 | 132 | YUD.addClass('show_my', 'loaded'); |
|
133 | 133 | } |
|
134 | 134 | } |
|
135 | 135 | YUE.on('show_my','click',function(e){ |
|
136 | 136 | show_my(e); |
|
137 | 137 | }) |
|
138 | 138 | |
|
139 | 139 | var show_pullrequests = function(e){ |
|
140 | 140 | YUD.addClass('show_pullrequests', 'current'); |
|
141 | 141 | YUD.removeClass('show_my','current'); |
|
142 | 142 | YUD.removeClass('show_perms','current'); |
|
143 | 143 | |
|
144 | 144 | YUD.setStyle('my_container','display','none'); |
|
145 | 145 | YUD.setStyle('perms_container','display','none'); |
|
146 | 146 | YUD.setStyle('pullrequests_container','display',''); |
|
147 | 147 | YUD.setStyle('q_filter','display','none'); |
|
148 | 148 | |
|
149 | 149 | var url = pyroutes.url('admin_settings_my_pullrequests'); |
|
150 | 150 | if(YUD.get('show_closed') && YUD.get('show_closed').checked) { |
|
151 | 151 | var url = pyroutes.url('admin_settings_my_pullrequests', {'pr_show_closed': '1'}); |
|
152 | 152 | } |
|
153 | 153 | ypjax(url, 'pullrequests_container', function(){ |
|
154 | 154 | YUE.on('show_closed','change',function (e) { |
|
155 | 155 | show_pullrequests(e); |
|
156 | 156 | }); |
|
157 | 157 | }); |
|
158 | 158 | } |
|
159 | 159 | YUE.on('show_pullrequests','click',function(e){ |
|
160 | 160 | show_pullrequests(e) |
|
161 | 161 | }) |
|
162 | 162 | |
|
163 | 163 | var tabs = { |
|
164 | 164 | 'perms': show_perms, |
|
165 | 165 | 'my': show_my, |
|
166 | 166 | 'pullrequests': show_pullrequests |
|
167 | 167 | } |
|
168 | 168 | var url = location.href.split('#'); |
|
169 | 169 | if (url[1]) { |
|
170 | 170 | //We have a hash |
|
171 | 171 | var tabHash = url[1]; |
|
172 | 172 | var func = tabs[tabHash] |
|
173 | 173 | if (func){ |
|
174 | 174 | func(); |
|
175 | 175 | } |
|
176 | 176 | } |
|
177 | 177 | |
|
178 | 178 | function table_renderer(data){ |
|
179 | 179 | var myDataSource = new YAHOO.util.DataSource(data); |
|
180 | 180 | myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; |
|
181 | 181 | |
|
182 | 182 | myDataSource.responseSchema = { |
|
183 | 183 | resultsList: "records", |
|
184 | 184 | fields: [ |
|
185 | 185 | {key:"menu"}, |
|
186 | 186 | {key:"raw_name"}, |
|
187 | 187 | {key:"name"}, |
|
188 | 188 | {key:"last_changeset"}, |
|
189 | 189 | {key:"action"}, |
|
190 | 190 | ] |
|
191 | 191 | }; |
|
192 | 192 | myDataSource.doBeforeCallback = function(req,raw,res,cb) { |
|
193 | 193 | // This is the filter function |
|
194 | 194 | var data = res.results || [], |
|
195 | 195 | filtered = [], |
|
196 | 196 | i,l; |
|
197 | 197 | |
|
198 | 198 | if (req) { |
|
199 | 199 | req = req.toLowerCase(); |
|
200 | 200 | for (i = 0; i<data.length; i++) { |
|
201 | 201 | var pos = data[i].raw_name.toLowerCase().indexOf(req) |
|
202 | 202 | if (pos != -1) { |
|
203 | 203 | filtered.push(data[i]); |
|
204 | 204 | } |
|
205 | 205 | } |
|
206 | 206 | res.results = filtered; |
|
207 | 207 | } |
|
208 | 208 | return res; |
|
209 | 209 | } |
|
210 | 210 | |
|
211 | 211 | // main table sorting |
|
212 | 212 | var myColumnDefs = [ |
|
213 | 213 | {key:"menu",label:"",sortable:false,className:"quick_repo_menu hidden"}, |
|
214 | 214 | {key:"name",label:"${_('Name')}",sortable:true, |
|
215 | 215 | sortOptions: { sortFunction: nameSort }}, |
|
216 | 216 | {key:"last_changeset",label:"${_('Tip')}",sortable:true, |
|
217 | 217 | sortOptions: { sortFunction: revisionSort }}, |
|
218 | 218 | {key:"action",label:"${_('Action')}",sortable:false}, |
|
219 | 219 | ]; |
|
220 | 220 | |
|
221 | 221 | var myDataTable = new YAHOO.widget.DataTable("repos_list_wrap", myColumnDefs, myDataSource,{ |
|
222 | 222 | sortedBy:{key:"name",dir:"asc"}, |
|
223 | 223 | paginator: new YAHOO.widget.Paginator({ |
|
224 | 224 | rowsPerPage: 50, |
|
225 | 225 | alwaysVisible: false, |
|
226 | 226 | template : "{PreviousPageLink} {FirstPageLink} {PageLinks} {LastPageLink} {NextPageLink}", |
|
227 | 227 | pageLinks: 5, |
|
228 | 228 | containerClass: 'pagination-wh', |
|
229 | 229 | currentPageClass: 'pager_curpage', |
|
230 | 230 | pageLinkClass: 'pager_link', |
|
231 | 231 | nextPageLinkLabel: '>', |
|
232 | 232 | previousPageLinkLabel: '<', |
|
233 | 233 | firstPageLinkLabel: '<<', |
|
234 | 234 | lastPageLinkLabel: '>>', |
|
235 | 235 | containers:['user-paginator'] |
|
236 | 236 | }), |
|
237 | 237 | |
|
238 | 238 | MSG_SORTASC:"${_('Click to sort ascending')}", |
|
239 | 239 | MSG_SORTDESC:"${_('Click to sort descending')}", |
|
240 | 240 | MSG_EMPTY:"${_('No records found.')}", |
|
241 | 241 | MSG_ERROR:"${_('Data error.')}", |
|
242 | 242 | MSG_LOADING:"${_('Loading...')}", |
|
243 | 243 | } |
|
244 | 244 | ); |
|
245 | 245 | myDataTable.subscribe('postRenderEvent',function(oArgs) { |
|
246 | 246 | tooltip_activate(); |
|
247 | 247 | quick_repo_menu(); |
|
248 | 248 | }); |
|
249 | 249 | |
|
250 | 250 | var filterTimeout = null; |
|
251 | 251 | |
|
252 | 252 | updateFilter = function() { |
|
253 | 253 | // Reset timeout |
|
254 | 254 | filterTimeout = null; |
|
255 | 255 | |
|
256 | 256 | // Reset sort |
|
257 | 257 | var state = myDataTable.getState(); |
|
258 | 258 | state.sortedBy = {key:'name', dir:YAHOO.widget.DataTable.CLASS_ASC}; |
|
259 | 259 | |
|
260 | 260 | // Get filtered data |
|
261 | 261 | myDataSource.sendRequest(YUD.get('q_filter').value,{ |
|
262 | 262 | success : myDataTable.onDataReturnInitializeTable, |
|
263 | 263 | failure : myDataTable.onDataReturnInitializeTable, |
|
264 | 264 | scope : myDataTable, |
|
265 | 265 | argument: state |
|
266 | 266 | }); |
|
267 | 267 | |
|
268 | 268 | }; |
|
269 | 269 | YUE.on('q_filter','click',function(){ |
|
270 | 270 | if(!YUD.hasClass('q_filter', 'loaded')){ |
|
271 | 271 | YUD.get('q_filter').value = ''; |
|
272 | 272 | //TODO: load here full list later to do search within groups |
|
273 | 273 | YUD.addClass('q_filter', 'loaded'); |
|
274 | 274 | } |
|
275 | 275 | }); |
|
276 | 276 | |
|
277 | 277 | YUE.on('q_filter','keyup',function (e) { |
|
278 | 278 | clearTimeout(filterTimeout); |
|
279 | 279 | filterTimeout = setTimeout(updateFilter,600); |
|
280 | 280 | }); |
|
281 | 281 | |
|
282 | 282 | } |
|
283 | 283 | </script> |
|
284 | 284 | </%def> |
@@ -1,228 +1,228 b'' | |||
|
1 | 1 | ## -*- coding: utf-8 -*- |
|
2 | 2 | <%inherit file="/base/base.html"/> |
|
3 | 3 | |
|
4 | 4 | <%def name="title()"> |
|
5 | 5 | ${_('Edit user group')} ${c.users_group.users_group_name} · ${c.rhodecode_name} |
|
6 | 6 | </%def> |
|
7 | 7 | |
|
8 | 8 | <%def name="breadcrumbs_links()"> |
|
9 | 9 | ${h.link_to(_('Admin'),h.url('admin_home'))} |
|
10 | 10 | » |
|
11 | 11 | ${h.link_to(_('UserGroups'),h.url('users_groups'))} |
|
12 | 12 | » |
|
13 | 13 | ${_('edit')} "${c.users_group.users_group_name}" |
|
14 | 14 | </%def> |
|
15 | 15 | |
|
16 | 16 | <%def name="page_nav()"> |
|
17 | 17 | ${self.menu('admin')} |
|
18 | 18 | </%def> |
|
19 | 19 | |
|
20 | 20 | <%def name="main()"> |
|
21 | 21 | <div class="box box-left"> |
|
22 | 22 | <!-- box / title --> |
|
23 | 23 | <div class="title"> |
|
24 | 24 | ${self.breadcrumbs()} |
|
25 | 25 | </div> |
|
26 | 26 | <!-- end box / title --> |
|
27 | 27 | ${h.form(url('users_group', id=c.users_group.users_group_id),method='put', id='edit_users_group')} |
|
28 | 28 | <div class="form"> |
|
29 | 29 | <!-- fields --> |
|
30 | 30 | <div class="fields"> |
|
31 | 31 | <div class="field"> |
|
32 | 32 | <div class="label"> |
|
33 | 33 | <label for="users_group_name">${_('Group name')}:</label> |
|
34 | 34 | </div> |
|
35 | 35 | <div class="input"> |
|
36 | 36 | ${h.text('users_group_name',class_='small')} |
|
37 | 37 | </div> |
|
38 | 38 | </div> |
|
39 | 39 | |
|
40 | 40 | <div class="field"> |
|
41 | 41 | <div class="label label-checkbox"> |
|
42 | 42 | <label for="users_group_active">${_('Active')}:</label> |
|
43 | 43 | </div> |
|
44 | 44 | <div class="checkboxes"> |
|
45 | 45 | ${h.checkbox('users_group_active',value=True)} |
|
46 | 46 | </div> |
|
47 | 47 | </div> |
|
48 | 48 | <div class="field"> |
|
49 | 49 | <div class="label"> |
|
50 | 50 | <label for="users_group_active">${_('Members')}:</label> |
|
51 | 51 | </div> |
|
52 | 52 | <div class="select"> |
|
53 | 53 | <table> |
|
54 | 54 | <tr> |
|
55 | 55 | <td> |
|
56 | 56 | <div> |
|
57 | 57 | <div style="float:left"> |
|
58 | 58 | <div class="text" style="padding: 0px 0px 6px;">${_('Chosen group members')}</div> |
|
59 | 59 | ${h.select('users_group_members',[x[0] for x in c.group_members],c.group_members,multiple=True,size=8,style="min-width:210px")} |
|
60 | 60 | <div id="remove_all_elements" style="cursor:pointer;text-align:center"> |
|
61 | 61 | ${_('Remove all elements')} |
|
62 | 62 | <img alt="remove" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_right.png')}"/> |
|
63 | 63 | </div> |
|
64 | 64 | </div> |
|
65 | 65 | <div style="float:left;width:20px;padding-top:50px"> |
|
66 | 66 | <img alt="add" id="add_element" |
|
67 | 67 | style="padding:2px;cursor:pointer" |
|
68 | 68 | src="${h.url('/images/icons/arrow_left.png')}"/> |
|
69 | 69 | <br /> |
|
70 | 70 | <img alt="remove" id="remove_element" |
|
71 | 71 | style="padding:2px;cursor:pointer" |
|
72 | 72 | src="${h.url('/images/icons/arrow_right.png')}"/> |
|
73 | 73 | </div> |
|
74 | 74 | <div style="float:left"> |
|
75 | 75 | <div class="text" style="padding: 0px 0px 6px;">${_('Available members')}</div> |
|
76 | 76 | ${h.select('available_members',[],c.available_members,multiple=True,size=8,style="min-width:210px")} |
|
77 | 77 | <div id="add_all_elements" style="cursor:pointer;text-align:center"> |
|
78 | 78 | <img alt="add" style="vertical-align:text-bottom" src="${h.url('/images/icons/arrow_left.png')}"/> |
|
79 | 79 | ${_('Add all elements')} |
|
80 | 80 | </div> |
|
81 | 81 | </div> |
|
82 | 82 | </div> |
|
83 | 83 | </td> |
|
84 | 84 | </tr> |
|
85 | 85 | </table> |
|
86 | 86 | </div> |
|
87 | 87 | |
|
88 | 88 | </div> |
|
89 | 89 | <div class="buttons"> |
|
90 | 90 | ${h.submit('save',_('save'),class_="ui-btn large")} |
|
91 | 91 | </div> |
|
92 | 92 | </div> |
|
93 | 93 | </div> |
|
94 | 94 | ${h.end_form()} |
|
95 | 95 | </div> |
|
96 | 96 | |
|
97 | 97 | <div class="box box-right"> |
|
98 | 98 | <!-- box / title --> |
|
99 | 99 | <div class="title"> |
|
100 | 100 | <h5>${_('Permissions')}</h5> |
|
101 | 101 | </div> |
|
102 | 102 | ${h.form(url('users_group_perm', id=c.users_group.users_group_id), method='put')} |
|
103 | 103 | <div class="form"> |
|
104 | 104 | <!-- fields --> |
|
105 | 105 | <div class="fields"> |
|
106 | 106 | <div class="field"> |
|
107 | 107 | <div class="label label-checkbox"> |
|
108 | 108 | <label for="inherit_permissions">${_('Inherit default permissions')}:</label> |
|
109 | 109 | </div> |
|
110 | 110 | <div class="checkboxes"> |
|
111 | 111 | ${h.checkbox('inherit_default_permissions',value=True)} |
|
112 | 112 | </div> |
|
113 | 113 | <span class="help-block">${h.literal(_('Select to inherit permissions from %s settings. ' |
|
114 | 114 | 'With this selected below options does not have any action') % h.link_to('default', url('edit_permission', id='default')))}</span> |
|
115 | 115 | </div> |
|
116 | 116 | <div id="inherit_overlay" style="${'opacity:0.3' if c.users_group.inherit_default_permissions else ''}" > |
|
117 | 117 | <div class="field"> |
|
118 | 118 | <div class="label label-checkbox"> |
|
119 | 119 | <label for="create_repo_perm">${_('Create repositories')}:</label> |
|
120 | 120 | </div> |
|
121 | 121 | <div class="checkboxes"> |
|
122 | 122 | ${h.checkbox('create_repo_perm',value=True)} |
|
123 | 123 | </div> |
|
124 | 124 | </div> |
|
125 | 125 | <div class="field"> |
|
126 | 126 | <div class="label label-checkbox"> |
|
127 | 127 | <label for="fork_repo_perm">${_('Fork repositories')}:</label> |
|
128 | 128 | </div> |
|
129 | 129 | <div class="checkboxes"> |
|
130 | 130 | ${h.checkbox('fork_repo_perm',value=True)} |
|
131 | 131 | </div> |
|
132 | 132 | </div> |
|
133 | 133 | </div> |
|
134 | 134 | <div class="buttons"> |
|
135 | 135 | ${h.submit('save',_('Save'),class_="ui-btn large")} |
|
136 | 136 | ${h.reset('reset',_('Reset'),class_="ui-btn large")} |
|
137 | 137 | </div> |
|
138 | 138 | </div> |
|
139 | 139 | </div> |
|
140 | 140 | ${h.end_form()} |
|
141 | 141 | </div> |
|
142 | 142 | |
|
143 | 143 | <div class="box box-right"> |
|
144 | 144 | <!-- box / title --> |
|
145 | 145 | <div class="title"> |
|
146 | 146 | <h5>${_('Group members')}</h5> |
|
147 | 147 | </div> |
|
148 | 148 | |
|
149 | 149 | <div class="group_members_wrap"> |
|
150 | 150 | % if c.group_members_obj: |
|
151 | 151 | <ul class="group_members"> |
|
152 | 152 | %for user in c.group_members_obj: |
|
153 | 153 | <li> |
|
154 | 154 | <div class="group_member"> |
|
155 | 155 | <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(user.email,24)}"/> </div> |
|
156 | 156 | <div>${h.link_to(user.username, h.url('edit_user',id=user.user_id))}</div> |
|
157 | 157 | <div>${user.full_name}</div> |
|
158 | 158 | </div> |
|
159 | 159 | </li> |
|
160 | 160 | %endfor |
|
161 | 161 | </ul> |
|
162 | 162 | %else: |
|
163 | 163 | <span class="empty_data">${_('No members yet')}</span> |
|
164 | 164 | %endif |
|
165 | 165 | </div> |
|
166 | 166 | </div> |
|
167 | 167 | |
|
168 | 168 | <div class="box box-left"> |
|
169 | 169 | <!-- box / title --> |
|
170 | 170 | <div class="title"> |
|
171 | 171 | <h5>${_('Permissions defined for this group')}</h5> |
|
172 | 172 | </div> |
|
173 | 173 | ## permissions overview |
|
174 | 174 | <div id="perms" class="table"> |
|
175 | 175 | %for section in sorted(c.users_group.permissions.keys()): |
|
176 | 176 | <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div> |
|
177 | 177 | %if not c.users_group.permissions: |
|
178 | 178 | <span class="empty_data">${_('No permissions set yet')}</span> |
|
179 | 179 | %else: |
|
180 | 180 | <div id='tbl_list_wrap_${section}' class="yui-skin-sam"> |
|
181 | 181 | <table id="tbl_list_repository"> |
|
182 | 182 | <thead> |
|
183 | 183 | <tr> |
|
184 | 184 | <th class="left">${_('Name')}</th> |
|
185 | 185 | <th class="left">${_('Permission')}</th> |
|
186 | 186 | <th class="left">${_('Edit Permission')}</th> |
|
187 | 187 | </thead> |
|
188 | 188 | <tbody> |
|
189 | %for k in c.users_group.permissions[section]: | |
|
189 | %for k in sorted(c.users_group.permissions[section], key=lambda s: s.lower): | |
|
190 | 190 | <% |
|
191 | 191 | section_perm = c.users_group.permissions[section].get(k) |
|
192 | 192 | _perm = section_perm.split('.')[-1] |
|
193 | 193 | %> |
|
194 | 194 | <tr> |
|
195 | 195 | <td> |
|
196 | 196 | %if section == 'repositories': |
|
197 | 197 | <a href="${h.url('summary_home',repo_name=k)}">${k}</a> |
|
198 | 198 | %elif section == 'repositories_groups': |
|
199 | 199 | <a href="${h.url('repos_group_home',group_name=k)}">${k}</a> |
|
200 | 200 | %endif |
|
201 | 201 | </td> |
|
202 | 202 | <td> |
|
203 | 203 | <span class="perm_tag ${_perm}">${section_perm}</span> |
|
204 | 204 | </td> |
|
205 | 205 | <td> |
|
206 | 206 | %if section == 'repositories': |
|
207 | 207 | <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a> |
|
208 | 208 | %elif section == 'repositories_groups': |
|
209 | 209 | <a href="${h.url('edit_repos_group',group_name=k,anchor='permissions_manage')}">${_('edit')}</a> |
|
210 | 210 | %else: |
|
211 | 211 | -- |
|
212 | 212 | %endif |
|
213 | 213 | </td> |
|
214 | 214 | </tr> |
|
215 | 215 | %endfor |
|
216 | 216 | </tbody> |
|
217 | 217 | </table> |
|
218 | 218 | </div> |
|
219 | 219 | %endif |
|
220 | 220 | %endfor |
|
221 | 221 | </div> |
|
222 | 222 | </div> |
|
223 | 223 | |
|
224 | 224 | |
|
225 | 225 | <script type="text/javascript"> |
|
226 | 226 | MultiSelectWidget('users_group_members','available_members','edit_users_group'); |
|
227 | 227 | </script> |
|
228 | 228 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now