修复班级项目 删除成员的BUG
This commit is contained in:
parent
c3c2516e6b
commit
8644ad178c
|
@ -734,7 +734,7 @@ module Mobile
|
|||
out = {status: status}
|
||||
message = case status
|
||||
when 0; "退出班级成功"
|
||||
when 1; "您不在课程中"
|
||||
when 1; "您不是该班级成员"
|
||||
when 2; "您还未登录"
|
||||
when 3; "管理员不能退出班级"
|
||||
else; "未知错误,请稍后再试"
|
||||
|
|
|
@ -79,7 +79,8 @@ class CoursesService
|
|||
else
|
||||
c = Course.find(course)
|
||||
end
|
||||
if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
|
||||
# if current_user.nil? || !(current_user.admin? || c.is_public == 1 || (c.is_public == 0 && current_user.member_of_course?(c)))
|
||||
if current_user.nil?
|
||||
raise '403'
|
||||
end
|
||||
#@canShowCode = isCourseTeacher(User.current.id,course) && params[:role] != '1'
|
||||
|
@ -458,8 +459,8 @@ class CoursesService
|
|||
joined = StudentsForCourse.where('student_id = ? and course_id = ?', user.id, params[:object_id])
|
||||
joined.each do |join|
|
||||
join.delete
|
||||
@state = 0
|
||||
end
|
||||
@state = 0
|
||||
@state
|
||||
end
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
<div ng-if="course_has_more" class="mb50">
|
||||
<div id="more_course_activities" class="more-events mt10" ng-click="getClassActivities(course_activities_page+1);">更多</div>
|
||||
</div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<div ng-show="course.is_member" class="bottom-tab-wrap mt10">
|
||||
<a ng-show="isTeacher" ng-click="goPublishNotice()" class="weixin-tab link-blue2 border-top">发布通知</a>
|
||||
<a ng-click="goPublishIssue()" class="weixin-tab link-blue2 border-top">发起讨论</a>
|
||||
</div>
|
||||
|
@ -259,7 +259,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="bottom-tab-wrap mt10" ng-class="{'undis': !showClassMate}">
|
||||
<div ng-show="course.is_member" class="bottom-tab-wrap mt10" ng-class="{'undis': !showClassMate}">
|
||||
<a ng-show="!course.is_creator" ng-click="quit()" class="weixin-tab link-blue2 border-top">退出班级</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<div ng-if="project_has_more" class="mb50">
|
||||
<div id="more_project_activities" class="more-events mt10" ng-click="getActivities(project_activities_page+1);">更多</div>
|
||||
</div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<div ng-show="project.is_member" class="bottom-tab-wrap mt10">
|
||||
<a ng-click="goPublishNote()" class="weixin-tab link-blue2 border-top">发布新帖</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -138,7 +138,7 @@
|
|||
<img src="/images/wechat/setting.png" ng-show = "master.user.id != project.user_id && project.can_setting " width="15" class="class-list-setting" ng-click="onSetting(report)" />
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="bottom-tab-wrap mt10" ng-class="{'undis': currentTab != 2}">
|
||||
<div ng-show="project.is_member" class="bottom-tab-wrap mt10" ng-class="{'undis': currentTab != 2}">
|
||||
<a ng-show="!project.is_creator" ng-click="quit()" class="weixin-tab link-blue2 border-top">退出项目</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,7 @@ app.controller('ClassPublishIssueController', ['$scope', '$http', 'auth', 'confi
|
|||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '您已成功发布问题',function(){
|
||||
vm.alertService.showMessage('提示', '发布成功',function(){
|
||||
rms.save('course_activities_page',0);
|
||||
rms.save("course_activities",[]);
|
||||
rms.save("course_has_more",false);
|
||||
|
|
|
@ -55,7 +55,7 @@ app.controller('ClassPublishNoticeController', ['$scope', '$http', 'auth', 'conf
|
|||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '您已成功发布通知',function(){
|
||||
vm.alertService.showMessage('提示', '发布成功',function(){
|
||||
rms.save('course_activities_page',0);
|
||||
rms.save("course_activities",[]);
|
||||
rms.save("course_has_more",false);
|
||||
|
|
|
@ -56,7 +56,7 @@ app.controller('ProjectPublishNoteController', ['$scope', '$http', 'auth', 'conf
|
|||
).then(function(response){
|
||||
if(response.data.status == 0)
|
||||
{
|
||||
vm.alertService.showMessage('提示', '您已成功发布帖子',function(){
|
||||
vm.alertService.showMessage('提示', '发布成功',function(){
|
||||
rms.save('project_activities_page',0);
|
||||
rms.save("project_activities",[]);
|
||||
rms.save("project_has_more",false);
|
||||
|
|
Loading…
Reference in New Issue