1. Three expressions syntax

2. 留言显示重复
3. 发送邮件内容
4. show_contest.html typo
5. welcome.css typo
This commit is contained in:
yanxd 2014-05-08 15:27:16 +08:00
parent 8770599352
commit cc2f359e8c
5 changed files with 29 additions and 18 deletions

View File

@ -49,7 +49,7 @@ class ActivitiesController < ApplicationController
@activity_pages = Paginator.new @activity_count, @limit, params['page']
@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])
respond_to do |format|
format.html {

View File

@ -74,7 +74,7 @@ class ContestsController < ApplicationController
def show_contest
@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
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']

View File

@ -28,20 +28,32 @@ class Mailer < ActionMailer::Base
end
# 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)
@user = journals_for_message.user
if journals_for_message.jour_type!="Project"&&journals_for_message.jour_type!="Bid"
if(journals_for_message.reply_id==0)
@mail = journals_for_message.jour
else
@mail = journals_for_message.at_user
end
@message = journals_for_message.notes
@url = url_for(:controller => 'users', :action => 'user_newfeedback', :id => journals_for_message.jour)
str = "#{@user} #{t(:label_leave_your_message, :locale => 'zh')}"
mail :to => @mail.mail, :subject => str
end
@user = journals_for_message.user # 留言人
@mail = journals_for_message.jour if journals_for_message.at_user.nil? # 留言
@mail = journals_for_message.at_user if journals_for_message.at_user
@message = journals_for_message.notes
@title = "#@user #{t(:label_leave_your_message, :locale => 'zh')}"
@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
mail :to => @mail.mail, :subject => @title
end
# 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;">
<ul>
<%= pagination_links_full @feedback_pages %>
<ul>
</ul>
</div>

View File

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