diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 5a103e015..b9192f47b 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -73,13 +73,13 @@ module WelcomeHelper rescue Exception => e logger.error "[WelcomeHelper] ===> #{e}" end - "项目得分:".html_safe << grade.to_s + "项目评分:".html_safe << grade.to_s end def show_user_content event str = ''.html_safe case event.event_type - when ('news' || 'issue' || 'attachment' || 'message' || 'bid' || 'wiki-page' || 'document') + when 'news' , 'issue' , 'attachment' , 'message' , 'bid' , 'wiki-page' , 'document' str << " ".html_safe << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) when 'reply' str << " ".html_safe << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_description, length: 30, omission:'...'), event.event_url) @@ -89,6 +89,18 @@ module WelcomeHelper str end + def show_event_reply event + str = "回复(" + case event.event_type + when "issue" + str << link_to(cal_issues_count(event), issue_path(event)) << ")" + when "Memo" + str << link_to(cal_memos_count(event), forum_memo_path(event.forum_id,event.id)) << ")" + else + str = "" + end + str.html_safe + end private @@ -141,7 +153,7 @@ module WelcomeHelper end #取得论坛数据 - def find_hot_forum_topics limit=10 + def find_hot_forum_topics limit=9 #Memo.order('replies_count DESC').where('replies_count <> 0').limit(limit) Memo.order('replies_count DESC, created_at DESC').where('parent_id IS NULL').limit(limit) ## 以下语句会内链接自身查询出最后一条回复时间,没有回复的帖子不会显示 @@ -180,6 +192,10 @@ module WelcomeHelper '回复' when 'bid' '作业' + when 'Memo' + '主题' + when 'document' + '文件' else event.event_type end diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index db1db2955..2bba8e495 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -94,30 +94,30 @@ } } - $(function(){ - var x = 10; - var y = 20; - $("span.tooltip").mouseover(function(e){ - this.myTitle = this.title; - this.title = ""; - var tooltip = "