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

This commit is contained in:
huang 2016-09-02 16:51:23 +08:00
commit 7b6657a3e6
19 changed files with 111 additions and 16 deletions

View File

@ -331,7 +331,7 @@ class CoursesController < ApplicationController
@all_members = searchTeacherAndAssistant(@course) @all_members = searchTeacherAndAssistant(@course)
@members = @all_members @members = @all_members
when '2' when '2'
if @course.open_student == 1 || User.current.member_of_course?(@course) if @course.open_student == 1 || User.current.member_of_course?(@course) || User.current.admin?
@subPage_title = l :label_student_list @subPage_title = l :label_student_list
page = params[:page].nil? ? 0 : (params['page'].to_i - 1) page = params[:page].nil? ? 0 : (params['page'].to_i - 1)
@all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type) @all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type)

View File

@ -196,8 +196,9 @@ class IssuesController < ApplicationController
priority_id = params[:issue][:priority_id] priority_id = params[:issue][:priority_id]
ps = ProjectsService.new ps = ProjectsService.new
if senduser.id != User.current.id
ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
end
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue}) call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format| respond_to do |format|
format.html { format.html {

View File

@ -115,7 +115,7 @@
<%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%> <%= link_to content.html_safe, { :controller=> "my",:action => "account", :flag => 1, :applied_message_id => ma.id }, :title => "系统提示:“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
</li> </li>
<% end %> <% end %>
<% elsif ma.class == ForgeMessage && ma.forge_message %> <% elsif ma.class == ForgeMessage %>
<% if ma.forge_message_type == "AppliedProject" %> <% if ma.forge_message_type == "AppliedProject" %>
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li> <li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
<% elsif ma.forge_message_type == "JoinProject" %> <% elsif ma.forge_message_type == "JoinProject" %>
@ -128,7 +128,7 @@
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li> <li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %> <% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li> <li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
<% elsif ma.forge_message_type == "Journal" %> <% elsif ma.forge_message_type == "Journal" && ma.forge_message %>
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li> <li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
<% elsif ma.forge_message_type == "Message" %> <% elsif ma.forge_message_type == "Message" %>
<li><a href="<%=board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li> <li><a href="<%=board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>

View File

@ -1,4 +1,4 @@
<% if ma.class == ForgeMessage && ma.forge_message %> <% if ma.class == ForgeMessage %>
<!--申请加入项目--> <!--申请加入项目-->
<% if ma.forge_message_type == "AppliedProject" %> <% if ma.forge_message_type == "AppliedProject" %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
@ -130,7 +130,7 @@
</ul> </ul>
<% end %> <% end %>
<% end %> <% end %>
<% if ma.forge_message_type == "Journal" %> <% if ma.forge_message_type == "Journal" && ma.forge_message %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"> <li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a> <a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user), :target => '_blank' %></a>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="blog.act_type == 'BlogComment'"> <div ng-if="blog.act_type == 'BlogComment'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="discussion.act_type == 'Message'"> <div ng-if="discussion.act_type == 'Message'">
<div class="post-container"> <div class="post-container">
<div loading-spinner></div> <div loading-spinner></div>

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="news.act_type == 'News'"> <div ng-if="news.act_type == 'News'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="homework.act_type == 'HomeworkCommon'"> <div ng-if="homework.act_type == 'HomeworkCommon'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="issue.act_type == 'Issue'"> <div ng-if="issue.act_type == 'Issue'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">

View File

@ -1,5 +1,13 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="message.act_type == 'JournalsForMessage'"> <div ng-if="message.act_type == 'JournalsForMessage'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">

View File

@ -1,6 +1,14 @@
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<div loading-spinner></div> <div loading-spinner></div>
<div ng-show="showtip">
<div class="blue-title">提示</div>
<div class="ac-wrap">
<ul class="ac-content f13 c-grey3">
<li class="mt30 mb15">啊哦,您来晚了,内容已经被删除了</li>
</ul>
</div>
</div>
<div ng-if="discussion.act_type == 'Message'"> <div ng-if="discussion.act_type == 'Message'">
<div class="post-container"> <div class="post-container">
<div class="post-wrapper" style="margin-top:0;"> <div class="post-wrapper" style="margin-top:0;">

View File

@ -11,6 +11,11 @@ app.controller('BlogController',
loadCallback: function(data){ loadCallback: function(data){
console.log(data.data); console.log(data.data);
if(data.status == -1){
$scope.showtip = true;
return;
}
//回复级别 0 一级回复 1 二级回复 //回复级别 0 一级回复 1 二级回复
replytype = data.type; replytype = data.type;
page = data.page; page = data.page;

View File

@ -10,6 +10,11 @@ app.controller('CourseNoticeController', ['$scope', '$http', '$routeParams', 'au
loadCallback: function(data){ loadCallback: function(data){
console.log(data.data); console.log(data.data);
if(data.status == -1){
$scope.showtip = true;
return;
}
//回复级别 0 一级回复 1 二级回复 //回复级别 0 一级回复 1 二级回复
replytype = data.type; replytype = data.type;
page = data.page; page = data.page;

View File

@ -9,6 +9,11 @@ app.controller('DiscussionController', ['$scope', '$http', '$routeParams', 'auth
loadCallback: function(data){ loadCallback: function(data){
console.log(data.data); console.log(data.data);
if(data.status == -1){
$scope.showtip = true;
return;
}
//回复级别 0 一级回复 1 二级回复 //回复级别 0 一级回复 1 二级回复
replytype = data.type; replytype = data.type;
page = data.page; page = data.page;

View File

@ -9,6 +9,11 @@ app.controller('HomeworkController', ['$scope', '$http', '$routeParams', 'auth',
loadCallback: function(data){ loadCallback: function(data){
console.log(data.data); console.log(data.data);
if(data.status == -1){
$scope.showtip = true;
return;
}
//回复级别 0 一级回复 1 二级回复 //回复级别 0 一级回复 1 二级回复
replytype = data.type; replytype = data.type;
page = data.page; page = data.page;

View File

@ -9,6 +9,11 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c
loadCallback: function(data){ loadCallback: function(data){
console.log(data.data); console.log(data.data);
if(data.status == -1){
$scope.showtip = true;
return;
}
//回复级别 0 一级回复 1 二级回复 //回复级别 0 一级回复 1 二级回复
replytype = data.type; replytype = data.type;
page = data.page; page = data.page;

View File

@ -8,6 +8,11 @@ app.controller('JournalsController', ['$scope', '$http', '$routeParams', 'auth',
loadCallback: function(data){ loadCallback: function(data){
console.log(data.data); console.log(data.data);
if(data.status == -1){
$scope.showtip = true;
return;
}
//回复级别 0 一级回复 1 二级回复 //回复级别 0 一级回复 1 二级回复
replytype = data.type; replytype = data.type;
page = data.page; page = data.page;

View File

@ -9,22 +9,26 @@ app.directive('iphoneRecognize',["$timeout",function(timer){
timer(function(){ timer(function(){
var contentHeight = $(".post-container").height(); var contentHeight = $(".post-container").height();
var toBottom = function(){ var toBottom = function(){
element.css({"position":"relative","padding":"1px 0"}); element.css({"position":"absolute","padding":"1px 0","marginBottom":"-50px"});
$(".post-wrapper").css("marginBottom","0"); $(".post-wrapper").css({"marginBottom":"0","position":"relative"});
$("#all_homework_reply").css("marginBottom","0"); $("#all_homework_reply,#all_blog_reply,#all_course_message_reply,#all_message_reply").css("marginBottom","0");
window.scrollTo(0,contentHeight); window.scrollTo(0,contentHeight)
}; };
if (/ipad|iphone|mac/i.test(navigator.userAgent)){ if (/ipad|iphone|mac/i.test(navigator.userAgent)){
$("#postInput1").bind('focus',function(){ $("#postInput1").bind('focus',function(){
setTimeout(function(){
toBottom(); toBottom();
},200);
}); });
$("#postInput1,#replyBlock").bind("click",function(){ $("#postInput1,#replyBlock").bind("click",function(){
setTimeout(function(){
toBottom(); toBottom();
},200);
}); });
$("#postInput1").bind('blur',function(){ $("#postInput1").bind('blur',function(){
element.css("position","fixed"); element.css({"position":"fixed","marginBottom":"0"});
$(".post-wrapper").css("marginBottom","10px"); $(".post-wrapper").css({"marginBottom":"10px","position":""});
$("#all_homework_reply").css("marginBottom","50px"); $("#all_homework_reply,#all_blog_reply,#all_course_message_reply,#all_message_reply").css("marginBottom","52px");
}); });
} }
}) })

View File

@ -226,6 +226,10 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
var loadData = function(id,replytype,page){ var loadData = function(id,replytype,page){
loadCommonData(id, args.type,replytype,page).then(function successCallback(response) { loadCommonData(id, args.type,replytype,page).then(function successCallback(response) {
console.log(response.data); console.log(response.data);
if(response.data.status == -1){
args.loadCallback(response.data);
return;
}
//--------------分享内容定制------------- //--------------分享内容定制-------------
var tmptile = "分享动态"; var tmptile = "分享动态";
var imgUrl = ""; var imgUrl = "";