1.修改我的动态博客详情页面显示不了的BUG 2.资源界面切换是暂无XX先隐藏 3. 发送资源不选择班级的提示修改

This commit is contained in:
yuanke 2016-07-04 16:50:49 +08:00
parent 201abd6358
commit 9d0b5789d9
5 changed files with 22 additions and 13 deletions

View File

@ -7,7 +7,7 @@ module Mobile
desc "get special topic"
get ':id' do
user = UserWechat.find_by_openid(params[:openid]).user
user = current_user
blog = BlogComment.find params[:id]
present :data, blog, with: Mobile::Entities::BlogComment,user: user
present :status, 0

View File

@ -21,7 +21,7 @@
<div ng-class="{'undis': !showResources}">
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r)">发送</a></div>
<p ng-show="resources.length<=0" class="class-test-tip">暂无课件,<br />
<p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站,在PC浏览器中上传课件。</p>
</div>
<div ng-class="{'undis': !showClassMate}">
@ -38,14 +38,14 @@
<div ng-class="{'undis': !showHomework}">
<div ng-repeat="r in homeworks|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.homework_name}}</span></div>
<p ng-show="homeworks.length<=0" class="class-test-tip">暂无作业,<br />
<p ng-show="homeworks_tag == true && homeworks.length<=0" class="class-test-tip">暂无作业,<br />
请登录Trustie网站,在PC浏览器中上传作业。</p>
</div>
<div ng-class="{'undis': !showTestcase}">
<div ng-repeat="r in exercises|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.exercise_name}}</span></div>
<p ng-show="exercises.length<=0" class="class-test-tip">暂无小测验,<br />
<p ng-show="exercises_tag == true && exercises.length<=0" class="class-test-tip">暂无小测验,<br />
请登录Trustie网站,在PC浏览器中上传小测验。</p>
</div>

View File

@ -1,4 +1,5 @@
<div class="post-container">
<div loading-spinner></div>
<div class="class-detail-name">我的资源</div>
<div class="tab-wrap">
<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>
@ -8,19 +9,21 @@
<input class="class-detail-search" placeholder="输入关键词进行搜索" />
</div>
</div>
<div ng-class="{'undis': currentTab!=1}">
<div ng-repeat="r in resources" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.filename}}</span><a ng-click="sendFile(r)" class="fr mr10 link-blue2">发送</a></div>
<p ng-show="resources.length<=0" class="class-test-tip">暂无课件,<br />
<p ng-show="resources && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站,在PC浏览器中上传课件。</p>
</div>
<div ng-class="{'undis': currentTab!=2}">
<div ng-repeat="r in homeworks" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.homework_name}}</span></div>
<p ng-show="homeworks.length<=0" class="class-test-tip">暂无作业,<br />
<p ng-show="homeworks && homeworks.length<=0" class="class-test-tip">暂无作业,<br />
请登录Trustie网站,在PC浏览器中创建作业。</p>
</div>
<div ng-class="{'undis': currentTab!=3}">
<div ng-repeat="r in exercise" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><span class="fl ml10">{{r.exercise_name}}</span></div>
<p ng-show="exercise.length<=0" class="class-test-tip">暂无测验,<br />
<p ng-show="exercise && exercise.length<=0" class="class-test-tip">暂无测验,<br />
请登录Trustie网站,在PC浏览器中创建测验。</p>
</div>
</div>

View File

@ -31,6 +31,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
{token: auth.token(), name: ''}
).then(function(response){
vm.resources = response.data.data;
vm.resources_tag = true;
});
}
}
@ -40,6 +41,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$http.get(config.apiUrl + "courses/homeworks/"+courseid+"?token="+auth.token()).then(function(response){
vm.homeworks = response.data.data;
console.log(response.data);
vm.homeworks_tag = true;
});
}
}
@ -49,6 +51,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$http.get(config.apiUrl + "courses/"+courseid+"/exercises?token="+auth.token()).then(function(response){
vm.exercises = response.data.data;
console.log(response.data);
vm.exercises_tag = true;
});
}
}
@ -64,6 +67,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.showResources = false;
vm.showHomework = false;
vm.showTestcase = false;
vm.resources_tag = false;
vm.homeworks_tag = false;
vm.exercises_tag = false;
if(vm.isTeacher){
if(index == 1){ //课件

View File

@ -2,23 +2,23 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l
var vm = $scope;
vm.menus = ['课件', '作业', '测验'];
vm.resources = [];
vm.homeworks = [];
vm.exercise = [];
vm.resources = null;
vm.homeworks = null;
vm.exercise = null;
vm.tab = function(index){
vm.currentTab = index;
if(index==1){
if(index==1 && (!vm.resources || vm.resources.length <= 0 )){
$http.get(config.apiUrl + "resources?token="+auth.token()).then(function(response){
console.log(response.data);
vm.resources = response.data.data;
});
} else if(index==2){
} else if(index==2 && (!vm.homeworks || vm.homeworks.length <= 0) ){
$http.get(config.apiUrl + "resources/homeworks?token="+auth.token()).then(function(response){
console.log(response.data);
vm.homeworks = response.data.data;
});
} else if(index==3){
} else if(index==3 && (!vm.exercise || vm.exercise.length <= 0) ){
$http.get(config.apiUrl + "resources/exercies?token="+auth.token()).then(function(response){
console.log(response.data);
vm.exercise = response.data.data;