<% if @group.users.any? %> <% @group.users.sort.each do |user| %> <% end %>
<%= l(:label_user) %>
<%= link_to_user user %> <%= delete_link group_user_path(@group, :user_id => user), :remote => true %>
<% else %>

<%= l(:label_no_data) %>

<% end %>
<% users = User.active.not_in_group(@group).all(:limit => 100) %> <% if users.any? %> <%= form_for(@group, :remote => true, :url => group_users_path(@group), :html => {:method => :post}) do |f| %>
<%=l(:label_user_new)%>

<%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %>

<%= observe_field(:user_search, :frequency => 0.5, :update => :users, :url => autocomplete_for_user_group_path(@group), :method => :get, :before => '$("user_search").addClassName("ajax-loading")', :complete => '$("user_search").removeClassName("ajax-loading")', :with => 'q') %>
<%= principals_check_box_tags 'user_ids[]', users %>

<%= submit_tag l(:button_add) %>

<% end %> <% end %>