|
|
|
@ -23,7 +23,7 @@ class FilesController < ApplicationController
|
|
|
|
|
before_filter :auth_login1, :only => [:index]
|
|
|
|
|
before_filter :logged_user_by_apptoken,:only => [:index]
|
|
|
|
|
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
|
|
|
|
before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project]
|
|
|
|
|
before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project,:search_tag_attachment]
|
|
|
|
|
|
|
|
|
|
helper :sort
|
|
|
|
|
include SortHelper
|
|
|
|
@ -51,6 +51,7 @@ class FilesController < ApplicationController
|
|
|
|
|
@sort = ""
|
|
|
|
|
@order = ""
|
|
|
|
|
@is_remote = true
|
|
|
|
|
@q = params[:name].strip
|
|
|
|
|
if params[:sort]
|
|
|
|
|
order_by = params[:sort].split(":")
|
|
|
|
|
@sort = order_by[0]
|
|
|
|
@ -519,8 +520,31 @@ class FilesController < ApplicationController
|
|
|
|
|
format.html
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#查找指定TAG的按条件过滤的资源列表
|
|
|
|
|
def search_tag_attachment
|
|
|
|
|
@q,@tag_name,@order = params[:q],params[:tag_name]
|
|
|
|
|
@is_remote = true
|
|
|
|
|
if params[:sort]
|
|
|
|
|
order_by = params[:sort].split(":")
|
|
|
|
|
@sort = order_by[0]
|
|
|
|
|
if order_by.count > 1
|
|
|
|
|
@order = order_by[1]
|
|
|
|
|
end
|
|
|
|
|
sort = "#{@sort} #{@order}"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
q = "%#{@q.strip}%"
|
|
|
|
|
@result = find_course_attache q,@course,sort
|
|
|
|
|
@result = visable_attachemnts @result
|
|
|
|
|
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)}
|
|
|
|
|
@searched_attach = paginateHelper @result,10
|
|
|
|
|
@tag_list = attachment_tag_list @result
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
# format.html
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|