This commit is contained in:
z9hang 2014-05-08 15:52:28 +08:00
commit 3caedbdb85
5 changed files with 29 additions and 18 deletions

View File

@ -74,7 +74,7 @@ class ContestsController < ApplicationController
def show_contest def show_contest
@user = @contest.author @user = @contest.author
@jours = @contest.journals_for_messages.order('created_on DESC') @jours = @contest.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10 @limit = 10
@feedback_count = @jours.count @feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @feedback_pages = Paginator.new @feedback_count, @limit, params['page']

View File

@ -28,20 +28,32 @@ class Mailer < ActionMailer::Base
end end
# Builds a Mail::Message object used to email recipients of the added journals for message. # Builds a Mail::Message object used to email recipients of the added journals for message.
#
# 留言分为直接留言,和对留言人留言的回复
# 字段说明在JournalsForMessage.rb
# 直接留言后 reply_id,m_parent_id 为空相对应的at_user取值为nil
def journals_for_message_add(user, journals_for_message) def journals_for_message_add(user, journals_for_message)
@user = journals_for_message.user @user = journals_for_message.user # 留言人
if journals_for_message.jour_type!="Project"&&journals_for_message.jour_type!="Bid" @mail = journals_for_message.jour if journals_for_message.at_user.nil? # 留言
if(journals_for_message.reply_id==0) @mail = journals_for_message.at_user if journals_for_message.at_user
@mail = journals_for_message.jour
else
@mail = journals_for_message.at_user
end
@message = journals_for_message.notes @message = journals_for_message.notes
@url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => journals_for_message.jour) @title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
str = "#{@user} #{t(:label_leave_your_message, :locale => 'zh')}"
mail :to => @mail.mail, :subject => str @url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :User
user_newfeedback_user_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
else
logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
return -1
end end
mail :to => @mail.mail, :subject => @title
end end
# Builds a Mail::Message object used to email recipients of the added issue. # Builds a Mail::Message object used to email recipients of the added issue.

View File

@ -29,6 +29,6 @@
<div class="pagination" style="float:left;"> <div class="pagination" style="float:left;">
<ul> <ul>
<%= pagination_links_full @feedback_pages %> <%= pagination_links_full @feedback_pages %>
<ul> </ul>
</div> </div>

View File

@ -402,8 +402,7 @@ a.attachments_list_color {
display: inline-block; display: inline-block;
margin-bottom: 3px; margin-bottom: 3px;
padding-left: 20px; padding-left: 20px;
background: url('/images/list-icon.png') no-repeat scroll; background: url('../images/list-icon.png') no-repeat scroll left center;
background-position: left center;
font-size: 10pt; font-size: 10pt;
} }
/*帖子的各种属性*/ /*帖子的各种属性*/