##// END OF EJS Templates
i18n: Updated message catalog template
i18n: Updated message catalog template

File last commit:

r4232:60646747 stable
r4672:a2af12c1 stable
Show More
user_edit_ips.mako
83 lines | 3.3 KiB | application/x-mako | MakoHtmlLexer
<%namespace name="base" file="/base/base.mako"/>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
${base.gravatar_with_user(c.user.username, 16, tooltip=False, _class='pull-left')}
&nbsp;- ${_('Custom IP Whitelist')}
</h3>
</div>
<div class="panel-body">
<div class="ips_wrap">
<h5>${_('Current IP address')}: <code>${c.rhodecode_user.ip_addr}</code></h5>
<table class="rctable ip-whitelist">
<tr>
<th>${_('IP Address')}</th>
<th>${_('IP Range')}</th>
<th>${_('Description')}</th>
<th></th>
</tr>
%if c.default_user_ip_map and c.inherit_default_ips:
%for ip in c.default_user_ip_map:
<tr>
<td class="td-ip"><div class="ip">${ip.ip_addr}</div></td>
<td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
<td class="td-description">${h.literal(_('Inherited from %s') % h.link_to('*default*',h.route_path('admin_permissions_ips')))}</td>
<td></td>
</tr>
%endfor
%endif
%if c.user_ip_map:
%for ip in c.user_ip_map:
<tr>
<td class="td-ip"><div class="ip">${ip.ip_addr}</div></td>
<td class="td-iprange"><div class="ip">${h.ip_range(ip.ip_addr)}</div></td>
<td class="td-description"><div class="ip">${ip.description}</div></td>
<td class="td-action">
${h.secure_form(h.route_path('edit_user_ips_delete', user_id=c.user.user_id), request=request)}
${h.hidden('del_ip_id', ip.ip_id)}
${h.submit('remove_', _('Delete'),id="remove_ip_%s" % ip.ip_id,
class_="btn btn-link btn-danger", onclick="return confirm('"+_('Confirm to delete this ip: %s') % ip.ip_addr+"');")}
${h.end_form()}
</td>
</tr>
%endfor
%endif
%if not c.default_user_ip_map and not c.user_ip_map:
<tr>
<td><h2 class="ip">${_('All IP addresses are allowed')}</h2></td>
<td></td>
<td></td>
<td></td>
</tr>
%endif
</table>
</div>
<div>
${h.secure_form(h.route_path('edit_user_ips_add', user_id=c.user.user_id), request=request)}
<div class="form">
<!-- fields -->
<div class="fields">
<div class="field">
<div class="label">
<label for="new_ip">${_('New IP Address')}:</label>
</div>
<div class="input">
${h.text('new_ip')} ${h.text('description', placeholder=_('Description...'))}
<span class="help-block pre-formatting">${_('Enter comma separated list of ip addresses like 10.0.0.1,10.0.0.2.\n'
'Use a ip address with a mask 127.0.0.1/24, to create a network match pattern.\n'
'To specify multiple entries on an address range use 127.0.0.1-127.0.0.10 syntax')}</span>
</div>
</div>
<div class="buttons">
${h.submit('save',_('Add'),class_="btn btn-small")}
${h.reset('reset',_('Reset'),class_="btn btn-small")}
</div>
</div>
</div>
${h.end_form()}
</div>
</div>
</div>