##// END OF EJS Templates
fixes issue #506
marcink -
r2636:4dbc00e9 beta
parent child Browse files
Show More
@@ -1,261 +1,264
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="/base/base.html"/>
2 <%inherit file="/base/base.html"/>
3
3
4 <%def name="title()">
4 <%def name="title()">
5 ${_('Edit user')} ${c.user.username} - ${c.rhodecode_name}
5 ${_('Edit user')} ${c.user.username} - ${c.rhodecode_name}
6 </%def>
6 </%def>
7
7
8 <%def name="breadcrumbs_links()">
8 <%def name="breadcrumbs_links()">
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
9 ${h.link_to(_('Admin'),h.url('admin_home'))}
10 &raquo;
10 &raquo;
11 ${h.link_to(_('Users'),h.url('users'))}
11 ${h.link_to(_('Users'),h.url('users'))}
12 &raquo;
12 &raquo;
13 ${_('edit')} "${c.user.username}"
13 ${_('edit')} "${c.user.username}"
14 </%def>
14 </%def>
15
15
16 <%def name="page_nav()">
16 <%def name="page_nav()">
17 ${self.menu('admin')}
17 ${self.menu('admin')}
18 </%def>
18 </%def>
19
19
20 <%def name="main()">
20 <%def name="main()">
21 <div class="box box-left">
21 <div class="box box-left">
22 <!-- box / title -->
22 <!-- box / title -->
23 <div class="title">
23 <div class="title">
24 ${self.breadcrumbs()}
24 ${self.breadcrumbs()}
25 </div>
25 </div>
26 <!-- end box / title -->
26 <!-- end box / title -->
27 ${h.form(url('update_user', id=c.user.user_id),method='put')}
27 ${h.form(url('update_user', id=c.user.user_id),method='put')}
28 <div class="form">
28 <div class="form">
29 <div class="field">
29 <div class="field">
30 <div class="gravatar_box">
30 <div class="gravatar_box">
31 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
31 <div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(c.user.email)}"/></div>
32 <p>
32 <p>
33 %if c.use_gravatar:
33 %if c.use_gravatar:
34 <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
34 <strong>${_('Change your avatar at')} <a href="http://gravatar.com">gravatar.com</a></strong>
35 <br/>${_('Using')} ${c.user.email}
35 <br/>${_('Using')} ${c.user.email}
36 %else:
36 %else:
37 <br/>${c.user.email}
37 <br/>${c.user.email}
38 %endif
38 %endif
39 </div>
39 </div>
40 </div>
40 </div>
41 <div class="field">
41 <div class="field">
42 <div class="label">
42 <div class="label">
43 <label>${_('API key')}</label> ${c.user.api_key}
43 <label>${_('API key')}</label> ${c.user.api_key}
44 </div>
44 </div>
45 </div>
45 </div>
46
46
47 <div class="fields">
47 <div class="fields">
48 <div class="field">
48 <div class="field">
49 <div class="label">
49 <div class="label">
50 <label for="username">${_('Username')}:</label>
50 <label for="username">${_('Username')}:</label>
51 </div>
51 </div>
52 <div class="input">
52 <div class="input">
53 ${h.text('username',class_='medium')}
53 ${h.text('username',class_='medium')}
54 </div>
54 </div>
55 </div>
55 </div>
56
56
57 <div class="field">
57 <div class="field">
58 <div class="label">
58 <div class="label">
59 <label for="ldap_dn">${_('LDAP DN')}:</label>
59 <label for="ldap_dn">${_('LDAP DN')}:</label>
60 </div>
60 </div>
61 <div class="input">
61 <div class="input">
62 ${h.text('ldap_dn',class_='medium disabled',readonly="readonly")}
62 ${h.text('ldap_dn',class_='medium disabled',readonly="readonly")}
63 </div>
63 </div>
64 </div>
64 </div>
65
65
66 <div class="field">
66 <div class="field">
67 <div class="label">
67 <div class="label">
68 <label for="new_password">${_('New password')}:</label>
68 <label for="new_password">${_('New password')}:</label>
69 </div>
69 </div>
70 <div class="input">
70 <div class="input">
71 ${h.password('new_password',class_='medium',autocomplete="off")}
71 ${h.password('new_password',class_='medium',autocomplete="off")}
72 </div>
72 </div>
73 </div>
73 </div>
74
74
75 <div class="field">
75 <div class="field">
76 <div class="label">
76 <div class="label">
77 <label for="password_confirmation">${_('New password confirmation')}:</label>
77 <label for="password_confirmation">${_('New password confirmation')}:</label>
78 </div>
78 </div>
79 <div class="input">
79 <div class="input">
80 ${h.password('password_confirmation',class_="medium",autocomplete="off")}
80 ${h.password('password_confirmation',class_="medium",autocomplete="off")}
81 </div>
81 </div>
82 </div>
82 </div>
83
83
84 <div class="field">
84 <div class="field">
85 <div class="label">
85 <div class="label">
86 <label for="firstname">${_('First Name')}:</label>
86 <label for="firstname">${_('First Name')}:</label>
87 </div>
87 </div>
88 <div class="input">
88 <div class="input">
89 ${h.text('firstname',class_='medium')}
89 ${h.text('firstname',class_='medium')}
90 </div>
90 </div>
91 </div>
91 </div>
92
92
93 <div class="field">
93 <div class="field">
94 <div class="label">
94 <div class="label">
95 <label for="lastname">${_('Last Name')}:</label>
95 <label for="lastname">${_('Last Name')}:</label>
96 </div>
96 </div>
97 <div class="input">
97 <div class="input">
98 ${h.text('lastname',class_='medium')}
98 ${h.text('lastname',class_='medium')}
99 </div>
99 </div>
100 </div>
100 </div>
101
101
102 <div class="field">
102 <div class="field">
103 <div class="label">
103 <div class="label">
104 <label for="email">${_('Email')}:</label>
104 <label for="email">${_('Email')}:</label>
105 </div>
105 </div>
106 <div class="input">
106 <div class="input">
107 ${h.text('email',class_='medium')}
107 ${h.text('email',class_='medium')}
108 </div>
108 </div>
109 </div>
109 </div>
110
110
111 <div class="field">
111 <div class="field">
112 <div class="label label-checkbox">
112 <div class="label label-checkbox">
113 <label for="active">${_('Active')}:</label>
113 <label for="active">${_('Active')}:</label>
114 </div>
114 </div>
115 <div class="checkboxes">
115 <div class="checkboxes">
116 ${h.checkbox('active',value=True)}
116 ${h.checkbox('active',value=True)}
117 </div>
117 </div>
118 </div>
118 </div>
119
119
120 <div class="field">
120 <div class="field">
121 <div class="label label-checkbox">
121 <div class="label label-checkbox">
122 <label for="admin">${_('Admin')}:</label>
122 <label for="admin">${_('Admin')}:</label>
123 </div>
123 </div>
124 <div class="checkboxes">
124 <div class="checkboxes">
125 ${h.checkbox('admin',value=True)}
125 ${h.checkbox('admin',value=True)}
126 </div>
126 </div>
127 </div>
127 </div>
128 <div class="buttons">
128 <div class="buttons">
129 ${h.submit('save',_('Save'),class_="ui-btn large")}
129 ${h.submit('save',_('Save'),class_="ui-btn large")}
130 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
130 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
131 </div>
131 </div>
132 </div>
132 </div>
133 </div>
133 </div>
134 ${h.end_form()}
134 ${h.end_form()}
135 </div>
135 </div>
136 <div class="box box-right">
136 <div style="min-height:780px" class="box box-right">
137 <!-- box / title -->
137 <!-- box / title -->
138 <div class="title">
138 <div class="title">
139 <h5>${_('Permissions')}</h5>
139 <h5>${_('Permissions')}</h5>
140 </div>
140 </div>
141 ${h.form(url('user_perm', id=c.user.user_id),method='put')}
141 ${h.form(url('user_perm', id=c.user.user_id),method='put')}
142 <div class="form">
142 <div class="form">
143 <!-- fields -->
143 <!-- fields -->
144 <div class="fields">
144 <div class="fields">
145 <div class="field">
145 <div class="field">
146 <div class="label label-checkbox">
146 <div class="label label-checkbox">
147 <label for="create_repo_perm">${_('Create repositories')}:</label>
147 <label for="create_repo_perm">${_('Create repositories')}:</label>
148 </div>
148 </div>
149 <div class="checkboxes">
149 <div class="checkboxes">
150 ${h.checkbox('create_repo_perm',value=True)}
150 ${h.checkbox('create_repo_perm',value=True)}
151 </div>
151 </div>
152 </div>
152 </div>
153 <div class="buttons">
153 <div class="buttons">
154 ${h.submit('save',_('Save'),class_="ui-btn large")}
154 ${h.submit('save',_('Save'),class_="ui-btn large")}
155 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
155 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
156 </div>
156 </div>
157 </div>
157 </div>
158 </div>
158 </div>
159 ${h.end_form()}
159 ${h.end_form()}
160
160
161 ## permissions overview
161 ## permissions overview
162 <div id="perms" class="table">
162 <div id="perms" class="table">
163 %for section in sorted(c.perm_user.permissions.keys()):
163 %for section in sorted(c.perm_user.permissions.keys()):
164 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
164 <div class="perms_section_head">${section.replace("_"," ").capitalize()}</div>
165
165 %if not c.perm_user.permissions[section]:
166 <span style="color:#B9B9B9">${_('Nothing here yet')}</span>
167 %else:
166 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
168 <div id='tbl_list_wrap_${section}' class="yui-skin-sam">
167 <table id="tbl_list_${section}">
169 <table id="tbl_list_${section}">
168 <thead>
170 <thead>
169 <tr>
171 <tr>
170 <th class="left">${_('Name')}</th>
172 <th class="left">${_('Name')}</th>
171 <th class="left">${_('Permission')}</th>
173 <th class="left">${_('Permission')}</th>
172 <th class="left">${_('Edit Permission')}</th>
174 <th class="left">${_('Edit Permission')}</th>
173 </thead>
175 </thead>
174 <tbody>
176 <tbody>
175 %for k in c.perm_user.permissions[section]:
177 %for k in c.perm_user.permissions[section]:
176 <%
178 <%
177 if section != 'global':
179 if section != 'global':
178 section_perm = c.perm_user.permissions[section].get(k)
180 section_perm = c.perm_user.permissions[section].get(k)
179 _perm = section_perm.split('.')[-1]
181 _perm = section_perm.split('.')[-1]
180 else:
182 else:
181 _perm = section_perm = None
183 _perm = section_perm = None
182 %>
184 %>
183 <tr>
185 <tr>
184 <td>
186 <td>
185 %if section == 'repositories':
187 %if section == 'repositories':
186 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
188 <a href="${h.url('summary_home',repo_name=k)}">${k}</a>
187 %elif section == 'repositories_groups':
189 %elif section == 'repositories_groups':
188 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
190 <a href="${h.url('repos_group_home',group_name=k)}">${k}</a>
189 %else:
191 %else:
190 ${h.get_permission_name(k)}
192 ${h.get_permission_name(k)}
191 %endif
193 %endif
192 </td>
194 </td>
193 <td>
195 <td>
194 %if section == 'global':
196 %if section == 'global':
195 ${h.bool2icon(k.split('.')[-1] != 'none')}
197 ${h.bool2icon(k.split('.')[-1] != 'none')}
196 %else:
198 %else:
197 <span class="perm_tag ${_perm}">${section_perm}</span>
199 <span class="perm_tag ${_perm}">${section_perm}</span>
198 %endif
200 %endif
199 </td>
201 </td>
200 <td>
202 <td>
201 %if section == 'repositories':
203 %if section == 'repositories':
202 <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a>
204 <a href="${h.url('edit_repo',repo_name=k,anchor='permissions_manage')}">${_('edit')}</a>
203 %elif section == 'repositories_groups':
205 %elif section == 'repositories_groups':
204 <a href="${h.url('edit_repos_group',id=k,anchor='permissions_manage')}">${_('edit')}</a>
206 <a href="${h.url('edit_repos_group',id=k,anchor='permissions_manage')}">${_('edit')}</a>
205 %else:
207 %else:
206 --
208 --
207 %endif
209 %endif
208 </td>
210 </td>
209 </tr>
211 </tr>
210 %endfor
212 %endfor
211 </tbody>
213 </tbody>
212 </table>
214 </table>
213 </div>
215 </div>
216 %endif
214 %endfor
217 %endfor
215 </div>
218 </div>
216 </div>
219 </div>
217 <div class="box box-left">
220 <div class="box box-left">
218 <!-- box / title -->
221 <!-- box / title -->
219 <div class="title">
222 <div class="title">
220 <h5>${_('Email addresses')}</h5>
223 <h5>${_('Email addresses')}</h5>
221 </div>
224 </div>
222
225
223 <div class="emails_wrap">
226 <div class="emails_wrap">
224 <table class="noborder">
227 <table class="noborder">
225 %for em in c.user_email_map:
228 %for em in c.user_email_map:
226 <tr>
229 <tr>
227 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(em.user.email,16)}"/> </div></td>
230 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(em.user.email,16)}"/> </div></td>
228 <td><div class="email">${em.email}</div></td>
231 <td><div class="email">${em.email}</div></td>
229 <td>
232 <td>
230 ${h.form(url('user_emails_delete', id=c.user.user_id),method='delete')}
233 ${h.form(url('user_emails_delete', id=c.user.user_id),method='delete')}
231 ${h.hidden('del_email',em.email_id)}
234 ${h.hidden('del_email',em.email_id)}
232 ${h.submit('remove_',_('delete'),id="remove_email_%s" % em.email_id,
235 ${h.submit('remove_',_('delete'),id="remove_email_%s" % em.email_id,
233 class_="delete_icon action_button", onclick="return confirm('"+_('Confirm to delete this email: %s') % em.email+"');")}
236 class_="delete_icon action_button", onclick="return confirm('"+_('Confirm to delete this email: %s') % em.email+"');")}
234 ${h.end_form()}
237 ${h.end_form()}
235 </td>
238 </td>
236 </tr>
239 </tr>
237 %endfor
240 %endfor
238 </table>
241 </table>
239 </div>
242 </div>
240
243
241 ${h.form(url('user_emails', id=c.user.user_id),method='put')}
244 ${h.form(url('user_emails', id=c.user.user_id),method='put')}
242 <div class="form">
245 <div class="form">
243 <!-- fields -->
246 <!-- fields -->
244 <div class="fields">
247 <div class="fields">
245 <div class="field">
248 <div class="field">
246 <div class="label">
249 <div class="label">
247 <label for="email">${_('New email address')}:</label>
250 <label for="email">${_('New email address')}:</label>
248 </div>
251 </div>
249 <div class="input">
252 <div class="input">
250 ${h.text('new_email', class_='medium')}
253 ${h.text('new_email', class_='medium')}
251 </div>
254 </div>
252 </div>
255 </div>
253 <div class="buttons">
256 <div class="buttons">
254 ${h.submit('save',_('Add'),class_="ui-btn large")}
257 ${h.submit('save',_('Add'),class_="ui-btn large")}
255 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
258 ${h.reset('reset',_('Reset'),class_="ui-btn large")}
256 </div>
259 </div>
257 </div>
260 </div>
258 </div>
261 </div>
259 ${h.end_form()}
262 ${h.end_form()}
260 </div>
263 </div>
261 </%def>
264 </%def>
General Comments 0
You need to be logged in to leave comments. Login now