2008-08-03 13:14:43 +04:00
|
|
|
<div class="contextual">
|
2010-12-04 01:43:03 +03:00
|
|
|
<%= link_to_function(l(:button_add), "$('new-watcher-form').toggle();") if User.current.allowed_to?(:add_issue_watchers, @project) %>
|
2008-08-03 13:14:43 +04:00
|
|
|
</div>
|
|
|
|
|
2010-03-13 20:45:41 +03:00
|
|
|
<h3><%= l(:label_issue_watchers) %> (<%= watched.watcher_users.size %>)</h3>
|
2008-08-03 13:14:43 +04:00
|
|
|
|
2010-12-04 01:43:03 +03:00
|
|
|
<% if User.current.allowed_to?(:add_issue_watchers, @project) %>
|
|
|
|
<% remote_form_for(:watcher, @watcher,
|
2010-03-13 20:45:41 +03:00
|
|
|
:url => {:controller => 'watchers',
|
|
|
|
:action => 'new',
|
|
|
|
:object_type => watched.class.name.underscore,
|
|
|
|
:object_id => watched},
|
|
|
|
:method => :post,
|
2010-12-04 01:43:03 +03:00
|
|
|
:html => {:id => 'new-watcher-form', :style => 'display:none;'}) do |f| %>
|
2010-12-04 01:56:29 +03:00
|
|
|
<% users = User.active.find(:all, :limit => 25) - watched.watcher_users %>
|
2010-12-04 01:43:03 +03:00
|
|
|
<p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil, :style => "width:98%;" %></p>
|
|
|
|
<%= observe_field(:user_search,
|
|
|
|
:frequency => 0.5,
|
|
|
|
:update => :users,
|
2010-12-04 01:56:29 +03:00
|
|
|
:url => auto_complete_users_path(:remove_watchers => watched.id, :klass => watched.class),
|
2010-12-04 01:43:03 +03:00
|
|
|
:with => 'q')
|
|
|
|
%>
|
|
|
|
|
|
|
|
<div id="users">
|
|
|
|
<%= principals_check_box_tags 'user_ids[]', users %>
|
|
|
|
</div>
|
2008-08-03 13:14:43 +04:00
|
|
|
|
2010-12-04 01:43:03 +03:00
|
|
|
<p><%= submit_tag l(:button_add) %>
|
2010-03-13 20:45:41 +03:00
|
|
|
<%= toggle_link l(:button_cancel), 'new-watcher-form'%></p>
|
|
|
|
<% end %>
|
2008-08-03 13:14:43 +04:00
|
|
|
<% end %>
|
2010-03-13 20:45:41 +03:00
|
|
|
|
|
|
|
<%= watchers_list(watched) %>
|