Move issue watchers to the sidebar.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3579 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
8cc519e763
commit
e605973ec4
|
@ -48,8 +48,8 @@ module WatchersHelper
|
||||||
# Returns a comma separated list of users watching the given object
|
# Returns a comma separated list of users watching the given object
|
||||||
def watchers_list(object)
|
def watchers_list(object)
|
||||||
remove_allowed = User.current.allowed_to?("delete_#{object.class.name.underscore}_watchers".to_sym, object.project)
|
remove_allowed = User.current.allowed_to?("delete_#{object.class.name.underscore}_watchers".to_sym, object.project)
|
||||||
object.watcher_users.collect do |user|
|
lis = object.watcher_users.collect do |user|
|
||||||
s = content_tag('span', link_to_user(user), :class => 'user')
|
s = avatar(user, :size => "16").to_s + link_to_user(user, :class => 'user').to_s
|
||||||
if remove_allowed
|
if remove_allowed
|
||||||
url = {:controller => 'watchers',
|
url = {:controller => 'watchers',
|
||||||
:action => 'destroy',
|
:action => 'destroy',
|
||||||
|
@ -59,9 +59,11 @@ module WatchersHelper
|
||||||
s += ' ' + link_to_remote(image_tag('delete.png'),
|
s += ' ' + link_to_remote(image_tag('delete.png'),
|
||||||
{:url => url},
|
{:url => url},
|
||||||
:href => url_for(url),
|
:href => url_for(url),
|
||||||
:style => "vertical-align: middle")
|
:style => "vertical-align: middle",
|
||||||
|
:class => "delete")
|
||||||
end
|
end
|
||||||
s
|
"<li>#{ s }</li>"
|
||||||
end.join(",\n")
|
end
|
||||||
|
lis.empty? ? "" : "<ul>#{ lis.join("\n") }</ul>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -77,14 +77,6 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if User.current.allowed_to?(:add_issue_watchers, @project) ||
|
|
||||||
(@issue.watchers.any? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
|
|
||||||
<hr />
|
|
||||||
<div id="watchers">
|
|
||||||
<%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @changesets.any? %>
|
<% if @changesets.any? %>
|
||||||
|
@ -121,7 +113,14 @@
|
||||||
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
|
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
|
||||||
|
|
||||||
<% content_for :sidebar do %>
|
<% content_for :sidebar do %>
|
||||||
<%= render :partial => 'issues/sidebar' %>
|
<%= render :partial => 'issues/sidebar' %>
|
||||||
|
|
||||||
|
<% if User.current.allowed_to?(:add_issue_watchers, @project) ||
|
||||||
|
(@issue.watchers.any? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
|
||||||
|
<div id="watchers">
|
||||||
|
<%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
|
|
|
@ -6,20 +6,21 @@
|
||||||
:object_id => watched} if User.current.allowed_to?(:add_issue_watchers, @project) %>
|
:object_id => watched} if User.current.allowed_to?(:add_issue_watchers, @project) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><strong><%= l(:label_issue_watchers) %></strong></p>
|
<h3><%= l(:label_issue_watchers) %> (<%= watched.watcher_users.size %>)</h3>
|
||||||
<%= watchers_list(watched) %>
|
|
||||||
|
|
||||||
<% unless @watcher.nil? %>
|
<% unless @watcher.nil? %>
|
||||||
<% remote_form_for(:watcher, @watcher,
|
<% remote_form_for(:watcher, @watcher,
|
||||||
:url => {:controller => 'watchers',
|
:url => {:controller => 'watchers',
|
||||||
:action => 'new',
|
:action => 'new',
|
||||||
:object_type => watched.class.name.underscore,
|
:object_type => watched.class.name.underscore,
|
||||||
:object_id => watched},
|
:object_id => watched},
|
||||||
:method => :post,
|
:method => :post,
|
||||||
:html => {:id => 'new-watcher-form'}) do |f| %>
|
:html => {:id => 'new-watcher-form'}) do |f| %>
|
||||||
<p><%= f.select :user_id, (watched.addable_watcher_users.collect {|m| [m.name, m.id]}), :prompt => "--- #{l(:actionview_instancetag_blank_option)} ---" %>
|
<p><%= f.select :user_id, (watched.addable_watcher_users.collect {|m| [m.name, m.id]}), :prompt => "--- #{l(:actionview_instancetag_blank_option)} ---" %>
|
||||||
|
|
||||||
<%= submit_tag l(:button_add) %>
|
<%= submit_tag l(:button_add) %>
|
||||||
<%= toggle_link l(:button_cancel), 'new-watcher-form'%></p>
|
<%= toggle_link l(:button_cancel), 'new-watcher-form'%></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<%= watchers_list(watched) %>
|
||||||
|
|
|
@ -195,6 +195,13 @@ div.members h3 { background: url(../images/group.png) no-repeat 0% 50%; padding-
|
||||||
div.news h3 { background: url(../images/news.png) no-repeat 0% 50%; padding-left: 20px; }
|
div.news h3 { background: url(../images/news.png) no-repeat 0% 50%; padding-left: 20px; }
|
||||||
div.projects h3 { background: url(../images/projects.png) no-repeat 0% 50%; padding-left: 20px; }
|
div.projects h3 { background: url(../images/projects.png) no-repeat 0% 50%; padding-left: 20px; }
|
||||||
|
|
||||||
|
#watchers ul {margin: 0; padding: 0;}
|
||||||
|
#watchers li {list-style-type:none;margin: 0px 2px 0px 0px; padding: 0px 0px 0px 0px;}
|
||||||
|
#watchers select {width: 95%; display: block;}
|
||||||
|
#watchers a.delete {opacity: 0.4;}
|
||||||
|
#watchers a.delete:hover {opacity: 1;}
|
||||||
|
#watchers img.gravatar {vertical-align: middle;margin-right: 4px;}
|
||||||
|
|
||||||
.highlight { background-color: #FCFD8D;}
|
.highlight { background-color: #FCFD8D;}
|
||||||
.highlight.token-1 { background-color: #faa;}
|
.highlight.token-1 { background-color: #faa;}
|
||||||
.highlight.token-2 { background-color: #afa;}
|
.highlight.token-2 { background-color: #afa;}
|
||||||
|
|
Loading…
Reference in New Issue