修改部分内容

This commit is contained in:
nieguanghui 2013-12-03 08:42:54 +08:00
parent 0609c5c7ea
commit 25fd898623
2 changed files with 40 additions and 5 deletions

View File

@ -61,7 +61,7 @@ module WelcomeHelper
rescue Exception => e
logger.error "[WelcomeHelper] ===> #{e}"
end
grade
"&nbsp;&nbsp;&nbsp;&nbsp;".html_safe << grade.to_s
end
def show_user_content event

View File

@ -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 = "<div id='tooltip' style='background-color: red;'>" + this.myTitle + "</div>";
$("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);
});
</script>
<!-- info display block -->
<%= stylesheet_link_tag 'welcome' %>
@ -105,11 +135,11 @@
<% find_hot_forum_topics.each do |topic|%>
<li class="message-brief-intro" style="min-height: 25px;">
<div style="display: inline-block;">
<span style="color:graydisplay: inline-block; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= link_to topic.subject.truncate(30, omission: '...'), forum_memo_path(topic.forum_id,topic.id), :class => "gray" %></span>
<span style="margin-left: 10px; color: green">
<span style="color:graydisplay: inline-block; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= link_to topic.subject.truncate(25, omission: '...'), forum_memo_path(topic.forum_id,topic.id), :class => "gray" %></span>
<span style="margin-left: 20px; color: green; white-space: nowrap;">
<%= link_to topic.author, user_path(topic.author) %>
</span>
<span style="margin-left:10px; color:blue"><%= time_tag_welcome topic.created_at %>前</span>
<span style="margin-left:20px; color:blue; white-space: nowrap;"><%= time_tag_welcome topic.created_at %>前</span>
</div>
</li>
<% end %>
@ -149,7 +179,12 @@
<div style="float: left; margin-left: 10px; width: 360px;">
<p class="layout">
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%>
<span style="cursor: help; display: inline-block; float: right; color: #ec6300; background: url('/images/score.png') no-repeat scroll ;background-position: left center;" title="项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度">&nbsp;&nbsp;&nbsp;&nbsp;<%= show_grade project %></span>
<!-- <span 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-#{project.project_id}"><%= show_grade project %></span> -->
<%= 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}" %>
</p>
<p class="layout-1" >
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>