2008-08-03 13:14:43 +04:00
|
|
|
<div class="contextual">
|
2010-12-14 20:11:48 +03:00
|
|
|
<%= link_to_function(l(:button_add), "$('new-watcher-form').toggle();") if User.current.allowed_to?("add_#{watched.class.name.underscore}_watchers".to_sym, @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-14 20:11:48 +03:00
|
|
|
<% if User.current.allowed_to?("add_#{watched.class.name.underscore}_watchers".to_sym, @project) %>
|
2012-01-18 22:26:03 +04:00
|
|
|
<% 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| %>
|
2011-04-19 23:03:55 +04:00
|
|
|
<% users = Principal.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,
|
2011-04-19 23:03:55 +04:00
|
|
|
:url => auto_complete_users_path(:remove_watchers => watched.id, :klass => watched.class, :include_groups => true),
|
2010-12-04 01:43:03 +03:00
|
|
|
:with => 'q')
|
|
|
|
%>
|
2012-01-18 22:26:03 +04:00
|
|
|
|
2010-12-04 01:43:03 +03:00
|
|
|
<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) %>
|