##// END OF EJS Templates
fix(caching): fixed problems with Cache query for users....
fix(caching): fixed problems with Cache query for users. The old way of querying caused the user get query to be always cached, and returning old results even in 2fa forms. The new limited query doesn't cache the user object resolving issues

File last commit:

r5210:a4612633 default
r5365:ae8a165b default
Show More
user_add.mako
148 lines | 5.2 KiB | application/x-mako | MakoHtmlLexer
templating: use .mako as extensions for template files.
r1282 <%inherit file="/base/base.mako"/>
<%def name="title()">
${_('Add user')}
%if c.rhodecode_name:
&middot; ${h.branding(c.rhodecode_name)}
%endif
</%def>
<%def name="breadcrumbs_links()">
audit-logs: introduced new view to replace admin journal....
r1758 ${h.link_to(_('Admin'),h.route_path('admin_home'))}
templating: use .mako as extensions for template files.
r1282 &raquo;
admin-users: moved grid browsing to pyramid....
r1520 ${h.link_to(_('Users'),h.route_path('users'))}
templating: use .mako as extensions for template files.
r1282 &raquo;
${_('Add User')}
</%def>
<%def name="menu_bar_nav()">
${self.menu_items(active='admin')}
</%def>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
<!-- end box / title -->
users: ported controllers from pylons into pyramid views.
r2114 ${h.secure_form(h.route_path('users_create'), request=request)}
templating: use .mako as extensions for template files.
r1282 <div class="form">
<!-- fields -->
<div class="fields">
<div class="field">
<div class="label">
<label for="username">${_('Username')}:</label>
</div>
<div class="input">
${h.text('username', class_='medium')}
</div>
</div>
<div class="field">
<div class="label">
<label for="password">${_('Password')}:</label>
</div>
<div class="input">
${h.password('password', class_='medium')}
fix(users): fixed password mismatch error message beeing wrongly displayed when creating new users
r5210 ## install this hidden field so password mismatch will correctly attach error message here
${h.hidden('new_password')}
templating: use .mako as extensions for template files.
r1282 </div>
</div>
<div class="field">
<div class="label">
<label for="password_confirmation">${_('Password confirmation')}:</label>
</div>
<div class="input">
${h.password('password_confirmation',autocomplete="off", class_='medium')}
<div class="info-block">
<a id="generate_password" href="#">
<i class="icon-lock"></i> ${_('Generate password')}
</a>
<span id="generate_password_preview"></span>
</div>
</div>
</div>
<div class="field">
<div class="label">
<label for="firstname">${_('First Name')}:</label>
</div>
<div class="input">
${h.text('firstname', class_='medium')}
</div>
</div>
<div class="field">
<div class="label">
<label for="lastname">${_('Last Name')}:</label>
</div>
<div class="input">
${h.text('lastname', class_='medium')}
</div>
</div>
<div class="field">
<div class="label">
<label for="email">${_('Email')}:</label>
</div>
<div class="input">
${h.text('email', class_='medium')}
${h.hidden('extern_name', c.default_extern_type)}
${h.hidden('extern_type', c.default_extern_type)}
</div>
</div>
<div class="field">
<div class="label label-checkbox">
<label for="active">${_('Active')}:</label>
</div>
<div class="checkboxes">
${h.checkbox('active',value=True,checked='checked')}
</div>
</div>
<div class="field">
<div class="label label-checkbox">
<label for="password_change">${_('Password change')}:</label>
</div>
<div class="checkboxes">
${h.checkbox('password_change',value=True)}
<span class="help-block">${_('Force user to change his password on the next login')}</span>
</div>
</div>
<div class="field">
<div class="label label-checkbox">
<label for="create_repo_group">${_('Add personal repository group')}:</label>
</div>
<div class="checkboxes">
${h.checkbox('create_repo_group',value=True, checked=c.default_create_repo_group)}
<span class="help-block">
users: do not require description on admin user creation
r4056 ${_('New group will be created at: `/{path}`').format(path=c.personal_repo_group_name)}<br/>
templating: use .mako as extensions for template files.
r1282 ${_('User will be automatically set as this group owner.')}
</span>
</div>
</div>
<div class="buttons">
dan
templates: use explicit named actions like "create user" instead of generic "save" which is bad UX.
r4118 ${h.submit('save',_('Create User'),class_="btn")}
templating: use .mako as extensions for template files.
r1282 </div>
</div>
</div>
${h.end_form()}
</div>
<script>
$(document).ready(function(){
$('#username').focus();
$('#generate_password').on('click', function(e){
html: fixed found syntax problems
r1283 var tmpl = "(${_('generated password:')} {0})";
var new_passwd = generatePassword(12);
$('#generate_password_preview').html(tmpl.format(new_passwd));
templating: use .mako as extensions for template files.
r1282 $('#password').val(new_passwd);
$('#password_confirmation').val(new_passwd);
})
})
</script>
</%def>