<% if @group.users.any? %> <% @group.users.sort.each do |user| %> <% end %>
<%= User.model_name.human %>
<%= link_to_user user %> <%= link_to l(:button_delete), member_of_group_path(@group, user), :method => :delete, :remote => :true, :class => 'icon icon-del' %>
<% else %>

<%= l(:label_no_data) %>

<% end %>
<% users = User.active.not_in_group(@group).all(:limit => 100) %> <% if users.any? %> <%= form_tag(members_of_group_path(@group), :method => :post, :remote => true) 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 => { :controller => '/groups', :action => 'autocomplete_for_user', :id => @group }, :with => 'q', :method => :get) %>
<%= principals_check_box_tags 'user_ids[]', users %>

<%= submit_tag l(:button_add) %>

<% end %> <% end %>