<%= link_to_function(l(:button_add), "$('new-watcher-form').toggle();") if User.current.allowed_to?(:add_issue_watchers, @project) %>

<%= l(:label_issue_watchers) %> (<%= watched.watcher_users.size %>)

<% if User.current.allowed_to?(:add_issue_watchers, @project) %> <% remote_form_for(:watcher, @watcher, :url => {:controller => 'watchers', :action => 'new', :object_type => watched.class.name.underscore, :object_id => watched}, :method => :post, :html => {:id => 'new-watcher-form', :style => 'display:none;'}) do |f| %> <% users = User.active.find(:all, :limit => 10) %>

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

<%= observe_field(:user_search, :frequency => 0.5, :update => :users, :url => auto_complete_users_path, :with => 'q') %>
<%= principals_check_box_tags 'user_ids[]', users %>

<%= submit_tag l(:button_add) %> <%= toggle_link l(:button_cancel), 'new-watcher-form'%>

<% end %> <% end %> <%= watchers_list(watched) %>