Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
91497d3f95
|
@ -1,9 +1,7 @@
|
||||||
# Added by young
|
# Added by young
|
||||||
class JournalsForMessageObserver < ActiveRecord::Observer
|
class JournalsForMessageObserver < ActiveRecord::Observer
|
||||||
def after_create(journals_for_message)
|
def after_create(journals_for_message)
|
||||||
Thread.new do
|
|
||||||
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
Mailer.journals_for_message_add(User.current, journals_for_message).deliver
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -44,16 +44,7 @@ class Mailer < ActionMailer::Base
|
||||||
when :Bid
|
when :Bid
|
||||||
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
when :Project
|
when :Project
|
||||||
if journals_for_message.jour.project_type == 1
|
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
|
||||||
project = journals_for_message.jour
|
|
||||||
@teachers = searchTeacherAndAssistant journals_for_message.jour
|
|
||||||
@recipients ||= []
|
|
||||||
@teachers.each do |teacher|
|
|
||||||
@recipients << teacher
|
|
||||||
end
|
|
||||||
mail :to => @recipients,
|
|
||||||
:subject => "您的课程#{journals_for_message.jour.name}中有了新的留言"
|
|
||||||
end
|
|
||||||
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
when :Contest
|
when :Contest
|
||||||
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
|
||||||
|
@ -63,9 +54,25 @@ class Mailer < ActionMailer::Base
|
||||||
logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
|
logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
#如果是直接留言并且留言对象是Project并且Project类型是课程
|
||||||
|
if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Project && journals_for_message.jour.project_type == 1
|
||||||
|
project = journals_for_message.jour
|
||||||
|
#课程的教师
|
||||||
|
@teachers = searchTeacherAndAssistant journals_for_message.jour
|
||||||
|
#收件人邮箱
|
||||||
|
@recipients ||= []
|
||||||
|
@teachers.each do |teacher|
|
||||||
|
@recipients << teacher.user.mail
|
||||||
|
end
|
||||||
|
mail :to => @recipients,
|
||||||
|
:subject => "#{l(:label_your_course)}#{journals_for_message.jour.name}#{l(:label_have_message)} "
|
||||||
|
else
|
||||||
mail :to => @mail.mail, :subject => @title
|
mail :to => @mail.mail, :subject => @title
|
||||||
end
|
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.
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
|
@ -433,7 +440,10 @@ class Mailer < ActionMailer::Base
|
||||||
headers[:to].delete(@author.mail) if headers[:to].is_a?(Array)
|
headers[:to].delete(@author.mail) if headers[:to].is_a?(Array)
|
||||||
headers[:cc].delete(@author.mail) if headers[:cc].is_a?(Array)
|
headers[:cc].delete(@author.mail) if headers[:cc].is_a?(Array)
|
||||||
end
|
end
|
||||||
|
if !User.current.nil?
|
||||||
|
#不给本人发邮件
|
||||||
|
headers[:to].delete(User.current.mail) if headers[:to].is_a?(Array)
|
||||||
|
end
|
||||||
if @author && @author.logged?
|
if @author && @author.logged?
|
||||||
redmine_headers 'Sender' => @author.login
|
redmine_headers 'Sender' => @author.login
|
||||||
end
|
end
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="1" valign="top" style="width: 300px">
|
<td colspan="1" valign="top" style="width: 300px">
|
||||||
<strong>发布人: <%= link_to (display_id ? homework.user.realname : homework.user ), user_path(homework.user)%></strong>
|
<strong>发布人: <%= link_to ( is_teacher ? homework.user.realname : homework.user ), user_path(homework.user)%></strong>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<strong>作业评分:</strong>
|
<strong>作业评分:</strong>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<td colspan="2" valign="top">
|
<td colspan="2" valign="top">
|
||||||
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
|
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
|
||||||
<span class="font_lighter">
|
<span class="font_lighter">
|
||||||
<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>
|
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>)
|
||||||
<%= l(:label_new_activity) %> </span>
|
<%= l(:label_new_activity) %> </span>
|
||||||
|
|
||||||
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
|
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
#判断是否显示真名
|
#判断是否显示真名
|
||||||
if @canShowRealName
|
if @canShowRealName
|
||||||
%>
|
%>
|
||||||
<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>
|
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>)
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>
|
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1617,6 +1617,8 @@ en:
|
||||||
label_class_hour: period
|
label_class_hour: period
|
||||||
label_activity_time: publish date
|
label_activity_time: publish date
|
||||||
|
|
||||||
|
label_your_course: your course
|
||||||
|
label_have_message : have a new message
|
||||||
label_login_prompt: Email/NickName
|
label_login_prompt: Email/NickName
|
||||||
|
|
||||||
# ajax异步验证
|
# ajax异步验证
|
||||||
|
|
|
@ -1499,6 +1499,8 @@ zh:
|
||||||
label_tags_numbers: Tag统计:
|
label_tags_numbers: Tag统计:
|
||||||
label_max_number: 昵称是在网站中显示的您的公开标识,至多25个字符。
|
label_max_number: 昵称是在网站中显示的您的公开标识,至多25个字符。
|
||||||
label_mail_attention: qq邮箱可能收不到此邮件,其他邮箱如果没有收到可能在垃圾邮件中,其中gmail与教育网邮箱的激活邮件有时比较慢,请耐心等待。
|
label_mail_attention: qq邮箱可能收不到此邮件,其他邮箱如果没有收到可能在垃圾邮件中,其中gmail与教育网邮箱的激活邮件有时比较慢,请耐心等待。
|
||||||
|
label_your_course: 您的课程《
|
||||||
|
label_have_message : 》有新的留言
|
||||||
label_all_revisions: 所有版本:
|
label_all_revisions: 所有版本:
|
||||||
label_upassword_info: 该密码在项目组内可共享
|
label_upassword_info: 该密码在项目组内可共享
|
||||||
label_how_commit_code: 查看如何提交代码:
|
label_how_commit_code: 查看如何提交代码:
|
||||||
|
|
Loading…
Reference in New Issue