Show More
@@ -1,77 +1,78 b'' | |||||
1 | <div class="panel panel-default"> |
|
1 | <div class="panel panel-default"> | |
2 | <div class="panel-heading"> |
|
2 | <div class="panel-heading"> | |
3 | <h3 class="panel-title">${_('Custom IP Whitelist')}</h3> |
|
3 | <h3 class="panel-title">${_('Custom IP Whitelist')}</h3> | |
4 | </div> |
|
4 | </div> | |
5 | <div class="panel-body"> |
|
5 | <div class="panel-body"> | |
6 | <div class="ips_wrap"> |
|
6 | <div class="ips_wrap"> | |
|
7 | <h5>${_('Current IP address')}: <code>${c.rhodecode_user.ip_addr}</code></h5> | |||
7 | <table class="rctable ip-whitelist"> |
|
8 | <table class="rctable ip-whitelist"> | |
8 | <tr> |
|
9 | <tr> | |
9 | <th>IP Address</th> |
|
10 | <th>${_('IP Address')}</th> | |
10 | <th>IP Range</th> |
|
11 | <th>${_('IP Range')}</th> | |
11 | <th>Description</th> |
|
12 | <th>${_('Description')}</th> | |
12 | <th></th> |
|
13 | <th></th> | |
13 | </tr> |
|
14 | </tr> | |
14 | %if c.default_user_ip_map and c.inherit_default_ips: |
|
15 | %if c.default_user_ip_map and c.inherit_default_ips: | |
15 | %for ip in c.default_user_ip_map: |
|
16 | %for ip in c.default_user_ip_map: | |
16 | <tr> |
|
17 | <tr> | |
17 | <td class="td-ip"><div class="ip">${ip.ip_addr}</div></td> |
|
18 | <td class="td-ip"><div class="ip">${ip.ip_addr}</div></td> | |
18 | <td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td> |
|
19 | <td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td> | |
19 | <td class="td-description">${h.literal(_('Inherited from %s') % h.link_to('*default*',h.url('admin_permissions_ips')))}</td> |
|
20 | <td class="td-description">${h.literal(_('Inherited from %s') % h.link_to('*default*',h.url('admin_permissions_ips')))}</td> | |
20 | <td></td> |
|
21 | <td></td> | |
21 | </tr> |
|
22 | </tr> | |
22 | %endfor |
|
23 | %endfor | |
23 | %endif |
|
24 | %endif | |
24 |
|
25 | |||
25 | %if c.user_ip_map: |
|
26 | %if c.user_ip_map: | |
26 | %for ip in c.user_ip_map: |
|
27 | %for ip in c.user_ip_map: | |
27 | <tr> |
|
28 | <tr> | |
28 | <td class="td-ip"><div class="ip">${ip.ip_addr}</div></td> |
|
29 | <td class="td-ip"><div class="ip">${ip.ip_addr}</div></td> | |
29 | <td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td> |
|
30 | <td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td> | |
30 | <td class="td-description"><div class="ip">${ip.description}</div></td> |
|
31 | <td class="td-description"><div class="ip">${ip.description}</div></td> | |
31 | <td class="td-action"> |
|
32 | <td class="td-action"> | |
32 | ${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='delete')} |
|
33 | ${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='delete')} | |
33 | ${h.hidden('del_ip_id',ip.ip_id)} |
|
34 | ${h.hidden('del_ip_id',ip.ip_id)} | |
34 | ${h.submit('remove_',_('Delete'),id="remove_ip_%s" % ip.ip_id, |
|
35 | ${h.submit('remove_',_('Delete'),id="remove_ip_%s" % ip.ip_id, | |
35 | class_="btn btn-link btn-danger", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")} |
|
36 | class_="btn btn-link btn-danger", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")} | |
36 | ${h.end_form()} |
|
37 | ${h.end_form()} | |
37 | </td> |
|
38 | </td> | |
38 | </tr> |
|
39 | </tr> | |
39 | %endfor |
|
40 | %endfor | |
40 | %endif |
|
41 | %endif | |
41 | %if not c.default_user_ip_map and not c.user_ip_map: |
|
42 | %if not c.default_user_ip_map and not c.user_ip_map: | |
42 | <tr> |
|
43 | <tr> | |
43 | <td><h2 class="ip">${_('All IP addresses are allowed')}</h2></td> |
|
44 | <td><h2 class="ip">${_('All IP addresses are allowed')}</h2></td> | |
44 | <td></td> |
|
45 | <td></td> | |
45 | <td></td> |
|
46 | <td></td> | |
46 | <td></td> |
|
47 | <td></td> | |
47 | </tr> |
|
48 | </tr> | |
48 | %endif |
|
49 | %endif | |
49 | </table> |
|
50 | </table> | |
50 | </div> |
|
51 | </div> | |
51 |
|
52 | |||
52 | <div> |
|
53 | <div> | |
53 | ${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='put')} |
|
54 | ${h.secure_form(url('edit_user_ips', user_id=c.user.user_id),method='put')} | |
54 | <div class="form"> |
|
55 | <div class="form"> | |
55 | <!-- fields --> |
|
56 | <!-- fields --> | |
56 | <div class="fields"> |
|
57 | <div class="fields"> | |
57 | <div class="field"> |
|
58 | <div class="field"> | |
58 | <div class="label"> |
|
59 | <div class="label"> | |
59 | <label for="new_ip">${_('New IP Address')}:</label> |
|
60 | <label for="new_ip">${_('New IP Address')}:</label> | |
60 | </div> |
|
61 | </div> | |
61 | <div class="input"> |
|
62 | <div class="input"> | |
62 | ${h.text('new_ip')} ${h.text('description', placeholder=_('Description...'))} |
|
63 | ${h.text('new_ip')} ${h.text('description', placeholder=_('Description...'))} | |
63 | <span class="help-block">${_('Enter comma separated list of ip addresses like 127.0.0.1,\n' |
|
64 | <span class="help-block">${_('Enter comma separated list of ip addresses like 127.0.0.1,\n' | |
64 | 'or use a ip address with a mask 127.0.0.1/24, to create a network range.\n' |
|
65 | 'or use a ip address with a mask 127.0.0.1/24, to create a network range.\n' | |
65 | 'To specify multiple address range use 127.0.0.1-127.0.0.10 syntax')}</span> |
|
66 | 'To specify multiple address range use 127.0.0.1-127.0.0.10 syntax')}</span> | |
66 | </div> |
|
67 | </div> | |
67 | </div> |
|
68 | </div> | |
68 | <div class="buttons"> |
|
69 | <div class="buttons"> | |
69 | ${h.submit('save',_('Add'),class_="btn btn-small")} |
|
70 | ${h.submit('save',_('Add'),class_="btn btn-small")} | |
70 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} |
|
71 | ${h.reset('reset',_('Reset'),class_="btn btn-small")} | |
71 | </div> |
|
72 | </div> | |
72 | </div> |
|
73 | </div> | |
73 | </div> |
|
74 | </div> | |
74 | ${h.end_form()} |
|
75 | ${h.end_form()} | |
75 | </div> |
|
76 | </div> | |
76 | </div> |
|
77 | </div> | |
77 | </div> |
|
78 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now