修改微信发送资源平台不显示发送人的问题,删除班级提示文字不居中的问题等

This commit is contained in:
yuanke 2016-07-08 17:22:58 +08:00
parent 3a2e2c1174
commit c6099177a4
7 changed files with 16 additions and 28 deletions

View File

@ -56,7 +56,7 @@ module Mobile
authenticate!
rs = ResourcesService.new
ori, flag, save_message = rs.send_resource_to_course(params)
ori, flag, save_message = rs.send_resource_to_course(current_user,params)
if flag
present :status, 0
else

View File

@ -3,7 +3,7 @@
class ResourcesService
#发送资源到课程
def send_resource_to_course params
def send_resource_to_course user,params
send_id = params[:send_id]
@ori = Attachment.find_by_id(send_id)
course_ids = params[:course_ids]
@ -26,7 +26,7 @@ class ResourcesService
attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联
attach_copied_obj.container = Course.find(id)
attach_copied_obj.created_on = Time.now
attach_copied_obj.author_id = User.current.id
attach_copied_obj.author_id = user.id
attach_copied_obj.is_public = 0
attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from
if attach_copied_obj.attachtype == nil

View File

@ -46,28 +46,16 @@ class SyllabusesService
courses = user.courses.not_deleted
syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc")
user.syllabuses.each do |syllabus|
syllabus.courses = syllabus.courses.not_deleted
end
syllabuses.to_a << other
#管理权限 can_setting
syllabuses.each do |s|
s = judge_can_setting(s,user)
# s[:can_setting] = s.user_id == user.id ? true : false
# s.courses.each do |c|
# c[:can_setting] = false
#
# member = c.members.where("user_id=#{user.id} and course_id=#{c.id}")[0]
# roleName = member.roles[0].name if member
#
# if roleName && (roleName == "TeachingAsistant" || roleName == "Teacher" )
# c[:can_setting] = true
# end
#
# if c.tea_id == user.id
# c[:can_setting] = true
# end
# end
end
syllabuses
@ -138,8 +126,8 @@ class SyllabusesService
#新增班级
add_courses = option[:add_courses]
add_courses.each do |c|
course = ::Course.new(c)
course.name = add_courses
course = Course.new()
course.name = c
course.tea_id = user.id
course.syllabus_id = sy.id
course.update_default_value

View File

@ -5,10 +5,10 @@
<div class="blue-title">发送课程列表</div>
<div ng-repeat="syllabus in syllabuses">
<div ng-show="syllabus.can_setting" ng-repeat="syllabus in syllabuses">
<div ng-click="syllabus.show_plus = !syllabus.show_plus" class="course-list-row f13 c-grey3 mt10"><img src="/images/wechat/plus.png" ng-show="syllabus.show_plus" width="15" class="fl ml10 mt11 spread-btn" /><img src="/images/wechat/minus.png" ng-show="!syllabus.show_plus" width="15" class="fl ml10 mt11 retract-btn " /><span class="fl ml10">{{syllabus.title}}</span></div>
<ul ng-show="!syllabus.show_plus" class="class-list f13 c-grey3">
<li ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in syllabus.courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>
<li ng-show="course.can_setting" ng-click="selectCourse(course)" ng-class="{'border-bottom-none': $last }" ng-repeat="course in syllabus.courses"><img src="/images/wechat/dot.png" width="15px" class="class-list-dot" /><span class="fl ml10 class-list-name hidden">{{course.name}}</span><span ng-class="['login-box', 'fr', 'mr5', 'mt12', {'checked': course.checked}]"></span></li>
</ul>
</div>

View File

@ -4,7 +4,6 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale
var vm = $scope;
vm.syllabus = rms.get('current_edit_syllobus');
console.log(vm.syllabus);
var syllabus_id = $routeParams.id;
if(!vm.syllabus){
@ -13,6 +12,7 @@ app.controller('EditClassController', ['$scope', '$http', 'auth', 'config', 'ale
vm.syllabus = response.data.data;
});
}
console.log(vm.syllabus);
//名字用两份
for(var i in vm.syllabus.courses){

View File

@ -1,4 +1,4 @@
app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService,rms){
app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'config','auth','alertService', function($scope, $http, $routeParams, config, auth, alertService){
var vm = $scope;
var send_id = $routeParams.id;
@ -17,7 +17,7 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
function (response) {
console.log(response.data);
vm.syllabuses = response.data.data;
rms.save('syllabuses', vm.syllabuses);
// rms.save('syllabuses', vm.syllabuses);
}
);
};

File diff suppressed because one or more lines are too long