<%= _('Add members to %s') % profile.name %>

<% form_remote_tag :url => {:action => 'find_users', :profile => profile.identifier, :scope => 'all_users'}, :update => 'users-list', :loading => '$("users-list").addClassName("loading")', :complete => '$("users-list").removeClassName("loading")' do %> <%= text_field_tag('query', '', :autocomplete => 'off') %> <%= submit_tag(_('Search')) %> <% end %> <%= observe_field('query', :url => {:action => 'find_users', :profile => profile.identifier, :scope => 'all_users'}, :update => 'users-list', :frequency => 1, :with => 'query', :condition => '$("query").value.length > 2', :loading => '$("users-list").addClassName("loading")', :complete => '$("users-list").removeClassName("loading")') %> <%= observe_field('query', :frequency => 1, :condition => '$("query").value.length <= 2', :function => '$("users-list").update($("empty-query").innerHTML)') %>
<%= render :partial => 'find_users' %>
<%= render :partial => 'members_list' %>
<%= drop_receiving_element('members-list', :url => {:action => 'add_member', :profile => profile.identifier}, :before => '$("tr-" + element.id).hide()', :loading => '$("members-list").addClassName("loading")', :update => 'members-list', :success => '$("tr-" + element.id).hide(); $(element.id).show();', :complete => '$("members-list").removeClassName("loading")') %>