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