From beeab518e80779b667b0cd09e1b0d1f5d03c5222 Mon Sep 17 00:00:00 2001 From: nwb Date: Fri, 27 Jun 2014 11:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81=E4=B8=AD?= =?UTF-8?q?=E7=95=99=E8=A8=80=E9=93=BE=E6=8E=A5BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 10 +++++++--- app/views/courses/show.html.erb | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 512a6d8bf..58880919e 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -33,9 +33,13 @@ class JournalsForMessage < ActiveRecord::Base :description => Proc.new{|o| o.notes }, :type => Proc.new {|o| o.jour_type }, :url => Proc.new {|o| - (o.jour.kind_of? Project) ? {:controller => 'projects', :action => 'feedback', :id => o.jour, :r => o.id, :anchor => "word_li_#{o.id}"} : {} - }#{:controller => 'documents', :action => 'show', :id => o.id}} - acts_as_activity_provider :author_key => :user_id, + if o.jour.kind_of? Project + {:controller => 'projects', :action => 'feedback', :id => o.jour, :r => o.id, :anchor => "word_li_#{o.id}"} + elsif o.jour.kind_of? Course + {:controller => 'courses', :action => 'feedback', :id => o.jour, :r => o.id, :anchor => "word_li_#{o.id}"} + end + } + acts_as_activity_provider :author_key => :user_id, :timestamp => "#{self.table_name}.updated_on", :find_options => {:include => :project } diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index a40ace38d..5a440aff3 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -26,6 +26,7 @@ <%= l(:label_new_activity) %> + <%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url %>