发布作业导入资源

This commit is contained in:
huang 2016-05-25 09:44:30 +08:00
parent d75943efe5
commit b6de2dbd2d
2 changed files with 2 additions and 1 deletions

View File

@ -1096,6 +1096,7 @@ class UsersController < ApplicationController
#引入资源列表根据关键词过滤
def user_ref_resource_search
search = params[:search].to_s.strip.downcase
@user = User.current
if(params[:type].blank? || params[:type] == "1") #全部
user_course_ids = User.current.courses.map { |c| c.is_delete == 0 && c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询
@attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+

View File

@ -70,7 +70,7 @@
<div class="mt5 fl">
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
<%= link_to "资源库",{:controller => 'users', :action => 'user_ref_resource_search', :id => User.current.id, :homework_id => container.id, :type => nil}, :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %>
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作品的附件", :remote => true %>
<% if defined?(has_program) && has_program %>
<div id="program_setting" class="fl">
<a href="javascript:void(0);" class="ProBtn fl mt3"title="请设置编程语言和输入测试集">编程</a>