summaryrefslogtreecommitdiffstats
path: root/app/views/watchers/_watchers.html.erb
blob: 25d852c876771497cc4cd00fc561dff18aa74b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<% watched_klass_name = watched.class.name.underscore -%>
<% if User.current.allowed_to?(:"add_#{watched_klass_name}_watchers", watched.project) %>
<div class="contextual">
<%= link_to l(:button_add),
      new_watchers_path(:object_type => watched_klass_name, :object_id => watched),
      :remote => true,
      :method => 'get' %>
</div>
<% end %>

<% if User.current.allowed_to?(:"view_#{watched_klass_name}_watchers", watched.project) %>
<h3><%= l(:"label_#{watched_klass_name}_watchers") %> (<%= watched.watcher_users.size %>)</h3>

<%= watchers_list(watched) %>
<% else %>
<h3><%= l(:"label_#{watched_klass_name}_watchers") %></h3>
<% end %>