diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 6df73225f..087fb6d73 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -139,6 +139,7 @@ class Mailer < ActionMailer::Base
end
end
end
+
# 查询user在课程中发布的通知,项目中发的新闻
@course_news = (course_ids && !course_ids.empty?) ? News.find_by_sql("select DISTINCT n.* from news n
where n.course_id in (#{course_ids})
@@ -151,18 +152,13 @@ class Mailer < ActionMailer::Base
jour_type='Course' and user_id = #{user.id}
and (created_on between '#{date_from}' and '#{date_to}') order by created_on desc")
@user_journal_messages = user.journals_for_messages.where("m_parent_id IS NULL and (created_on between '#{date_from}' and '#{date_to}')").order('created_on DESC')
-
-
# 查询user新建贴吧或发布帖子
@forums = Forum.find_by_sql("select DISTINCT * from forums where creator_id = #{user.id} and (created_at between '#{date_from}' and '#{date_to}') order by created_at desc")
@memos = Memo.find_by_sql("select DISTINCT m.* from memos m, forums f where (m.author_id = #{user.id} or (m.forum_id = f.id and f.creator_id = #{user.id}))
and (m.created_at between '#{date_from}' and '#{date_to}') order by m.created_at desc")
-
has_content = [@issues,@homeworks,@course_messages,@project_messages,@course_news,@project_news,
- @course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o|
- !o.empty?
- }
+ @course_journal_messages,@user_journal_messages,@forums,@memos,@attachments,@bids].any? {|o| !o.empty?}
mylogger.debug "Sent activity mail : #{user.mail} - #{has_content}"
#有内容才发,没有不发
mail :to => user.mail,:subject => subject if has_content
diff --git a/app/views/mailer/news_added.html.erb b/app/views/mailer/news_added.html.erb
index f214b8293..316ab9d2c 100644
--- a/app/views/mailer/news_added.html.erb
+++ b/app/views/mailer/news_added.html.erb
@@ -23,7 +23,7 @@
<%= l(:mail_issue_content)%>
- <%= @news.description.html_safe %>
+ <%= @news.description.html_safe %>
diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb
index 1ea977e89..81a65442f 100644
--- a/app/views/mailer/send_for_user_activities.html.erb
+++ b/app/views/mailer/send_for_user_activities.html.erb
@@ -3,7 +3,7 @@
<%= @subject %>
<% if @attachments.first || @course_news.first || @bids.first ||
- @homeworks.first || @course_journal_messages.first|| @course_messages.first %>
+ @homeworks.first || @course_journal_messages.first|| @course_messages.first %>
<%= l(:label_course_overview)%>
<% unless @course_news.first.nil? %>
@@ -35,11 +35,12 @@
<% end %>
-
+
<% end %>
+
+
<% if !@bids.first.nil? || !@homeworks.first.nil? %>
-
<%= l(:label_homework_overview) %>(<%= @bids.count %>)
<% unless @bids.first.nil?%>
<% @bids.each do |bid| %>
@@ -92,9 +93,9 @@
<% end %>
+
<% unless @course_journal_messages.first.nil? %>
-
<%= l(:view_course_journals_for_messages) %>
(<%= @course_journal_messages.count %>)
@@ -121,45 +122,39 @@
<%= format_time(course_journal_message.created_on) %>
<% end %>
-
<% end %>
+
<% unless @course_messages.first.nil? %>
-
<%= l(:view_borad_course) %>
(<%= @course_journal_messages.count %>)
-
<% @course_messages.each do |course_message|%>
-
▪
[
-
<%= link_to truncate(course_message.course.name,length: 30,omission: '...'), course_url(course_message.course.id, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
]
-
<%= link_to course_message.author, user_activities_url(course_message.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<%= l(:label_send_course_messages) %>
-
<%= link_to truncate(course_message.subject,length: 30,omission: '...'),board_message_url(course_message, :board_id => course_message.board_id,:token => @token.value),
:class => 'wmail_info',
- :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
- %>
+ :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<%= format_time(course_message.created_on) %>
<% end %>
-
-
+
<% end %>
+
<% unless @attachments.first.nil? %>
<% end %>
-
+
<% end %>
+
+
+
<% if @issues.first || @project_messages.first %>
@@ -207,16 +205,13 @@
▪
[
-
<%= link_to truncate(issue.project.name,length: 30,omission: '...'), project_url(issue.project, :token => @token.value),
:class=> "wmail_column",
:style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
]
-
<%= link_to issue.author, user_activities_url(issue.author,:token => @token.value), :class => "wmail_name",
:style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<%= l(:label_project_issue) %>
-
<%= link_to truncate(issue.subject,length: 30,omission: '...'),issue_url(issue, :token => @token.value),
:class => 'wmail_info',
:style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
@@ -229,6 +224,7 @@
<% end %>
+
<% unless @project_messages.first.nil? %>
<% end %>
-
-<% end %>
+
+ <% unless @project_news.first.nil? %>
+
+
+ <%= l(:label_course_news) %>
+ (<%= @project_news.count %>)
+
+ <% @project_news.each do |project_new|%>
+ -
+ ▪
+ [
+
+ <%= link_to truncate(project_new.project.name,length: 30,omission: '...'), project_url(project_new.project, :token => @token.value),
+ :class=> "wmail_column",
+ :style=> " font-weight: bold; display:block; float:left; color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
+ ]
+ <%= link_to project_new.author, user_activities_url(project_new.author,:token => @token.value), :class => "wmail_name",
+ :style => "color:#fe5722; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
+ <%= l(:label_project_notice) %>
+
+ <%= link_to truncate(project_new.title,length: 30,omission: '...'), news_url(project_new,:token => @token.value),
+ :class => 'wmail_info',
+ :style => "color:#5a5a5a; float:left; margin-right:5px; display:block;color:#1b55a7;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
+ %>
+ <%= format_time(project_new.created_on) %>
+
+ <% end %>
+
+
+ <% end %>
+
+
+<% end %>
+
+
<% unless @user_journal_messages.first.nil? %>
<%= l(:label_activities) %>
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 8ca078084..78f608a80 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -85,7 +85,8 @@ zh:
project_module_documents: 文档
label_roadmap: 里程碑 #版本路线图
project_module_dts: DTS测试工具
- label_project_tool_response: 用户反馈
+ label_project_tool_response: 用户反馈
+ label_course_news: 项目新闻
label_project_overview: "项目简介"
label_expend_information: 展开更多信息