Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange

This commit is contained in:
guange 2016-07-07 14:35:26 +08:00
commit a17a6ed596
14 changed files with 647 additions and 231 deletions

View File

@ -10,30 +10,44 @@ module Mobile
params do
requires :page, type: Integer
requires :token, type: String
requires :container_type, type: String
end
post do
authenticate!
user = current_user
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id)
container_type = params[:container_type] ? params[:container_type] : "All"
if container_type == "All" || container_type == "Project"
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Project'").map(&:shield_id)
user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")"
project_types = "('Message','Issue','Project')"
end
if container_type == "All" || container_type == "Course"
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{user.id} and shield_type='Course'").map(&:shield_id)
user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
end
page = params[:page] ? params[:page] : 0
user_project_ids = (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (user.projects.where("status = 1").map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (user.courses.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage"
watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(','))
user_ids = "(" + user.id.to_s + watched_user_ids + ")"
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
blog_ids = "(" + watched_user_blog_ids + ")"
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc')
if container_type == "Course"
activities = UserActivity.where("(container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('updated_at desc')
elsif container_type == "Project"
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})").order('updated_at desc')
else
activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})").order('updated_at desc')
end
all_count = activities.count
activities = activities.limit(10).offset(page * 10)
count = activities.count
@ -42,6 +56,7 @@ module Mobile
present :count, count
present :page, page
present :status, 0
present :container_type, container_type
end
end
end

View File

@ -14,6 +14,10 @@ class SyllabusesService
courses.each do |c|
other.courses << c[:course] unless c[:course].syllabus
end
user.syllabuses.each do |syllabus|
syllabus.courses = syllabus.courses.not_deleted
end
user.syllabuses.to_a << other
end
@ -45,6 +49,7 @@ class SyllabusesService
c.tea_id = user.id
c.syllabus_id = sy.id
c.update_default_value
c.is_public = 0
c.save!
after_create_course(c, user)
end

View File

@ -6,14 +6,19 @@
<div class="class-detail-name">我的动态</div>
<!--<div class="tab-wrap">-->
<!--<a id="class_tab_1" href="javascript:void(0);" class="weixin-tab class-tab-active" ng-click="HoverLi(1)">所有动态<span id="tab_arrow_1" class="tab-active-arrow"></span></a>-->
<!--<a id="class_tab_2" href="javascript:void(0);" class="weixin-tab" ng-click="HoverLi(2)">课程动态<span id="tab_arrow_2" class="tab-active-arrow undis"></span></a>-->
<!--<a id="class_tab_3" href="javascript:void(0);" class="weixin-tab" ng-click="HoverLi(3)">项目动态<span id="tab_arrow_3" class="tab-active-arrow undis"></span></a>-->
<!--</div>-->
<div class="tab-wrap">
<a id="class_tab_1" href="javascript:void(0);" class="weixin-tab class-tab-active" onclick="HoverLi(1);">所有动态<span id="tab_arrow_1" class="tab-active-arrow"></span></a>
<a id="class_tab_2" href="javascript:void(0);" class="weixin-tab" onclick="HoverLi(2);">课程动态<span id="tab_arrow_2" class="tab-active-arrow undis"></span></a>
<a id="class_tab_3" href="javascript:void(0);" class="weixin-tab" onclick="HoverLi(3);">项目动态<span id="tab_arrow_3" class="tab-active-arrow undis"></span></a>
<a ng-click="tab($index+1)" ng-repeat="menu in menus" id="class_tab_1" href="javascript:void(0);" ng-class="['weixin-tab', {'class-tab-active': currentTab == $index+1}]">{{menu}}</a>
</div>
<div ng-repeat="act in activities">
<div ng-if="act.container_type=='Course'">
<div ng-class="{'undis': currentTab!=1}">
<div ng-repeat="act in activities">
<div ng-if="act.container_type=='Course' ">
<div ng-if="act.act_type=='HomeworkCommon'">
<div class="post-container">
<div class="post-wrapper">
@ -140,7 +145,7 @@
</div>
</div>
<div ng-if="act.container_type=='Project'">
<div ng-if="act.container_type=='Project' ">
<div ng-if="act.act_type=='Issue'">
<div class="post-container">
<div class="post-wrapper">
@ -230,7 +235,7 @@
</div>
</div>
<div ng-if="act.container_type=='Principal'">
<div ng-if="act.container_type=='Principal' ">
<div ng-if="act.act_type=='JournalsForMessage'">
<div class="post-container">
<div class="post-wrapper">
@ -268,7 +273,7 @@
</div>
</div>
<div ng-if="act.act_type=='BlogComment'">
<div ng-if="act.act_type=='BlogComment' ">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
@ -306,10 +311,242 @@
</div>
</div>
<div ng-if="has_more">
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
<div ng-if="has_more">
<div id="more_activities" class="more-events mt10" ng-click="loadActData(1,page+1);">更多</div>
</div>
</div>
<div ng-class="{'undis': currentTab!=2}">
<div ng-repeat="act in course_activities">
<div ng-if="act.container_type=='Course' ">
<div ng-if="act.act_type=='HomeworkCommon'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('homework',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【作业】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评开启时间:{{act.homework_common_detail.evaluation_start}}</span><br />
<span ng-if="!act.homework_common_detail.anonymous_comment" class="mr15 f13 c-grey2">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> <span ng-if="!act.homework_common_detail.anonymous_comment" class="f13 c-grey2">匿评关闭时间:{{act.homework_common_detail.evaluation_end}}</span>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('homework',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='News'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('course_notice',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【通知】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_notice',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('course_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<!--<a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more mr20 undis" text-auto-height>点击展开</a>-->
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('course_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Course'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 课程</span></div>
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-if="course_has_more">
<div id="more_course_activities" class="more-events mt10" ng-click="loadActData(2,course_page+1);">更多</div>
</div>
</div>
<div ng-class="{'undis': currentTab!=3}">
<div ng-repeat="act in project_activities">
<div ng-if="act.container_type=='Project' ">
<div ng-if="act.act_type=='Issue'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('issues',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15 f13 c-grey2">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15 f13 c-grey2">优先级:{{act.issue_detail.issue_priority}}</span> <br />
<span class="mr15 f13 c-grey2">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15 f13 c-grey2">完成度:{{act.issue_detail.done_ratio}}%</span>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('issues',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div dataID = "{{act.act_id}}" ng-click="goDetail('project_discussion',act.act_id, act.id)" id="act_{{act.id}}">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
<img ng-if="act.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="act.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{act.latest_update}}</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 hidden mt12 fb">【帖子】{{act.subject|safeHtml}}</div>
<div class="post-content c-grey3 mt10 mb10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div>
<div class="cl"></div>
</div>
<div class="post-dynamic-from hidden fl c-grey3">来源: <span class="c-blue">{{act.course_project_name}}</span></div>
<div class="fr f13">
<div ng-if="!act.praise_count" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
<div ng-if="act.has_praise" ng-click="decreasePraise(act);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{act.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="act.reply_count" ng-click="goDetail('project_discussion',act.act_id, act.id)"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{act.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<div ng-if="act.act_type=='Project'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-main">
<div class="post-avatar fl mr10"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}} | 项目</span></div>
<div class="post-title hidden"><span class="mr10">{{act.latest_update}}</span></div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div ng-if="project_has_more">
<div id="more_project_activities" class="more-events mt10" ng-click="loadActData(3,project_page+1);">更多</div>
</div>
</div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible"></my-alert>
</div>

View File

@ -3,47 +3,64 @@
<div loading-spinner></div>
<div ng-if="blog.act_type == 'BlogComment'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-wrapper" style="margin-top:0;">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{blog.title}}</span><img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="post-title"><a herf="javascript:void(0);" class="mr10">{{blog.user.realname}}</a>发表博客</div>
<div class="post-avatar fl mr10"><img ng-src="{{blog.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{blog.user.realname}}
<img ng-if="blog.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="blog.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{blog.title}}<img ng-if="blog.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt10"><span class="mr10">博客</span><span>{{blog.created_at}}</span></div>
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="blog.content|safeHtml"></div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{blog.created_at}}</span>
<div class="fr f13">
<div ng-if="!blog.praise_count" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="blog.praise_count && !blog.has_praise" ng-click="addPraise(blog);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
<div ng-if="blog.has_praise" ng-click="decreasePraise(blog);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{blog.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="blog.comment_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{blog.comment_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{blog.comment_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="blog.has_praise" ng-click="decreasePraise(blog);">已赞 ({{blog.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!blog.has_praise" ng-click="addPraise(blog);">赞 ({{blog.praise_count}})</div>
</div>
<div id="all_blog_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in blog.blog_comment_children">
<div ng-if="blog.blog_comment_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in blog.blog_comment_children">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
<div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{journal.user.realname}}
<img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div ng-if="!blog.locked" id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div>
</div>
</div>
<div ng-if="!blog.locked" 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>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>

View File

@ -3,8 +3,8 @@
<div class="blue-title">课程列表</div>
<div ng-repeat="syllabus in syllabuses">
<div class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" width="15" class="fl ml10 mt11 retract-btn undis" /><span class="fl ml10">{{syllabus.title}}</span><img src="/images/wechat/setting.png" width="15" class="fr mr10 mt10" ng-click="onSetting(syllabus)" /></div>
<ul class="class-list f13 c-grey3">
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">{{syllabus.title}}</span><img src="/images/wechat/setting.png" width="15" class="fr mr10 mt10" ng-click="onSetting(syllabus)" /></div>
<ul ng-show="!syllabus.show_plus" class="class-list f13 c-grey3">
<li ng-click="goClass(course.id)" ng-repeat="course in syllabus.courses" ng-class="{'border-bottom-none': $last}">
<img src="/images/wechat/dot.png" width="15px" class="class-list-dot" />
<span class="fl ml10 class-list-name hidden">{{course.name}}</span>

View File

@ -6,19 +6,15 @@
<div loading-spinner></div>
<div class="post-wrapper" style="margin-top:0;">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></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="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="post-avatar fl mr10"><img ng-src="{{discussion.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{discussion.user.realname}}
<img ng-if="discussion.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="discussion.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{discussion.subject}}</div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{discussion.course_project_name}}-课程问答区</span><span>{{discussion.created_on}}</span></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{discussion.course_project_name}} - 课程问答区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div>
<div class="fr f13">
@ -33,7 +29,7 @@
<div class="cl"></div>
</div>
<div id="all_course_message_reply">
<div ng-if="news.comments == ''" style="border-top:1px solid #ccc;"></div>
<div ng-if="discussion.message_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in discussion.message_children">
<div class="post-reply-row">
<div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>

View File

@ -13,7 +13,7 @@
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{news.title}}</div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{news.course_name}}-课程通知</span><span>{{news.created_on}}</span></div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{news.course_name}} - 课程通知</span><span>{{news.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="news.description|safeHtml"></div>
<div class="cl"></div>
<div class="fr f13">

View File

@ -3,67 +3,66 @@
<div loading-spinner></div>
<div ng-if="homework.act_type == 'HomeworkCommon'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-wrapper" style="margin-top:0;">
<div class="post-main">
<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>
<tr>
<td class="text-nowrap v-top">&nbsp;&nbsp;&nbsp;别:</td>
<td><span ng-if="homework.homework_type == 1">普通作业</span>
<span ng-if="homework.homework_type == 2">编程作业</span>
<span ng-if="homework.homework_type == 3">分组作业</span>
</td>
</tr>
</table>
<div class="post-avatar fl mr10"><img ng-src="{{homework.author.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{homework.author.realname}}
<img ng-if="homework.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="homework.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{homework.name}}</div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{homework.course_name}} - <span ng-if="homework.homework_type == 1">普通作业</span><span ng-if="homework.homework_type == 2">编程作业</span><span ng-if="homework.homework_type == 3">分组作业</span></span><span>{{homework.publish_time}}</span></div>
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="homework.description|safeHtml"></div>
<span class="c-grey f13">迟交扣分:{{homework.late_penalty}}分</span><br/>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品<br /></span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评开启时间:{{homework.evaluation_start}}<br /></span>
<span class="c-grey f13 mr15">迟交扣分:{{homework.late_penalty}}分</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">缺评扣分:{{homework.absence_penalty}}分/作品</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13 mr15">匿评开启时间:{{homework.evaluation_start}}</span>
<span ng-if="!homework.anonymous_comment" class="c-grey f13">匿评关闭时间:{{homework.evaluation_end}}</span>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{homework.publish_time}}</span>
<div class="fr f13">
<div ng-if="!homework.praise_count" ng-click="addPraise(homework);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="homework.praise_count && !homework.has_praise" ng-click="addPraise(homework);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{homework.praise_count}}</span></div>
<div ng-if="homework.has_praise" ng-click="decreasePraise(homework);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{homework.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!homework.whomework_journal_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="homework.whomework_journal_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{homework.whomework_journal_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{homework.whomework_journal_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="homework.has_praise" ng-click="decreasePraise(homework);">已赞 ({{homework.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!homework.has_praise" ng-click="addPraise(homework);">赞 ({{homework.praise_count}})</div>
</div>
<div id="all_homework_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in homework.journals_for_messages">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
<div ng-if="homework.journals_for_messages == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in homework.journals_for_messages">
<div class="post-reply-row">
<div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{journal.user.realname}}
<img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="post-input-wrap">
<div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>

View File

@ -3,57 +3,66 @@
<div loading-spinner></div>
<div ng-if="issue.act_type == 'Issue'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-wrapper" style="margin-top:0;">
<div class="post-main">
<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-avatar fl mr10"><img ng-src="{{issue.author.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{issue.author.realname}}
<img ng-if="issue.author.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="issue.author.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{issue.subject}}</div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{issue.project_name}} - 项目问题</span><span>{{issue.created_on}}</span></div>
<div class="f13 c-grey3 mt10 mb10 text-control post-all-content" ng-bind-html="issue.description|safeHtml"></div>
<span class="c-grey f13">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}<br>
优先级:{{issue.issue_priority}}<br />
指派给:{{issue.issue_assigned_to}}<br />
完成度:{{issue.done_ratio}}%</span>
<span class="c-grey f13 mr15">&nbsp;&nbsp;&nbsp;态:{{issue.issue_status}}</span>
<span class="c-grey f13">优先级:{{issue.issue_priority}}</span><br/>
<span class="c-grey f13 mr15">指派给:{{issue.issue_assigned_to}}</span>
<span class="c-grey f13">完成度:{{issue.done_ratio}}%</span>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{issue.created_on}}</span>
<div class="fr f13">
<div ng-if="!issue.praise_count" ng-click="addPraise(issue);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="issue.praise_count && !issue.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{issue.praise_count}}</span></div>
<div ng-if="issue.has_praise" ng-click="decreasePraise(issue);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{issue.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!issue.journals_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="issue.journals_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{issue.journals_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{issue.journals_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="issue.has_praise" ng-click="decreasePraise(issue);">已赞 ({{issue.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!issue.has_praise" ng-click="addPraise(issue);">赞 ({{issue.praise_count}})</div>
</div>
<div id="all_issue_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in issue.issue_journals">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<div class="post-reply-date fl">{{journal.created_on}}</div>
<div class="post-reply-trigger fr undis">回复</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<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>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
<div ng-if="issue.issue_journals == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in issue.issue_journals">
<div class="post-reply-row">
<div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{journal.user.realname}}
<img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
<div class="post-dynamic-time fr f13">{{journal.created_on}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -2,46 +2,63 @@
<div loading-spinner></div>
<div ng-if="message.act_type == 'JournalsForMessage'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-wrapper" style="margin-top:0;">
<div class="post-main">
<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="post-avatar fl mr10"><img ng-src="{{message.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{message.user.realname}}
<img ng-if="message.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="message.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="c-grey4 f13 mt10"><span class="mr10">留言</span><span>{{message.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control" ng-bind-html="message.notes|safeHtml"></div>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{message.reply_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="message.has_praise" ng-click="decreasePraise(message);">已赞 ({{message.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!message.has_praise" ng-click="addPraise(message);">赞 ({{message.praise_count}})</div>
<div class="fr f13">
<div ng-if="!message.praise_count" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="message.praise_count && !message.has_praise" ng-click="addPraise(message);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{message.praise_count}}</span></div>
<div ng-if="message.has_praise" ng-click="decreasePraise(message);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{message.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!message.reply_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="message.reply_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{message.reply_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div id="all_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in message.child_reply">
<div ng-if="message.child_reply == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in message.child_reply">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.notes|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
<div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{journal.user.realname}}
<img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.notes|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div>
</div>
</div>
<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>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
</div>
<button ng-click="addReply(formData)" ng-hide="formData.disabled" ng-disabled="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>

View File

@ -3,51 +3,58 @@
<div loading-spinner></div>
<div ng-if="discussion.act_type == 'Message'">
<div class="post-container">
<div class="post-wrapper">
<div class="post-wrapper" style="margin-top:0;">
<div class="post-main">
<div class="post-title mb5"><span class="c-grey3 f15 fb">{{discussion.subject}}</span><img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></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-avatar fl mr10"><img ng-src="{{discussion.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{discussion.user.realname}}
<img ng-if="discussion.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="discussion.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="cl"></div>
<div class="post-dynamic-title c-grey3 mt12 fb">{{discussion.subject}}<img ng-if="discussion.locked" src="/images/locked.png" style="display:inline-block;" /></div>
<div class="c-grey4 f13 mt10"><span class="mr10">{{discussion.course_project_name}} - 项目讨论区</span><span>{{discussion.created_on}}</span></div>
<div class="f13 c-grey3 mt10 text-control post-all-content" ng-bind-html="discussion.content|safeHtml"></div>
<div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{discussion.created_on}}</span>
<div class="fr f13">
<div ng-if="!discussion.praise_count" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span></span></div>
<div ng-if="discussion.praise_count && !discussion.has_praise" ng-click="addPraise(discussion);"><img src="/images/wechat/w_praise.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
<div ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);"><img src="/images/wechat/w_praised.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span>{{discussion.praise_count}}</span></div>
</div>
<div class="fr mr25 f13">
<a ng-if="!discussion.replies_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">回复</span></a>
<a ng-if="discussion.replies_count"><img src="/images/wechat/w_reply.png" width="20" style="vertical-align:top; margin-top:2px;" class="mr5" /><span style="vertical-align:top;">{{discussion.replies_count}}</span></a>
</div>
<div class="cl"></div>
</div>
<div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div>
<div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children">
<div ng-if="discussion.message_children == ''" style="border-top:1px solid #ccc;"></div>
<div class="post-reply-wrap" ng-repeat="journal in discussion.message_children">
<div class="post-reply-row">
<div class="post-reply-avatar fl"><img ng-src="{{journal.user.img_url}}" width="45" height="45" class="border-radius" /></div>
<div class="ml55">
<div class="post-reply-user hidden">{{journal.user.realname}}</div>
<div class="post-reply-content c-grey2 mb10" ng-bind-html="journal.content|safeHtml"></div>
<div class="post-reply-date fl">{{journal.lasted_comment}}</div>
<div class="post-reply-trigger fr undis">回复</div>
<div class="post-avatar fl mr10"><img ng-src="{{journal.user.img_url}}" width="30" height="30" class="border-radius img-circle" /></div>
<div class="post-dynamic-author hidden fl">
{{journal.user.realname}}
<img ng-if="journal.user.gender == '0'" src="images/wechat/male.png" width="14" class="ml5" />
<img ng-if="journal.user.gender != '0'" src="images/wechat/female.png" width="14" class="ml5" />
</div>
<div class="post-dynamic-time fr f13">{{journal.lasted_comment}}</div>
<div class="cl"></div>
<div class="post-reply-content c-grey2 mt12" ng-bind-html="journal.content|safeHtml"></div>
<div class="cl"></div>
</div>
</div>
</div>
<div ng-if="!discussion.locked" class="post-input-wrap">
<div ng-if="!discussion.locked" id="post_input_1" class="post-input-wrap2">
<div class="post-reply-row">
<!--<div class="post-reply-avatar fl"><img src="images/post-avatar.jpg" width="30" height="30" /></div>-->
<div class="post-input-container">
<textarea class="copy-input"></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput" ng-model="formData.comment" /></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="formData.comment" placeholder="输入回复内容~" /></textarea>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>
</div>
<button ng-click="addReply(formData)" ng-disabled="formData.disabled" ng-hide="formData.disabled" class="post-reply-submit fr mt10">回复</button>
<button ng-disabled="formData.disabled" ng-hide="!formData.disabled" class="post-reply-submit bg-grey fr mt10">回复</button>
<div class="cl"></div>
</div>
</div>
</div>

View File

@ -3,10 +3,21 @@
<div loading-spinner></div>
<div class="blue-title">发送课程列表</div>
<div class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" width="15" class="fl ml10 mt11 spread-btn undis" /><img src="/images/wechat/minus.png" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">未命名课程</span></div>
<ul class="class-list f13 c-grey3">
<li ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>
</ul>
<div ng-repeat="syllabus in syllabuses">
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">{{syllabus.title}}</span></div>
<ul ng-show="!syllabus.show_plus" class="class-list f13 c-grey3">
<li ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in syllabus.courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>
</ul>
</div>
<!--<div class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" width="15" class="fl ml10 mt11 spread-btn undis" /><img src="/images/wechat/minus.png" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">未命名课程</span></div>-->
<!--<ul class="class-list f13 c-grey3">-->
<!--<li ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>-->
<!--</ul>-->
<div class="btn2 bg-blue" ng-click="sendToCourses()">发送</div>
<my-alert message="alertService.message" title="alertService.title" visible="alertService.visible" cb="alertService.cb"></my-alert>

View File

@ -6,6 +6,8 @@ app.controller('ActivityController',
return url;
};
$scope.menus = ['所有动态', '课程动态', '项目动态'];
$scope.alertService = alertService.create();
console.log("ActivityController load");
@ -13,33 +15,119 @@ app.controller('ActivityController',
$scope.activities = rms.get("activities") || [];
$scope.has_more = rms.get("has_more");
$scope.loadActData = function(page){
$scope.course_page = rms.get('course_page') || 0;
$scope.course_activities = rms.get("course_activities") || [];
$scope.course_has_more = rms.get("course_has_more");
$scope.project_page = rms.get('project_page') || 0;
$scope.project_activities = rms.get("project_activities") || [];
$scope.project_has_more = rms.get("project_has_more");
$scope.loadActData = function(index,page){
container_type = "All";
switch(index){
case 1:
container_type = "All";
$scope.page = page;
break;
case 2:
container_type = "Course";
$scope.course_page = page;
break;
case 3:
container_type = "Project";
$scope.project_page = page;
break;
}
$scope.page = page;
$http({
method: 'POST',
url: apiUrl+ "activities",
data: {token: auth.token(), page: page}
data: {token: auth.token(), page: page, container_type: container_type}
}).then(function successCallback(response) {
if(response.data.page >0) {
$scope.activities = $scope.activities.concat(response.data.data);
switch(response.data.container_type){
case "All":
$scope.activities = $scope.activities.concat(response.data.data);
break;
case "Course":
$scope.course_activities = $scope.course_activities.concat(response.data.data);
break;
case "Project":
$scope.project_activities = $scope.project_activities.concat(response.data.data);
break;
case 3:
}
} else {
$scope.activities = response.data.data;
switch(response.data.container_type){
case "All":
$scope.activities = response.data.data;
break;
case "Course":
$scope.course_activities = response.data.data;
break;
case "Project":
$scope.project_activities = response.data.data;
break;
case 3:
}
}
rms.save("activities", $scope.activities);
$scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('has_more', $scope.has_more);
rms.save('page', response.data.page);
switch(response.data.container_type){
case "All":
rms.save("activities", $scope.activities);
$scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('has_more', $scope.has_more);
rms.save('page', response.data.page);
break;
case "Course":
rms.save("course_activities", $scope.course_activities);
$scope.course_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('course_has_more', $scope.course_has_more);
rms.save('course_page', response.data.page);
break;
case "Project":
rms.save("project_activities", $scope.project_activities);
$scope.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('project_has_more', $scope.project_has_more);
rms.save('project_page', response.data.page);
break;
case 3:
}
console.log(response.data);
}, function errorCallback(response) {
});
};
$scope.tab = function(index){
$scope.currentTab = index;
switch(index){
//ALL
case 1:
if($scope.activities.length<=0){
$scope.loadActData(index,0);
}
break;
//Course
case 2:
if($scope.course_activities.length<=0){
$scope.loadActData(index,0);
}
break;
//Project
case 3:
if($scope.project_activities.length<=0){
$scope.loadActData(index,0);
}
break;
}
}
$scope.currentTab = 1;
if($scope.activities.length<=0){
$scope.loadActData(0);
$scope.loadActData(1,0);
} else {
$timeout(function(){
window.scrollTo(0, rms.get("yoffset"));

View File

@ -1,15 +1,23 @@
app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService){
app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService,rms){
var vm = $scope;
var send_id = $routeParams.id;
vm.alertService = alertService.create();
vm.courses = [];
// vm.courses = [];
vm.syllabuses = [];
var loadClassList = function () {
$http.get(config.apiUrl + "courses?token=" + auth.token() + "&per_page_count=10&page=1").then(
// $http.get(config.apiUrl + "courses?token=" + auth.token() + "&per_page_count=10&page=1").then(
// function (response) {
// console.log(response.data);
// vm.courses = response.data.data;
// }
// );
$http.get(config.apiUrl + "syllabuses?token=" + auth.token()).then(
function (response) {
console.log(response.data);
vm.courses = response.data.data;
vm.syllabuses = response.data.data;
rms.save('syllabuses', vm.syllabuses);
}
);
};
@ -24,11 +32,18 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
vm.sendToCourses = function(){
var course_ids = [];
for(var i in vm.courses){
if(vm.courses[i].checked){
course_ids.push(vm.courses[i].id);
for(var i in vm.syllabuses) {
for (var j in vm.syllabuses[i].courses) {
if (vm.syllabuses[i].courses[j].checked) {
course_ids.push(vm.syllabuses[i].courses[j].id);
}
}
}
if(course_ids.length <= 0){
vm.alertService.showMessage('提醒', '请先选择班级');
return;
}
$http.post(config.apiUrl + "resources/send", {
token: auth.token(), course_ids: course_ids, send_id: send_id