diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-24 13:51:28 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-24 13:51:28 +0000 |
commit | ee8002b0c9342ccd8db85a2eaa9aa38683cdf0e8 (patch) | |
tree | 82abb9a478877f9a2d8a8dde49c87fbe570e5484 /app/models/changeset.rb | |
parent | f071b39d268a52aca556782aadadef7856158d31 (diff) | |
download | redmine-ee8002b0c9342ccd8db85a2eaa9aa38683cdf0e8.tar.gz redmine-ee8002b0c9342ccd8db85a2eaa9aa38683cdf0e8.zip |
Adds the repository identifier in the activity and search results (#779).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9257 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/changeset.rb')
-rw-r--r-- | app/models/changeset.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/changeset.rb b/app/models/changeset.rb index 645745206..ea3d61d87 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -31,7 +31,7 @@ class Changeset < ActiveRecord::Base :join_table => "#{table_name_prefix}changeset_parents#{table_name_suffix}", :association_foreign_key => 'changeset_id', :foreign_key => 'parent_id' - acts_as_event :title => Proc.new {|o| "#{l(:label_revision)} #{o.format_identifier}" + (o.short_comments.blank? ? '' : (': ' + o.short_comments))}, + acts_as_event :title => Proc.new {|o| o.title}, :description => :long_comments, :datetime => :committed_on, :url => Proc.new {|o| {:controller => 'repositories', :action => 'revision', :id => o.repository.project, :repository_id => o.repository.identifier_param, :rev => o.identifier}} @@ -166,6 +166,13 @@ class Changeset < ActiveRecord::Base tag end + # Returns the title used for the changeset in the activity/search results + def title + repo = (repository && repository.identifier.present?) ? " (#{repository.identifier})" : '' + comm = short_comments.blank? ? '' : (': ' + short_comments) + "#{l(:label_revision)} #{format_identifier}#{repo}#{comm}" + end + # Returns the previous changeset def previous @previous ||= Changeset.find(:first, |