Mercurial > hg > soundsoftware-site
diff app/views/users/new.html.erb @ 1464:261b3d9a4903 redmine-2.4
Update to Redmine 2.4 branch rev 12663
author | Chris Cannam |
---|---|
date | Tue, 14 Jan 2014 14:37:42 +0000 |
parents | 433d4f72a19b |
children |
line wrap: on
line diff
--- a/app/views/users/new.html.erb Fri Jun 14 09:05:06 2013 +0100 +++ b/app/views/users/new.html.erb Tue Jan 14 14:37:42 2014 +0000 @@ -1,4 +1,4 @@ -<h2><%= link_to l(:label_user_plural), users_path %> » <%=l(:label_user_new)%></h2> +<%= title [l(:label_user_plural), users_path], l(:label_user_new) %> <%= labelled_form_for @user do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> @@ -10,3 +10,21 @@ <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> </p> <% end %> + +<% 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 %>