Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course
This commit is contained in:
commit
c3f63709ed
|
@ -3238,6 +3238,7 @@ def strip_html(text,len=0,endss="...")
|
||||||
ss = ""
|
ss = ""
|
||||||
if text.length>0
|
if text.length>0
|
||||||
ss=text.gsub(/<\/?.*?>/, '').strip
|
ss=text.gsub(/<\/?.*?>/, '').strip
|
||||||
|
ss = ss.gsub(/ /, ' ')
|
||||||
|
|
||||||
if len > 0 && ss.length > len
|
if len > 0 && ss.length > len
|
||||||
ss = ss[0, len] + endss
|
ss = ss[0, len] + endss
|
||||||
|
|
|
@ -239,8 +239,10 @@ class Journal < ActiveRecord::Base
|
||||||
|
|
||||||
#缺陷回复微信模板消息
|
#缺陷回复微信模板消息
|
||||||
def issue_wechat_message
|
def issue_wechat_message
|
||||||
ws = WechatService.new
|
if !self.notes.nil? && self.notes.gsub(' ','') != ''
|
||||||
content = strip_html self.notes.html_safe, 200
|
ws = WechatService.new
|
||||||
ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
content = strip_html self.notes.html_safe, 200
|
||||||
|
ws.comment_template self.issue.author_id, "issues", self.journalized_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -259,19 +259,26 @@ class JournalsForMessage < ActiveRecord::Base
|
||||||
if self.m_parent_id.nil?
|
if self.m_parent_id.nil?
|
||||||
if self.user_id != self.jour.user_id
|
if self.user_id != self.jour.user_id
|
||||||
self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.course.id, :viewed => false)
|
self.course_messages << CourseMessage.new(:user_id => self.jour.user_id,:course_id => self.jour.course.id, :viewed => false)
|
||||||
|
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||||
|
if count == 0
|
||||||
|
ws = WechatService.new
|
||||||
|
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||||
|
content = strip_html self.notes.html_safe, 200
|
||||||
|
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if self.user_id != self.parent.user_id
|
if self.user_id != self.parent.user_id
|
||||||
self.course_messages << CourseMessage.new(:user_id => self.parent.user_id,:course_id => self.jour.course.id, :viewed => false)
|
self.course_messages << CourseMessage.new(:user_id => self.parent.user_id,:course_id => self.jour.course.id, :viewed => false)
|
||||||
|
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.parent.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
||||||
|
if count == 0
|
||||||
|
ws = WechatService.new
|
||||||
|
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
||||||
|
content = strip_html self.notes.html_safe, 200
|
||||||
|
ws.comment_template self.parent.user_id, "homework", self.jour_id, "#{l(:label_new_second_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{self.jour.user_id} and shield_type='Course' and shield_id=#{self.jour.course_id}").count
|
|
||||||
if count == 0
|
|
||||||
ws = WechatService.new
|
|
||||||
#content = truncate(strip_tags(self.notes.to_s), length: 200)
|
|
||||||
content = strip_html self.notes.html_safe, 200
|
|
||||||
ws.comment_template self.jour.user_id, "homework", self.jour_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), content
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -395,9 +395,9 @@
|
||||||
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
||||||
<% if ma.course_message.m_parent_id.nil? %>
|
<% if ma.course_message.m_parent_id.nil? %>
|
||||||
回复了您的作业:
|
回复了您的<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>:
|
||||||
<% else %>
|
<% else %>
|
||||||
回复了您:
|
在<span class="fontBlue2" title="作业:<%=ma.course_message.jour.name %>">作业</span>中回复了您:
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -2137,6 +2137,7 @@ zh:
|
||||||
label_notice_comment_template: 您的课程通知有新回复了
|
label_notice_comment_template: 您的课程通知有新回复了
|
||||||
label_news_comment_template: 您的项目新闻有新回复了
|
label_news_comment_template: 您的项目新闻有新回复了
|
||||||
label_homework_comment_template: 您的作业有新回复了
|
label_homework_comment_template: 您的作业有新回复了
|
||||||
|
label_new_second_comment_template: 您有新回复了
|
||||||
label_new_journals_template: 您有新留言了
|
label_new_journals_template: 您有新留言了
|
||||||
label_journals_comment_template: 您的留言有新回复了
|
label_journals_comment_template: 您的留言有新回复了
|
||||||
label_blog_comment_template: 您的博客有新回复了
|
label_blog_comment_template: 您的博客有新回复了
|
||||||
|
|
Loading…
Reference in New Issue