Feature #37973 » enable_to_display_watches_count_on_issues_list.patch
| app/models/issue.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def watches
|
||
|
@watches ||= self.watchers.count(:id)
|
||
|
end
|
||
|
# Preloads relations for a collection of issues
|
||
|
def self.load_relations(issues)
|
||
|
if issues.any?
|
||
| app/models/issue_query.rb | ||
|---|---|---|
|
QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name", :groupable => true),
|
||
|
QueryColumn.new(:fixed_version, :sortable => lambda {Version.fields_for_order_statement},
|
||
|
:groupable => true),
|
||
|
QueryColumn.new(
|
||
|
:watches,
|
||
|
:sortable =>
|
||
|
lambda do
|
||
|
"COALESCE((SELECT COUNT(user_id) FROM #{Watcher.table_name}" \
|
||
|
" WHERE #{Watcher.table_name}.watchable_id = #{Issue.table_name}.id), 0)"
|
||
|
end,
|
||
|
:default_order => 'desc'),
|
||
|
QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date", :groupable => true),
|
||
|
QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date", :groupable => true),
|
||
|
QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours",
|
||
| app/views/watchers/_set_watcher.js.erb | ||
|---|---|---|
|
<% selector = ".#{watcher_css(watched)}" %>
|
||
|
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
|
||
|
$('#watchers').html('<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => watched.first})) %>');
|
||
|
var back_url = $('input[name="back_url"]').val() || '';
|
||
|
if (back_url.length > 0) {
|
||
|
window.location.href = back_url;
|
||
|
} else {
|
||
|
<% selector = ".#{watcher_css(watched)}" %>
|
||
|
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
|
||
|
$('#watchers').html('<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => watched.first})) %>');
|
||
|
}
|
||
| app/views/watchers/create.js.erb | ||
|---|---|---|
|
render(:partial => 'watchers/new',
|
||
|
:locals => {:watchables => @watchables, :users => @users})) %>');
|
||
|
<% if @watchables.size == 1 %>
|
||
|
<%= render(:partial => 'watchers/set_watcher',
|
||
|
:locals => {:watched => @watchables, :user => User.current}) %>
|
||
|
<% end %>
|
||
|
<%= render(:partial => 'watchers/set_watcher',
|
||
|
:locals => {:watched => @watchables, :user => User.current}) %>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
field_parent_title: Parent page
|
||
|
field_editable: Editable
|
||
|
field_watcher: Watcher
|
||
|
field_watches: Watches
|
||
|
field_content: Content
|
||
|
field_group_by: Group results by
|
||
|
field_sharing: Sharing
|
||
| config/locales/ja.yml | ||
|---|---|---|
|
field_parent_title: 親ページ
|
||
|
field_editable: 編集可能
|
||
|
field_watcher: ウォッチャー
|
||
|
field_watches: ウォッチ数
|
||
|
field_content: 内容
|
||
|
field_group_by: グループ条件
|
||
|
field_sharing: 共有
|
||