diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 69e7105aa..aa2c9574b 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -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,:search_tag_attachment] + before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment] helper :sort include SortHelper @@ -46,6 +46,13 @@ class FilesController < ApplicationController @obj_attachments = paginateHelper @all_attachments,10 end + def searchone4reload + attachment = Attachment.find_by_id(params[:fileid]); + respond_to do |format| + format.html{render :layout => nil,:locals=>{:file=>attachment,:course=>@course}} + end + end + def search sort = "" @sort = "" diff --git a/app/views/attachments/add_exist_file_to_courses.js.erb b/app/views/attachments/add_exist_file_to_courses.js.erb index eec1e255a..c84a89184 100644 --- a/app/views/attachments/add_exist_file_to_courses.js.erb +++ b/app/views/attachments/add_exist_file_to_courses.js.erb @@ -4,4 +4,5 @@ $("#error_show").html("<%= @message.html_safe %>"); <% else %> closeModal(); + searchone4reload('<%=params[:file_id]%>'); <% end %> diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 1769b1a45..ebccfcaf4 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -1,4 +1,15 @@ @@ -21,7 +21,7 @@ -