Show More
@@ -41,6 +41,9 b' class MyAccountSshKeysView(BaseAppView, ' | |||
|
41 | 41 | def load_default_context(self): |
|
42 | 42 | c = self._get_local_tmpl_context() |
|
43 | 43 | c.user = c.auth_user.get_instance() |
|
44 | ||
|
45 | c.ssh_enabled = self.request.registry.settings.get( | |
|
46 | 'ssh.generate_authorized_keyfile') | |
|
44 | 47 | self._register_global_c(c) |
|
45 | 48 | return c |
|
46 | 49 |
@@ -11,32 +11,37 b'' | |||
|
11 | 11 | <th>${_('Created')}</th> |
|
12 | 12 | <th>${_('Action')}</th> |
|
13 | 13 | </tr> |
|
14 |
%if c. |
|
|
15 | %for ssh_key in c.user_ssh_keys: | |
|
16 |
|
|
|
17 | <td class=""> | |
|
18 |
|
|
|
19 |
< |
|
|
20 |
<td class=" |
|
|
21 | <td class="td-tags">${h.format_date(ssh_key.created_on)}</td> | |
|
14 | % if not c.ssh_enabled: | |
|
15 | <tr><td colspan="4"><div class="">${_('SSH Keys usage is currently disabled, please ask your administrator to enable them.')}</div></td></tr> | |
|
16 | % else: | |
|
17 | %if c.user_ssh_keys: | |
|
18 | %for ssh_key in c.user_ssh_keys: | |
|
19 | <tr class=""> | |
|
20 | <td class=""> | |
|
21 | <code>${ssh_key.ssh_key_fingerprint}</code> | |
|
22 | </td> | |
|
23 | <td class="td-wrap">${ssh_key.description}</td> | |
|
24 | <td class="td-tags">${h.format_date(ssh_key.created_on)}</td> | |
|
22 | 25 | |
|
23 | <td class="td-action"> | |
|
24 | ${h.secure_form(h.route_path('my_account_ssh_keys_delete'), method='POST', request=request)} | |
|
25 | ${h.hidden('del_ssh_key', ssh_key.ssh_key_id)} | |
|
26 | <button class="btn btn-link btn-danger" type="submit" | |
|
27 | onclick="return confirm('${_('Confirm to remove ssh key %s') % ssh_key.ssh_key_fingerprint}');"> | |
|
28 | ${_('Delete')} | |
|
29 | </button> | |
|
30 | ${h.end_form()} | |
|
31 | </td> | |
|
32 | </tr> | |
|
33 | %endfor | |
|
34 | %else: | |
|
35 |
<tr><td><div class=" |
|
|
36 | %endif | |
|
26 | <td class="td-action"> | |
|
27 | ${h.secure_form(h.route_path('my_account_ssh_keys_delete'), method='POST', request=request)} | |
|
28 | ${h.hidden('del_ssh_key', ssh_key.ssh_key_id)} | |
|
29 | <button class="btn btn-link btn-danger" type="submit" | |
|
30 | onclick="return confirm('${_('Confirm to remove ssh key %s') % ssh_key.ssh_key_fingerprint}');"> | |
|
31 | ${_('Delete')} | |
|
32 | </button> | |
|
33 | ${h.end_form()} | |
|
34 | </td> | |
|
35 | </tr> | |
|
36 | %endfor | |
|
37 | %else: | |
|
38 | <tr><td colspan="4"><div class="">${_('No additional ssh keys specified')}</div></td></tr> | |
|
39 | %endif | |
|
40 | % endif | |
|
37 | 41 | </table> |
|
38 | 42 | </div> |
|
39 | 43 | |
|
44 | % if c.ssh_enabled: | |
|
40 | 45 | <div class="user_ssh_keys"> |
|
41 | 46 | ${h.secure_form(h.route_path('my_account_ssh_keys_add'), method='POST', request=request)} |
|
42 | 47 | <div class="form form-vertical"> |
@@ -66,6 +71,7 b'' | |||
|
66 | 71 | </div> |
|
67 | 72 | ${h.end_form()} |
|
68 | 73 | </div> |
|
74 | % endif | |
|
69 | 75 | </div> |
|
70 | 76 | </div> |
|
71 | 77 |
General Comments 0
You need to be logged in to leave comments.
Login now