Merge branch 'weixin_guange' into develop

Conflicts:
	app/models/blog_comment.rb
This commit is contained in:
cxt 2016-04-12 15:56:08 +08:00
commit e420be8ee9
24 changed files with 166 additions and 284 deletions

1
1234567 Normal file
View File

@ -0,0 +1 @@
{"access_token":"ONE7uqb5MhyuYiOtMkzUMPJs8krCiQeBjWek_Q9glYtfCH-kkQKzv84dgxUv5VLBnb5zdKajWDyHqocvu71UwlVuVFhsXs9MwbVdCu1i4l2L5vKCkhNE5GuyO6WisXfvKOUfAEAYCI","expires_in":7200,"got_token_at":1460441290}

View File

@ -24,6 +24,8 @@ module Mobile
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
when :student_num
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.student_id
when :realname
u.nil? ? "" : get_user_realname(u)
end
end
end
@ -37,7 +39,7 @@ module Mobile
#昵称
expose :nickname
#真名
expose :realname
user_expose :realname
#性别
user_expose :gender
#我的二维码

View File

@ -27,6 +27,10 @@ module ApiHelper
location
end
def get_user_realname user
name = user.lastname + user.firstname
name.empty? || name.nil? || name == " " ? user.login : name
end
def get_assigned_homeworks(homeworks, n, index)
homeworks += homeworks

View File

@ -77,49 +77,13 @@ class BlogComment < ActiveRecord::Base
end
#博客回复微信模板消息
def blog_wechat_message
# 发布博客
unless self.parent_id.nil?
uw = UserWechat.where(user_id: self.parent.author_id).first
#unless uw.nil? && self.parent.author_id != User.current.id
unless uw.nil?
data = {
touser:uw.openid,
template_id:"A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c",
url:"http://www.trustie.net/",
topcolor:"#FF0000",
data:{
first: {
value:"您的博客有新回复了",
color:"#173177"
},
keyword1:{
value:self.author.try(:realname),
color:"#173177"
},
keyword2:{
value:format_time(self.created_at),
color:"#173177"
},
keyword3:{
value:self.content.html_safe,
color:"#173177"
},
remark:{
value:"具体内容请点击详情查看网站",
color:"#173177"
}
}
}
logger.info "start send template message: #{data}"
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[blog_comment] ===> #{e}"
end
logger.info "send over. #{req}"
end
end
def blog_wechat_message
if self.parent_id.nil?
self.author.watcher_users.each do |watcher|
Wechat.api.message_update_template watcher.id, "#{l(:label_new_blog_template)}", self.author.try(:realname) + " 发表了博客:" + self.title.html_safe, format_time(self.created_at)
else
Wechat.api.comment_template self.parent.author_id, "#{l(:label_blog_comment_template)}", self.author.try(:realname), format_time(self.created_at), self.content.html_safe
end
end
end

View File

@ -16,6 +16,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Comment < ActiveRecord::Base
require 'net/http'
require 'json'
include Redmine::SafeAttributes
include ApplicationHelper
has_many_kindeditor_assets :assets, :dependent => :destroy
@ -42,10 +44,12 @@ class Comment < ActiveRecord::Base
if self.commented.course
if self.author_id != self.commented.author_id
self.course_messages << CourseMessage.new(:user_id => self.commented.author_id, :course_id => self.commented.course.id, :viewed => false)
Wechat.api.comment_template self.commented.author_id, "#{l(:label_notice_comment_template)}", self.author.try(:realname), format_time(self.created_on), self.comments.html_safe
end
else # 项目相关
if self.author_id != self.commented.author_id
self.forge_messages << ForgeMessage.new(:user_id => self.commented.author_id, :project_id => self.commented.project.id, :viewed => false)
Wechat.api.comment_template self.commented.author_id, "#{l(:label_news_comment_template)}", self.author.try(:realname), format_time(self.created_on), self.comments.html_safe
end
end
end

View File

@ -59,6 +59,7 @@ class HomeworkCommon < ActiveRecord::Base
self.course.members.each do |m|
# if m.user_id != self.user_id
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
Wechat.api.homework_template(m.user_id, "#{l(:label_new_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59")
# end
end
end
@ -104,44 +105,7 @@ class HomeworkCommon < ActiveRecord::Base
#修改作业后发送微信模板消息
def wechat_message
self.course.members.each do |member|
uw = UserWechat.where("user_id=?", member.user_id).first
unless uw.nil?
data = {
touser:uw.openid,
template_id:"3e5Dj2GIx8MOcMyRKpTUEQnM7Tg0ASSCNc01NS9HCGI",
url:"http://www.trustie.net/",
topcolor:"#FF0000",
data:{
first: {
value:"您的作业已被修改",
color:"#173177"
},
keyword1:{
value:self.course.name,
color:"#173177"
},
keyword2:{
value:self.name,
color:"#173177"
},
keyword3:{
value:self.end_time.to_s + "23:59:59",
color:"#173177"
},
remark:{
value:"具体内容请点击详情查看网站",
color:"#173177"
}
}
}
logger.info "start send template message: #{data}"
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[homework_common] ===> #{e}"
end
logger.info "send over. #{req}"
end
Wechat.api.homework_template(member.user_id, "#{l(:label_update_homework_template)}", self.course.name, self.name.html_safe, self.end_time.to_s + " 23:59:59")
end
end

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -16,6 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Issue < ActiveRecord::Base
require 'net/http'
require 'json'
include Redmine::SafeAttributes
include Redmine::Utils::DateCalculation
include UserScoreHelper
@ -156,6 +159,7 @@ class Issue < ActiveRecord::Base
# 指派给自己的缺陷不提示消息
unless self.author_id == self.assigned_to_id
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false)
Wechat.api.message_update_template self.assigned_to_id, "#{l(:label_new_issue_template)}", self.author.try(:realname) + " 给您指派了缺陷:" + self.subject.html_safe, format_time(self.created_on)
end
if self.tracker_id == 5
self.project.members.each do |m|

View File

@ -239,44 +239,6 @@ class Journal < ActiveRecord::Base
#缺陷回复微信模板消息
def issue_wechat_message
uw = UserWechat.where(user_id: self.issue.author_id).first
#unless uw.nil? && self.issue.author_id != User.current.id
unless uw.nil?
data = {
touser:uw.openid,
template_id:"A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c",
url:"http://www.trustie.net/",
topcolor:"#FF0000",
data:{
first: {
value:"您的缺陷有新回复了",
color:"#173177"
},
keyword1:{
value:self.user.try(:realname),
color:"#173177"
},
keyword2:{
value:format_time(self.created_on),
color:"#173177"
},
keyword3:{
value:self.notes.html_safe,
color:"#173177"
},
remark:{
value:"具体内容请点击详情查看网站",
color:"#173177"
}
}
}
logger.info "start send template message: #{data}"
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[journal] ===> #{e}"
end
logger.info "send over. #{req}"
end
Wechat.api.comment_template self.issue.author_id, "#{l(:label_issue_comment_template)}", self.user.try(:realname), format_time(self.created_on), self.notes.html_safe
end
end

View File

@ -256,7 +256,7 @@ class JournalsForMessage < ActiveRecord::Base
end
end
if self.jour_type == 'HomeworkCommon'
journal_wechat_message '您的作业有新回复了',self.jour.user_id
Wechat.api.comment_template self.jour.user_id, "#{l(:label_homework_comment_template)}", self.user.try(:realname), format_time(self.created_on), self.notes.html_safe
end
end
@ -269,7 +269,7 @@ class JournalsForMessage < ActiveRecord::Base
if self.reply_id == 0
if self.user_id != self.jour_id # 过滤自己给自己的留言消息
receivers << self.jour
journal_wechat_message "您有新留言了",self.jour_id
Wechat.api.message_update_template self.jour_id, "#{l(:label_new_journals_template)}", self.notes.html_safe, format_time(self.created_on)
end
else # 留言回复
reply_to = User.find(self.reply_id)
@ -279,12 +279,11 @@ class JournalsForMessage < ActiveRecord::Base
if self.user_id != self.parent.jour_id && self.reply_id != self.parent.jour_id # 给东家发信息,如果回复的对象是东家则不发
receivers << self.parent.jour
end
journal_wechat_message "您的留言有新回复了",self.reply_id
Wechat.api.comment_template self.reply_id, "#{l(:label_journals_comment_template)}", self.user.try(:realname), format_time(self.created_on), self.notes.html_safe
end
receivers.each do |r|
self.user_feedback_messages << UserFeedbackMessage.new(:user_id => r.id, :journals_for_message_id => self.id, :journals_for_message_type => "Principal", :viewed => false)
end
end
end
@ -305,48 +304,4 @@ class JournalsForMessage < ActiveRecord::Base
down_course_score_num(self.jour.course_id, self.user_id, "HomeworkCommon")
end
end
#微信模板消息
def journal_wechat_message type, user_id
uw = UserWechat.where(user_id: user_id).first
#unless uw.nil? && self.reply_id != User.current.id
unless uw.nil?
data = {
touser:uw.openid,
template_id:"A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c",
url:"http://www.trustie.net/",
topcolor:"#FF0000",
data:{
first: {
value:type,
color:"#173177"
},
keyword1:{
value:self.user.try(:realname),
color:"#173177"
},
keyword2:{
value:format_time(self.created_on),
color:"#173177"
},
keyword3:{
value:self.notes.html_safe,
color:"#173177"
},
remark:{
value:"具体内容请点击详情查看网站",
color:"#173177"
}
}
}
logger.info "start send template message: #{data}"
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[journal_for_message] ===> #{e}"
end
logger.info "send over. #{req}"
end
end
end

View File

@ -17,8 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Mailer < ActionMailer::Base
require 'net/http'
require 'json'
layout 'mailer'
helper :application
helper :issues
@ -642,9 +640,6 @@ class Mailer < ActionMailer::Base
mail :to => recipients,
:subject => "[ #{l(:label_user_homework)} : #{homework_common.name} #{l(:label_memo_create_succ)}]",
:filter => true
@homework_common.course.members.each do |member|
mail_wechat_message member.user_id, "3e5Dj2GIx8MOcMyRKpTUEQnM7Tg0ASSCNc01NS9HCGI", "您的课程有新作业了", @homework_common.course.name, @homework_common.name, @homework_common.end_time.to_s + " 23:59:59"
end
end
# Builds a Mail::Message object used to email recipients of a news' project when a news item is added.
@ -710,8 +705,6 @@ class Mailer < ActionMailer::Base
mail :to => recipients,
:subject => "[#{news.course.name}] #{l(:label_news)}: #{news.title}",
:filter => true
mail_wechat_message news.author_id, "A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c", "您的课程通知有新回复了", @author.try(:realname), format_time(comment.created_on), comment.comments.html_safe
end
end
@ -736,14 +729,7 @@ class Mailer < ActionMailer::Base
:cc => cc,
:subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}",
:filter => true
if message.parent_id == nil
message.project.members.each do |member|
mail_wechat_message member.user_id, "oKzFCdk7bsIHnGbscA__N8LPQrBkUShvpjV3-kuwWDQ", "项目讨论区有新帖子发布了", message.subject, @author.try(:realname), format_time(message.created_on)
end
else
mail_wechat_message message.parent.author_id, "A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c", "您的帖子有新回复了", @author.try(:realname), format_time(message.created_on), message.content.html_safe
end
elsif message.course
elsif message.course
redmine_headers 'Course' => message.course.id,
'Topic-Id' => (message.parent_id || message.id)
@author = message.author
@ -758,14 +744,7 @@ class Mailer < ActionMailer::Base
:cc => cc,
:subject => "[#{message.board.course.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}",
:filter => true
if message.parent_id == nil
message.course.members.each do |member|
mail_wechat_message member.user_id, "oKzFCdk7bsIHnGbscA__N8LPQrBkUShvpjV3-kuwWDQ", "课程问答区有新帖子发布了", message.subject, @author.try(:realname), format_time(message.created_on)
end
else
mail_wechat_message message.parent.author_id, "A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c", "您的帖子有新回复了", @author.try(:realname), format_time(message.created_on), message.content.html_safe
end
end
end
# Builds a Mail::Message object used to email the recipients of a project of the specified wiki content was added.
@ -1119,48 +1098,4 @@ class Mailer < ActionMailer::Base
1.upto(len) { |i| newpass << chars[rand(chars.size-1)] }
return newpass
end
#微信模板消息
def mail_wechat_message user_id, template_id, first, key1, key2, key3, remark="具体内容请点击详情查看网站"
uw = UserWechat.where(user_id: user_id).first
logger.info "mail_wechat_message #{user_id} #{uw}"
unless uw.nil?
data = {
touser:uw.openid,
template_id:template_id,
url:"http://www.trustie.net/",
topcolor:"#FF0000",
data:{
first: {
value:first,
color:"#173177"
},
keyword1:{
value:key1,
color:"#173177"
},
keyword2:{
value:key2,
color:"#173177"
},
keyword3:{
value:key3,
color:"#173177"
},
remark:{
value:remark,
color:"#173177"
}
}
}
logger.info "start send template message: #{data}"
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e
logger.error "[mailer] ===> #{e}"
end
logger.info "send over. #{req}"
end
end
end

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -16,6 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class Message < ActiveRecord::Base
require 'net/http'
require 'json'
include Redmine::SafeAttributes
include UserScoreHelper
include ApplicationHelper
@ -262,12 +265,14 @@ class Message < ActiveRecord::Base
self.course.members.each do |m|
if self.author.allowed_to?(:as_teacher, self.course) && m.user_id != self.author_id # 老师 自己的帖子不给自己发送消息
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
Wechat.api.topic_publish_template m.user_id, "#{l(:label_course_topic_template)}", self.subject, self.author.try(:realname), format_time(self.created_on)
end
end
else # 回帖
self.course.members.each do |m|
if m.user_id == Message.find(self.parent_id).author_id && m.user_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.board.course_id, :viewed => false)
Wechat.api.comment_template m.user_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), self.content.html_safe
end
end
end
@ -276,12 +281,14 @@ class Message < ActiveRecord::Base
self.project.members.each do |m|
if m.user_id != self.author_id
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
Wechat.api.topic_publish_template m.user_id, "#{l(:label_project_topic_template)}", self.subject, self.author.try(:realname), format_time(self.created_on)
end
end
else # 回帖
self.project.members.each do |m|
if m.user_id == Message.find(self.parent_id).author_id && m.user_id != self.author_id # 只针对主贴回复,回复自己的帖子不发消息
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.board.project_id, :viewed => false)
Wechat.api.comment_template m.user_id, "#{l(:label_topic_comment_template)}", self.author.try(:realname), format_time(self.created_on), self.content.html_safe
end
end
end

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -16,6 +17,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class News < ActiveRecord::Base
require 'net/http'
require 'json'
include Redmine::SafeAttributes
belongs_to :project,:touch => true
include ApplicationHelper
@ -167,6 +170,7 @@ class News < ActiveRecord::Base
self.course.members.each do |m|
if m.user_id != self.author_id
self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
Wechat.api.message_update_template m.user_id, "#{l(:label_new_notice_template)}", self.author.try(:realname) + " 发布了通知:" + self.title.html_safe, format_time(self.created_on)
end
end
else

View File

@ -2123,4 +2123,29 @@ zh:
label_resource_download_times: 下载次数
label_resource_upload_author: 上传者
label_resource_belongs_course: 所属课程
label_resource_belongs_project: 所属项目
label_resource_belongs_project: 所属项目
#微信模板消息
label_new_homework_template: 您的课程有新作业了
label_update_homework_template: 您的作业已被修改
label_course_topic_template: 课程问答区有新帖子发布了
label_topic_comment_template: 您的帖子有新回复了
label_project_topic_template: 项目讨论区有新帖子发布了
label_issue_comment_template: 您的缺陷有新回复了
label_notice_comment_template: 您的课程通知有新回复了
label_news_comment_template: 您的项目新闻有新回复了
label_homework_comment_template: 您的作业有新回复了
label_new_journals_template: 您有新留言了
label_journals_comment_template: 您的留言有新回复了
label_blog_comment_template: 您的博客有新回复了
label_new_blog_template: 您的课程有新作业了
label_new_issue_template: 您有新缺陷了
label_new_notice_template: 您的课程有新通知了
label_resource_name: 您的课程有新作业了
label_resource_name: 您的课程有新作业了
label_resource_name: 您的课程有新作业了
label_resource_name: 您的课程有新作业了
label_resource_name: 您的课程有新作业了
label_resource_name: 您的课程有新作业了

View File

@ -13,7 +13,7 @@ button:
-
type: "view"
name: "进入网站"
url: "http://www.trustie.net/"
url: "https://www.trustie.net/"
-
type: "view"
name: "使用手册"

View File

@ -9,7 +9,11 @@
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="post-title hidden">
<a herf="javascript:void(0);" class="mr10">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>

View File

@ -3,12 +3,11 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{blog.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{blog.title}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{blog.user.realname}}</a>发表博客</div>
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{blog.title}}</span></div>
<div class="post-title"><a herf="javascript:void(0);" class="mr10">{{blog.user.realname}}</a>发表博客</div>
<div class="cl"></div>
<div class="post-content" style="height:auto;">
<div class="post-all-content c-grey2 mt10" ng-bind-html="blog.content|safeHtml"></div>
<div class="post-all-content c-grey3 mt10" ng-bind-html="blog.content|safeHtml"></div>
</div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{blog.created_at}}</span>
@ -36,7 +35,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addBlogReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -3,11 +3,16 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{discussion.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{discussion.user.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程问答区</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10" style="height:auto;">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程问答区</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
</div>
<div class="cl"></div>
@ -36,7 +41,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addDiscussionReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -3,11 +3,16 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{news.author.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{news.title}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{news.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{news.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程通知</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10" style="height:auto;">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{news.title}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{news.author.realname}}</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{news.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程通知</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="news.description|safeHtml"></div>
</div>
<div class="cl"></div>
@ -36,7 +41,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addNoticeReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -3,14 +3,23 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{homework.author.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{homework.name}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{homework.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{homework.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程作业</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="homework.description|safeHtml"></div>
<span class="mr15">迟交扣分:{{homework.late_penalty}}分</span> 匿评开启时间:{{homework.evaluation_start}}<br />
<span class="mr15">缺评扣分:{{homework.absence_penalty}}分/作品</span> 匿评关闭时间:{{homework.evaluation_end}}
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{homework.name}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>
<span ng-if="homework.author.realname != ' '">{{homework.author.realname}}</span>
<span ng-if="homework.author.realname == ' '">{{homework.author.nickname}}</span></td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{homework.course_name}}&nbsp;&nbsp;|&nbsp;&nbsp;课程作业</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content mb10" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey">迟交扣分:{{homework.late_penalty}}分<br/>
缺评扣分:{{homework.absence_penalty}}分/作品<br />
匿评开启时间:{{homework.evaluation_start}}<br />
匿评关闭时间:{{homework.evaluation_end}}</span>
</div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{homework.publish_time}}</span>
@ -38,7 +47,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addHomeworkReply(formData)" value="回复" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -3,14 +3,21 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{issue.author.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{issue.subject}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{issue.author.realname}}</a>to<span class="ml10">{{issue.project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目缺陷</span></div>
<div class="cl"></div>
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{issue.subject}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{issue.author.realname}}</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{issue.project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目缺陷</td>
</tr></table>
<div class="post-content" style="height:auto;">
<div class="post-all-content c-grey2 mt10" ng-bind-html="issue.description|safeHtml"></div>
<span class="mr15">状态:{{issue.issue_status}}</span> <span class="mr15">优先级:{{issue.issue_priority}}</span> <br />
<span class="mr15">指派给:{{issue.issue_assigned_to}}</span> <span class="mr15">完成度:{{issue.done_ratio}}%</span>
<div class="post-all-content c-grey3 mt10 mb10" ng-bind-html="issue.description|safeHtml"></div>
<span class="c-grey">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}<br>
优先级:{{issue.issue_priority}}<br />
指派给:{{issue.issue_assigned_to}}<br />
完成度:{{issue.done_ratio}}%</span>
</div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{issue.created_on}}</span>
@ -38,7 +45,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addIssueReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -2,9 +2,8 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{message.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10">{{message.user.realname}}</a><span style="vertical-align:top;">给您留言了</span><br /></div>
<div class="post-title hidden">{{message.created_on}}</div>
<div class="post-title mb5"><a herf="javascript:void(0);" class="mr10">{{message.user.realname}}</a><span style="vertical-align:top;">给您留言了</span><br /></div>
<div class="post-title">{{message.created_on}}</div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="message.notes|safeHtml"></div>
@ -34,7 +33,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addJournalReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -3,11 +3,16 @@
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl"><img ng-src="{{discussion.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{discussion.user.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目讨论区</a></div>
<div class="cl"></div>
<div class="post-content c-grey2 mt10" style="height:auto;">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span></div>
<table class="post-detail-info"><tr>
<td class="text-nowrap v-top">发布者:</td>
<td>{{discussion.user.realname}}</td>
</tr>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;源:</td>
<td>{{discussion.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;项目讨论区</td>
</tr></table>
<div class="post-content c-grey3 mt10" style="height:auto;">
<div class="post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
</div>
<div class="cl"></div>
@ -36,7 +41,9 @@
<div class="post-input-wrap">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
<div class="post-input-container">
<input type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" />
</div>
<button ng-click="addDiscussionReply(formData)" class="post-reply-submit fr mt10">回复</button>
<div class="cl"></div>
</div>

View File

@ -10,7 +10,7 @@ app.factory('auth', function($http,$routeParams, $cookies, $q){
var _openid = '';
if(debug===true){
_openid = "oCnvgvz8R7QheXE-R9Kkr39j8Ndg";
_openid = "2";
}
var getOpenId = function() {

View File

@ -33,6 +33,8 @@ a.underline {text-decoration:underline;}
.hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
.inline-block {display:inline-block;}
.undis {display:none;}
.text-nowrap {white-space:nowrap;}
.v-top {vertical-align:top;}
/*动态样式*/
.post-container {width:100%;}
@ -40,6 +42,7 @@ a.underline {text-decoration:underline;}
.post-main {padding:10px; color:#9a9a9a;}
.post-avatar {width:45px; height:45px; margin-right:10px;}
.post-title {font-size:13px; text-align:left;}
.post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;}
.fl {float:left;}
.fr {float:right;}
.cl {clear:both; overflow:hidden;}
@ -59,5 +62,6 @@ a.underline {text-decoration:underline;}
.post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden;}
.post-reply-date {font-size:13px;}
.post-reply-trigger {font-size:13px;}
.post-reply-input {width:100%; height:28px; line-height:28px; border:1px solid #e6e6e6; outline:none; border-radius:3px;}
.post-input-container {padding-right:2px;}
.post-reply-input {width:100%; height:28px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px;}
.post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;}