鼠标经过显示内容效果

公共贴吧数据迁移
This commit is contained in:
huang 2015-09-01 15:23:30 +08:00
parent 6dff29f931
commit fede611fea
6 changed files with 52 additions and 33 deletions

View File

@ -8,7 +8,7 @@ class UserFeedbackMessage < ActiveRecord::Base
validates :user_id,presence: true
validates :journals_for_message_id,presence: true
validates :journals_for_message_type, presence: true
after_create :add_user_message
after_save :add_user_message
def add_user_message
self.message_alls << MessageAll.new(:user_id => self.user_id)

View File

@ -198,7 +198,7 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>" ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %></span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.content.html_safe}" %></a>
<%= link_to ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
</ul>
@ -215,8 +215,13 @@
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ma.journals_for_message.notes}" %></a>
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey",
:title => "#{ma.journals_for_message.notes}",
:onmouseover =>"message_titile_show('message_title')",
:onmouseout => "message_titile_hide('message_title')" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul>
@ -237,6 +242,21 @@
</div>
<div id="message_title" style="display: none">
66666666666666666666666
</div>
<script>
function message_titile_show(message_title)
{
document.getElementById(message_title).style.display="block";
}
function message_titile_hide(message_title)
{
document.getElementById(message_title).style.display="none";
}
</script>

View File

@ -1,26 +0,0 @@
class UpdateUserfeedbackTime < ActiveRecord::Migration
def up
user_feedback_count = UserFeedbackMessage.all.count / 30 + 1
transaction do
for i in 1 ... user_feedback_count do i
UserFeedbackMessage.page(i).per(30).each do |ufm|
if ufm.course_message
if ufm.course_message.respond_to?("created_at")
ufm.created_at = ufm.course_message.created_at
elsif ufm.course_message.respond_to?("created_on")
ufm.created_at = ufm.course_message.created_on
end
ufm.save
user_feedbach_messages = MessageAll.where("message_type = '#{ufm.class.to_s}' and message_id = '#{ufm.id}'").first
user_feedbach_messages.created_at = ufm.created_at
user_feedbach_messages.save
end
end
end
end
end
def down
end
end

View File

@ -1,4 +1,4 @@
class UpdateMemoTime < ActiveRecord::Migration
class UpdateMemoMessageTime < ActiveRecord::Migration
def up
memo_count = Memo.all.count / 30 + 1
transaction do
@ -12,7 +12,7 @@ class UpdateMemoTime < ActiveRecord::Migration
end
memo_message.save
memo_messages = MemoMessage.where("message_type = '#{memo_message.class.to_s}' and message_id = '#{memo_message.id}'").first
memo_messages = MessageAll.where("message_type = '#{memo_message.class.to_s}' and message_id = '#{memo_message.id}'").first
memo_messages.created_at = memo_message.created_at
memo_messages.save
end

View File

@ -0,0 +1,27 @@
class UpdateUserfeebackMessageTime < ActiveRecord::Migration
def up
user_feedback_count = UserFeedbackMessage.all.count / 30 + 1
transaction do
for i in 1 ... user_feedback_count do i
UserFeedbackMessage.page(i).per(30).each do |ufm|
if ufm.journals_for_message
if ufm.journals_for_message.respond_to?("created_at")
ufm.created_at = ufm.journals_for_message.created_at
elsif ufm.journals_for_message.respond_to?("created_on")
ufm.created_at = ufm.journals_for_message.created_on
end
puts ufm.id
ufm.save
user_feedback_messages = MessageAll.where("message_type = '#{ufm.class.to_s}' and message_id = '#{ufm.id}'").first
user_feedback_messages.created_at = ufm.created_at
user_feedback_messages.save
end
end
end
end
end
def down
end
end

View File

@ -963,5 +963,3 @@ img.ui-datepicker-trigger {