2011-11-23 01:43:11 +04:00
|
|
|
<h2><%= link_to l(:label_user_plural), users_path %> » <%=l(:label_user_new)%></h2>
|
2006-06-28 22:11:03 +04:00
|
|
|
|
2012-04-25 21:17:49 +04:00
|
|
|
<%= labelled_form_for @user do |f| %>
|
2011-09-18 03:09:15 +04:00
|
|
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
|
|
<% if email_delivery_enabled? %>
|
|
|
|
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
|
|
|
|
<% end %>
|
|
|
|
<p>
|
|
|
|
<%= submit_tag l(:button_create) %>
|
|
|
|
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
|
|
|
</p>
|
2007-05-27 14:57:13 +04:00
|
|
|
<% end %>
|
2012-12-26 15:23:53 +04:00
|
|
|
|
|
|
|
<% if @auth_sources.present? && @auth_sources.any?(&:searchable?) %>
|
|
|
|
<%= javascript_tag do %>
|
|
|
|
observeAutocompleteField('user_login', '<%= escape_javascript autocomplete_for_new_user_auth_sources_path %>', {
|
|
|
|
select: function(event, ui) {
|
|
|
|
$('input#user_firstname').val(ui.item.firstname);
|
|
|
|
$('input#user_lastname').val(ui.item.lastname);
|
|
|
|
$('input#user_mail').val(ui.item.mail);
|
|
|
|
$('select#user_auth_source_id option').each(function(){
|
|
|
|
if ($(this).attr('value') == ui.item.auth_source_id) {
|
|
|
|
$(this).attr('selected', true);
|
|
|
|
$('select#user_auth_source_id').trigger('change');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|