From 4ded4277c51b8f35dc9eaa031c918e55470a44b5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 28 Oct 2007 16:13:39 +0000 Subject: [PATCH] Activity view now uses events attributes. Fixed: error on activity feed if it contains a document. git-svn-id: http://redmine.rubyforge.org/svn/trunk@876 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/attachment.rb | 2 +- app/views/common/feed.atom.rxml | 2 +- app/views/projects/activity.rhtml | 37 ++++--------------------------- 3 files changed, 6 insertions(+), 35 deletions(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 4591a110..d2bcab33 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -27,7 +27,7 @@ class Attachment < ActiveRecord::Base acts_as_event :title => :filename, :description => :filename, - :url => Proc.new {|o| {:controller => 'attachment', :action => 'download', :id => o.id}} + :url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id}} cattr_accessor :storage_path @@storage_path = "#{RAILS_ROOT}/files" diff --git a/app/views/common/feed.atom.rxml b/app/views/common/feed.atom.rxml index b5f73346..59b3163f 100644 --- a/app/views/common/feed.atom.rxml +++ b/app/views/common/feed.atom.rxml @@ -13,7 +13,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.link "rel" => "alternate", "href" => url_for(item.event_url(:only_path => false)) xml.id url_for(item.event_url(:only_path => false)) xml.updated item.event_datetime.xmlschema - author = item.event_author + 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) diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml index 604b9f72..a2f5296f 100644 --- a/app/views/projects/activity.rhtml +++ b/app/views/projects/activity.rhtml @@ -4,43 +4,14 @@

<%= day_name(day.cwday) %> <%= day.day %>

<% end %> -<% if @events_by_day.empty? %> -

<%= l(:label_no_data) %>

-<% end %> +<% if @events_by_day.empty? %>

<%= l(:label_no_data) %>

<% end %>
<% prev_params = params.clone.update :year => (@month==1 ? @year-1 : @year), :month =>(@month==1 ? 12 : @month-1) %>