]> source.dussan.org Git - redmine.git/commitdiff
Atom feeds:
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 16 Feb 2008 16:20:35 +0000 (16:20 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 16 Feb 2008 16:20:35 +0000 (16:20 +0000)
* prevent duplicate entry ids for issue changes
* prevent empty email in author element

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1154 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/journal.rb
app/views/common/feed.atom.rxml

index 013e2644d656498b3631cdb817fa385ecbe86f01..5aebbb7cefbf947ce21797c49ebedf5dace22095 100644 (file)
@@ -32,7 +32,7 @@ class Journal < ActiveRecord::Base
   acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') },
                 :description => :notes,
                 :author => :user,
-                :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id}}
+                :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}}
 
   def save
     # Do not save an empty journal
index 59b3163f4e589fdec76b717d2a123592e8e1e168..6695565f4bf57fee2f0aca9cc94880e90bd7cf85 100644 (file)
@@ -15,8 +15,8 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
       xml.updated item.event_datetime.xmlschema
       author = item.event_author if item.respond_to?(:author)
       xml.author do
-        xml.name(author.is_a?(User) ? author.name : author)
-        xml.email(author.mail) if author.is_a?(User)
+        xml.name(author)
+        xml.email(author.mail) if author.respond_to?(:mail) && !author.mail.blank?
       end if author
       xml.content "type" => "html" do
         xml.text! textilizable(item.event_description)