diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index b62ddb69a..d95fc2623 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -61,7 +61,7 @@ module WelcomeHelper rescue Exception => e logger.error "[WelcomeHelper] ===> #{e}" end - grade + "    ".html_safe << grade.to_s end def show_user_content event diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 2cf87a6de..7e6e09564 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -93,6 +93,36 @@ $('#' + id).val(content); } } + + $(function(){ + var x = 10; + var y = 20; + $("span.tooltip").mouseover(function(e){ + this.myTitle = this.title; + this.title = ""; + var tooltip = "
" + this.myTitle + "
"; + $("body").append(tooltip); + $("#tooltip") + .css({ + "top": (e.pageY + y) + "px", + "left": (e.pageX + x) + "px" + }).show("fast"); + }).mouseout(function(){ + this.title = this.myTitle; + $("#tooltip").remove(); + }).mousemove(function(e){ + $("#tooltip") + .css({ + "top": (e.pageY + y) + "px", + "left": (e.pageX + x) + "px" + }); + }); + }) + + $("span.project_info").live("mouseover", funtion(){ + var v = $(this).attr("id"); + alert(v); + }); <%= stylesheet_link_tag 'welcome' %> @@ -105,11 +135,11 @@ <% find_hot_forum_topics.each do |topic|%>
  • -      <%= link_to topic.subject.truncate(30, omission: '...'), forum_memo_path(topic.forum_id,topic.id), :class => "gray" %> - +      <%= link_to topic.subject.truncate(25, omission: '...'), forum_memo_path(topic.forum_id,topic.id), :class => "gray" %> + <%= link_to topic.author, user_path(topic.author) %> - <%= time_tag_welcome topic.created_at %>前 + <%= time_tag_welcome topic.created_at %>前
  • <% end %> @@ -149,7 +179,12 @@

    <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%> -     <%= show_grade project %> + + <%= content_tag "span", show_grade(project), + :style => "cursor: help; display: inline-block; float: right; color: #ec6300; background: url('/images/score.png') no-repeat scroll ;background-position: left center;", + :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", + :class => "tooltip", + :id => "tooltip-#{project.project_id}" %>

    <%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>