summaryrefslogtreecommitdiffstats
path: root/app/views/watchers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-03 09:14:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-08-03 09:14:43 +0000
commita332e0a4febeb36aac41f8d5762d18f4cbbf115c (patch)
tree8e0883bbdbfd7bfca332880da6f1739362b8c579 /app/views/watchers
parent6034067d8623e87ef1391962b882fcc93196bf4b (diff)
downloadredmine-a332e0a4febeb36aac41f8d5762d18f4cbbf115c.tar.gz
redmine-a332e0a4febeb36aac41f8d5762d18f4cbbf115c.zip
Adds permissions for viewing the watcher list and adding new watchers on the issue detail view (#398).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1712 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/watchers')
-rw-r--r--app/views/watchers/_watchers.rhtml25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/views/watchers/_watchers.rhtml b/app/views/watchers/_watchers.rhtml
new file mode 100644
index 000000000..14bb5fc6b
--- /dev/null
+++ b/app/views/watchers/_watchers.rhtml
@@ -0,0 +1,25 @@
+<div class="contextual">
+<%= link_to_remote l(:button_add),
+ :url => {:controller => 'watchers',
+ :action => 'new',
+ :object_type => watched.class.name.underscore,
+ :object_id => watched} if User.current.allowed_to?(:add_issue_watchers, @project) %>
+</div>
+
+<p><strong><%= l(:label_issue_watchers) %></strong></p>
+<%= watchers_list(watched) %>
+
+<% unless @watcher.nil? %>
+<% 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'}) do |f| %>
+<p><%= f.select :user_id, (watched.addable_watcher_users.collect {|m| [m.name, m.id]}), :prompt => true %>
+
+<%= submit_tag l(:button_add) %>
+<%= toggle_link l(:button_cancel), 'new-watcher-form'%></p>
+<% end %>
+<% end %>