Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
3caedbdb85
|
@ -49,7 +49,7 @@ class ActivitiesController < ApplicationController
|
||||||
@activity_pages = Paginator.new @activity_count, @limit, params['page']
|
@activity_pages = Paginator.new @activity_count, @limit, params['page']
|
||||||
@offset ||= @activity_pages.offset
|
@offset ||= @activity_pages.offset
|
||||||
|
|
||||||
@project_base_tag = params[:id]?'base_projects':'base'
|
@project_base_tag = params[:id] ? 'base_projects' : 'base'
|
||||||
if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language])
|
if events.empty? || stale?(:etag => [@activity.scope, @date_to, @date_from, @with_subprojects, @author, events.first, events.size, User.current, current_language])
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
|
|
@ -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']
|
||||||
|
|
|
@ -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
|
@message = journals_for_message.notes
|
||||||
else
|
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
|
||||||
@mail = journals_for_message.at_user
|
|
||||||
end
|
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
|
||||||
@message = journals_for_message.notes
|
when :Bid
|
||||||
@url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => journals_for_message.jour)
|
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
str = "#{@user} #{t(:label_leave_your_message, :locale => 'zh')}"
|
when :Project
|
||||||
mail :to => @mail.mail, :subject => str
|
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
end
|
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
|
||||||
|
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.
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
/*帖子的各种属性*/
|
/*帖子的各种属性*/
|
||||||
|
|
Loading…
Reference in New Issue