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

This commit is contained in:
cxt 2017-01-09 09:56:06 +08:00
commit 65ca0fbcc9
5 changed files with 40 additions and 17 deletions

View File

@ -1842,11 +1842,11 @@ end
if params[:property]
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
if params[:property] == "1"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1 order by created_at desc")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
elsif params[:property] == "2"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2 order by created_at desc")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
elsif params[:property] == "3"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3 order by created_at desc")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
end
end
@limit = 10
@ -1875,11 +1875,11 @@ end
if params[:property]
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
if params[:property] == "1"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1 order by created_at desc")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
elsif params[:property] == "2"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2 order by created_at desc")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
elsif params[:property] == "3"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3 order by created_at desc")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
end
end
@limit = 10
@ -1913,11 +1913,11 @@ end
if params[:property]
all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
if params[:property] == "1"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1 order by created_at desc")
elsif params[:property] == "2"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2 order by created_at desc")
elsif params[:property] == "3"
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
@homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3 order by created_at desc")
end
end
@limit = 10

View File

@ -92,7 +92,7 @@
<div class="post-reply-row border-bottom-none">
<div class="post-input-container">
<div class="copy-input-container"><textarea class="copy-input"></textarea></div>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="object.comment" placeholder="输入回复内容~" /></textarea>
<textarea input-auto type="text" class="post-reply-input" id="postInput1" ng-model="object.comment" ng-change="onPostChange(object.comment, '{{object.comment}}')" placeholder="{{replytip}}" /></textarea>
<button ng-click="addReply(object,0)" ng-disabled="object.disabled" ng-hide="object.disabled" class="post-reply-submit fr border-radius">提交</button>
<button ng-disabled="object.disabled" ng-hide="!object.disabled" class="post-reply-submit bg-grey fr border-radius">提交</button>
<div class="cl"></div>

View File

@ -4,7 +4,7 @@
<div class="class-detail-name"><span class="course-name-width hidden inline-block">选择您要@的人</span>
<button ng-click="cancelAt()" class="cancel-btn-new fr border-radius">取消</button>
</div>
<ul class="weixin-users-all">
<ul class="weixin-users-all" id="at-list">
<li ng-repeat="person in at_persons track by $index" ng-click="selectAtPerson($index)"><p class="fl ">{{person.name}}</p><p class="fl ">{{person.login}}</p></li>
</ul>
</div>

View File

@ -950,7 +950,13 @@ $(function(){
return;
}
if(res.length<1){
if (res.err == -2) {
alert("该作业没有任何附件可下载");
return;
}
if(res.length < 1 ){
alert("该作业没有任何附件可下载");
return;
}
@ -983,10 +989,22 @@ $(function(){
$('#download_homework_attachments').bind('ajax:complete', function (event, data, status, xhr) {
if(status == 'success'){
var res = JSON.parse(data.responseText);
if(res.length == null){
alert("该作业没有任何附件可下载");
if(res.err == -1){
var htmlvalue = '<div id="muban_popup_box" style="width:auto;"><div class="muban_popup_top"><h3 class="fl">温馨提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15 mr10 ml10"><p class="text_c f14">因附件资源太大请通过微信或者QQ联系Trustie管理员</br>辅助您完成下载</p><div class="cl"></div>'+
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 143px;" onclick="hideModal();">确&nbsp;&nbsp;定</a></div></div>';
pop_box_new(htmlvalue,380,166);
return;
}
else if(res.length<1){
if (res.err == -2) {
alert("该作业没有任何附件可下载");
return;
}
if(res.length < 1 ){
alert("该作业没有任何附件可下载");
return;
}
else

View File

@ -93,7 +93,7 @@ app.factory('rms', function(){
return {save: save, get: get};
});
app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){
app.factory('common', ['$http', '$location', '$anchorScroll', 'auth', '$routeParams','rms','config','wx','$location', function($http, $location, $anchorScroll, auth, $routeParams,rms,config,wx,$location){
var addCommonReply = function(id, type, data,args,reply_type, beforeReply, cb){
if(!data.comment || data.comment.length<=0){
return;
@ -523,6 +523,11 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc
if(newValue.length > oldValue.length && newValue.match(/@$/)=='@'){
console.log('@ fire');
vm.showAtDialog = true;
window.scrollTo(0,0);
$location.hash();
if(!vm.at_persons){
$http.get('/at/'+$routeParams.id+'.json?type='+atType).then(function (response) {
vm.at_persons = response.data;