diff --git a/app/helpers/activities_helper.rb b/app/helpers/activities_helper.rb index cf8679da6..c8cb20ba9 100644 --- a/app/helpers/activities_helper.rb +++ b/app/helpers/activities_helper.rb @@ -44,6 +44,9 @@ module ActivitiesHelper end def get_container_type(activity) + if activity.act.nil? + return ['Unknow',0] + end #问卷 if activity.act_type == 'Poll' return ['Course',activity.act.polls_group_id] @@ -54,7 +57,7 @@ module ActivitiesHelper end #留言 if activity.act_type == 'JournalsForMessage' - return [activity.act.jour_type,activity.act.jour_id] + return [activity.act.jour_type,activity.act.jour_id,activity.act.user_id] end # HomeworkCommon Issue Journal Message News diff --git a/app/helpers/api_helper.rb b/app/helpers/api_helper.rb index fa231607a..1f34112ad 100644 --- a/app/helpers/api_helper.rb +++ b/app/helpers/api_helper.rb @@ -66,7 +66,7 @@ module ApiHelper (user.language.nil? || user.language == "") ? 'zh':user.language end - # 获取课程作业的状态 + # 学生获取课程作业的状态 def get_homework_status homework homework_status = "" if !homework.nil? @@ -75,9 +75,9 @@ module ApiHelper when 1 homework_status = show_homework_deadline homework when 2 - homework_status = "正在匿评中" + homework_status = "正在匿评" when 3 - homework_status = "匿评已结束" + homework_status = "匿评结束" end elsif homework.homework_type == 0 homework_status = "未启用匿评" diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index db041c0ba..d4f9e4eb8 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -434,6 +434,8 @@ module UsersHelper def get_activity_act_showname_htmlclear(activity) str = get_activity_act_showname(activity) str = str.gsub(/<.*>/,'') + str = str.gsub(/\r/,'') + str = str.gsub(/\n/,'') str = str.lstrip.rstrip if str == '' str = 'RE:' @@ -449,7 +451,9 @@ module UsersHelper when "Journal" arr = details_to_strings(activity.act.details,true) arr << activity.act.notes - return arr.to_s + str = '' + arr.each { |item| str = str+item } + return str when "JournalsForMessage" return activity.act.notes when "Message" diff --git a/app/models/activity.rb b/app/models/activity.rb index 679cb9599..63081be6f 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -14,8 +14,11 @@ class Activity < ActiveRecord::Base #helper :activities include ActivitiesHelper def set_container_type_val - container_type,container_id =get_container_type(self) - self.activity_container_type = container_type - self.activity_container_id = container_id + params =get_container_type(self) + self.activity_container_type = params[0] + self.activity_container_id = params[1] + if(self.act_type == 'JournalsForMessage') + self.user_id = params[2] + end end end diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 257bcc1a6..c23266afd 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -77,11 +77,11 @@