<% if @group.users.any? %> <% @group.users.sort.each do |user| %> <% end %>
<%= l(:label_user) %>
<%= link_to_user user %> <%= link_to_remote( l(:button_delete), { :url => group_user_path(@group, :user_id => user), :method => :delete }, :class => 'icon icon-del' ) %>
<% else %>

<%= l(:label_no_data) %>

<% end %>
<% users = User.active.not_in_group(@group).all(:limit => 100) %> <% if users.any? %> <% remote_form_for(@group, :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 %>