Merge branch 'weixin_guange' of https://git.trustie.net/jacknudt/trustieforge into weixin_guange
Conflicts: public/assets/wechat/join_project.html
This commit is contained in:
commit
7b6675ed6a
|
@ -85,7 +85,7 @@ module Mobile
|
||||||
#取二级回复的底楼层
|
#取二级回复的底楼层
|
||||||
parents_reply = []
|
parents_reply = []
|
||||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||||
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
|
if parents_reply.count > 0 && !opt[:bottom]
|
||||||
if opt[:type] == 1
|
if opt[:type] == 1
|
||||||
# opt[:bottom] = true
|
# opt[:bottom] = true
|
||||||
# parents_reply[opt[:page]..opt[:page]]
|
# parents_reply[opt[:page]..opt[:page]]
|
||||||
|
@ -104,9 +104,9 @@ module Mobile
|
||||||
#取二级回复的顶楼层
|
#取二级回复的顶楼层
|
||||||
parents_reply = []
|
parents_reply = []
|
||||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||||
if parents_reply.count >= 2 && !opt[:top]
|
if parents_reply.count > 2 && !opt[:top]
|
||||||
if opt[:type] == 1
|
if opt[:type] == 1
|
||||||
opt[:bottom] = true
|
opt[:top] = true
|
||||||
tStart = (opt[:page]-1)*5+2
|
tStart = (opt[:page]-1)*5+2
|
||||||
tEnd = (opt[:page])*5+2 - 1
|
tEnd = (opt[:page])*5+2 - 1
|
||||||
|
|
||||||
|
@ -125,6 +125,10 @@ module Mobile
|
||||||
parents_reply = parents_reply.reverse[0..1]
|
parents_reply = parents_reply.reverse[0..1]
|
||||||
parents_reply.reverse
|
parents_reply.reverse
|
||||||
end
|
end
|
||||||
|
elsif parents_reply.count == 2 && !opt[:top]
|
||||||
|
opt[:top] = true
|
||||||
|
parents_reply = parents_reply.reverse[0..0]
|
||||||
|
parents_reply.reverse
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
|
@ -101,7 +101,7 @@ module Mobile
|
||||||
elsif opt[:comment_type] == "homework"
|
elsif opt[:comment_type] == "homework"
|
||||||
parents_reply = get_reply_parents(parents_reply, f)
|
parents_reply = get_reply_parents(parents_reply, f)
|
||||||
end
|
end
|
||||||
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
|
if parents_reply.count > 0 && !opt[:bottom]
|
||||||
if opt[:type] == 1
|
if opt[:type] == 1
|
||||||
# opt[:bottom] = true
|
# opt[:bottom] = true
|
||||||
# parents_reply[opt[:page]..opt[:page]]
|
# parents_reply[opt[:page]..opt[:page]]
|
||||||
|
@ -125,9 +125,9 @@ module Mobile
|
||||||
elsif opt[:comment_type] == "homework"
|
elsif opt[:comment_type] == "homework"
|
||||||
parents_reply = get_reply_parents(parents_reply, f)
|
parents_reply = get_reply_parents(parents_reply, f)
|
||||||
end
|
end
|
||||||
if parents_reply.count >= 2 && !opt[:top]
|
if parents_reply.count > 2 && !opt[:top]
|
||||||
if opt[:type] == 1
|
if opt[:type] == 1
|
||||||
opt[:bottom] = true
|
opt[:top] = true
|
||||||
tStart = (opt[:page]-1)*5+2
|
tStart = (opt[:page]-1)*5+2
|
||||||
tEnd = (opt[:page])*5+2 - 1
|
tEnd = (opt[:page])*5+2 - 1
|
||||||
|
|
||||||
|
@ -146,6 +146,10 @@ module Mobile
|
||||||
parents_reply = parents_reply.reverse[0..1]
|
parents_reply = parents_reply.reverse[0..1]
|
||||||
parents_reply.reverse
|
parents_reply.reverse
|
||||||
end
|
end
|
||||||
|
elsif parents_reply.count == 2 && !opt[:top]
|
||||||
|
opt[:top] = true
|
||||||
|
parents_reply = parents_reply.reverse[0..0]
|
||||||
|
parents_reply.reverse
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
|
@ -92,7 +92,7 @@ module Mobile
|
||||||
#取二级回复的底楼层
|
#取二级回复的底楼层
|
||||||
parents_reply = []
|
parents_reply = []
|
||||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||||
if parents_reply.count > 0 && parents_reply.count != 2 && !opt[:bottom]
|
if parents_reply.count > 0 && !opt[:bottom]
|
||||||
if opt[:type] == 1
|
if opt[:type] == 1
|
||||||
# opt[:bottom] = true
|
# opt[:bottom] = true
|
||||||
# parents_reply[opt[:page]..opt[:page]]
|
# parents_reply[opt[:page]..opt[:page]]
|
||||||
|
@ -111,9 +111,9 @@ module Mobile
|
||||||
#取二级回复的顶楼层
|
#取二级回复的顶楼层
|
||||||
parents_reply = []
|
parents_reply = []
|
||||||
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
parents_reply = get_reply_parents_no_root(parents_reply, c)
|
||||||
if parents_reply.count >= 2 && !opt[:top]
|
if parents_reply.count > 2 && !opt[:top]
|
||||||
if opt[:type] == 1
|
if opt[:type] == 1
|
||||||
opt[:bottom] = true
|
opt[:top] = true
|
||||||
tStart = (opt[:page]-1)*5+2
|
tStart = (opt[:page]-1)*5+2
|
||||||
tEnd = (opt[:page])*5+2 - 1
|
tEnd = (opt[:page])*5+2 - 1
|
||||||
|
|
||||||
|
@ -132,6 +132,10 @@ module Mobile
|
||||||
parents_reply = parents_reply.reverse[0..1]
|
parents_reply = parents_reply.reverse[0..1]
|
||||||
parents_reply.reverse
|
parents_reply.reverse
|
||||||
end
|
end
|
||||||
|
elsif parents_reply.count == 2 && !opt[:top]
|
||||||
|
opt[:top] = true
|
||||||
|
parents_reply = parents_reply.reverse[0..0]
|
||||||
|
parents_reply.reverse
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ module Mobile
|
||||||
expose :id
|
expose :id
|
||||||
expose :user_id
|
expose :user_id
|
||||||
expose :invite_code
|
expose :invite_code
|
||||||
expose :qrcode
|
# expose :qrcode
|
||||||
expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options|
|
expose :can_setting, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||||
current_user = options[:user]
|
current_user = options[:user]
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ class ProjectsService
|
||||||
def show_project(params,current_user)
|
def show_project(params,current_user)
|
||||||
project = Project.find(params[:id])
|
project = Project.find(params[:id])
|
||||||
project.generate_invite_code
|
project.generate_invite_code
|
||||||
project.generate_qrcode
|
# project.generate_qrcode
|
||||||
|
|
||||||
project
|
project
|
||||||
end
|
end
|
||||||
|
@ -104,7 +104,7 @@ class ProjectsService
|
||||||
|
|
||||||
class JoinProjectError < Errors
|
class JoinProjectError < Errors
|
||||||
define_error [
|
define_error [
|
||||||
0, '加入成功',
|
0, '您已成功加入项目',
|
||||||
1, '您的邀请码不正确',
|
1, '您的邀请码不正确',
|
||||||
2, '您还未登录',
|
2, '您还未登录',
|
||||||
3, '您已经是该项目的管理人员',
|
3, '您已经是该项目的管理人员',
|
||||||
|
@ -131,7 +131,7 @@ class ProjectsService
|
||||||
else
|
else
|
||||||
if params[:invite_code].present?
|
if params[:invite_code].present?
|
||||||
|
|
||||||
if params[:role_id] == 5
|
if params[:role] == 5
|
||||||
members = []
|
members = []
|
||||||
user_grades = []
|
user_grades = []
|
||||||
project_info = []
|
project_info = []
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div loading-spinner></div>
|
<div loading-spinner></div>
|
||||||
<div class="post-container" style="padding-bottom:50px;">
|
<div class="post-container" style="padding-bottom:50px;">
|
||||||
<div class="blue-title">欢迎加入项目</div>
|
<div class="blue-title">欢迎加入项目</div>
|
||||||
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">项目邀请码</span><input class="new-class-input ml25" ng-model="syllabus.title" required placeholder="请输入6位邀请码" /></div>
|
<div class="course-list-row f13 c-grey3 mt30"><span class="fl ml15 c-grey3">项目邀请码</span><input class="new-class-input ml25" ng-model="invite_code" required placeholder="请输入6位邀请码" /></div>
|
||||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15">角色</span></div>
|
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15">角色</span></div>
|
||||||
<ul class="class-list f13 c-grey3">
|
<ul class="class-list f13 c-grey3">
|
||||||
<li><span class="fl ml10 class-list-name hidden">管理人员</span><span ng-click="selectRole(3)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': role_id == 3}]"></span></li>
|
<li><span class="fl ml10 class-list-name hidden">管理人员</span><span ng-click="selectRole(3)" ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle', {'checked': role_id == 3}]"></span></li>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<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>
|
<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>
|
||||||
|
|
||||||
<div ng-class="{'undis': currentTab != 1}">
|
<div ng-show="project" ng-class="{'undis': currentTab != 1}">
|
||||||
<div ng-repeat="act in project_activities">
|
<div ng-repeat="act in project_activities">
|
||||||
<div ng-if="act.container_type=='Project' ">
|
<div ng-if="act.container_type=='Project' ">
|
||||||
<div ng-if="act.act_type=='Issue'">
|
<div ng-if="act.act_type=='Issue'">
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</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 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" 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.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>
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</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 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" 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.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>
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-class="{'undis': currentTab != 2}">
|
<div ng-show="project" ng-class="{'undis': currentTab != 2}">
|
||||||
<div class="class-search-wrap">
|
<div class="class-search-wrap">
|
||||||
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
|
<div class="class-search-inner"> <img src="/images/wechat/search.png" width="18" class="class-search-icon" />
|
||||||
<input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" />
|
<input class="class-detail-search" ng-model="searchText" placeholder="输入关键词进行搜索" />
|
||||||
|
|
|
@ -61,6 +61,8 @@ app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'confi
|
||||||
rms.save("project_master_members",[]);
|
rms.save("project_master_members",[]);
|
||||||
rms.save("project_develop_members",[]);
|
rms.save("project_develop_members",[]);
|
||||||
rms.save("project_report_members",[]);
|
rms.save("project_report_members",[]);
|
||||||
|
rms.save("review_master_members",[]);
|
||||||
|
rms.save("review_develop_members",[]);
|
||||||
rms.save('tab_num',null);
|
rms.save('tab_num',null);
|
||||||
// window.history.back();
|
// window.history.back();
|
||||||
$location.path("/project").search({id: project_id,tag:1});
|
$location.path("/project").search({id: project_id,tag:1});
|
||||||
|
@ -68,7 +70,6 @@ app.controller('EditProjectMemberController', ['$scope', '$http', 'auth', 'confi
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
vm.selectRole = function(role_id){
|
vm.selectRole = function(role_id){
|
||||||
|
|
|
@ -45,8 +45,9 @@ app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'ale
|
||||||
student_flag:vm.student
|
student_flag:vm.student
|
||||||
}).then(function(response){
|
}).then(function(response){
|
||||||
if(response.data.status == 0){
|
if(response.data.status == 0){
|
||||||
vm.alertService.showMessage('提示', response.data.message);
|
vm.alertService.showMessage('提示', response.data.message,function(){
|
||||||
$location.path("/class_list");
|
$location.path("/class_list");
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
vm.alertService.showMessage('提示', response.data.message);
|
vm.alertService.showMessage('提示', response.data.message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'a
|
||||||
|
|
||||||
vm.role_id = 0;
|
vm.role_id = 0;
|
||||||
vm.alertService = alertService.create();
|
vm.alertService = alertService.create();
|
||||||
|
vm.invite_code = "";
|
||||||
|
|
||||||
vm.cancel = function(){
|
vm.cancel = function(){
|
||||||
window.history.back();
|
window.history.back();
|
||||||
|
@ -37,8 +38,9 @@ app.controller('JoinProjectController', ['$scope', '$http', 'auth', 'config', 'a
|
||||||
role_id:vm.role_id
|
role_id:vm.role_id
|
||||||
}).then(function(response){
|
}).then(function(response){
|
||||||
if(response.data.status == 0){
|
if(response.data.status == 0){
|
||||||
vm.alertService.showMessage('提示', response.data.message);
|
vm.alertService.showMessage('提示', response.data.message,function(){
|
||||||
$location.path("/project_list");
|
$location.path("/project_list");
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
vm.alertService.showMessage('提示', response.data.message);
|
vm.alertService.showMessage('提示', response.data.message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,9 +36,12 @@ app.controller('ProjectListController', ['$scope', 'config', 'auth', '$http', '$
|
||||||
rms.save("project_activities",[]);
|
rms.save("project_activities",[]);
|
||||||
rms.save("project_has_more",false);
|
rms.save("project_has_more",false);
|
||||||
rms.save("project",null);
|
rms.save("project",null);
|
||||||
rms.save('project_members_page',0);
|
rms.save("project_master_members",[]);
|
||||||
rms.save("project_members",[]);
|
rms.save("project_develop_members",[]);
|
||||||
rms.save("project_members_has_more",false);
|
rms.save("project_report_members",[]);
|
||||||
|
rms.save("review_master_members",[]);
|
||||||
|
rms.save("review_develop_members",[]);
|
||||||
|
|
||||||
rms.save('tab_num',null);
|
rms.save('tab_num',null);
|
||||||
console.log(project_id);
|
console.log(project_id);
|
||||||
$location.path("/project").search({id: project_id});
|
$location.path("/project").search({id: project_id});
|
||||||
|
|
Loading…
Reference in New Issue