diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index cee08ffa9..5d1345f24 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -204,7 +204,9 @@ class AttachmentsController < ApplicationController @attachment.save @newfiledense = filedense end - tip_attachment_update + if @attachment.container_type == "Project" || @attachment.container_type == "Course" + tip_attachment_update + end respond_to do |format| format.js @@ -626,7 +628,6 @@ class AttachmentsController < ApplicationController def attachment_versions @attachment = Attachment.find(params[:id]) @attachment_histories = @attachment.attachment_histories - @container_tip = Project.find(params[:project_id]) respond_to do |format| format.js end diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 2ed17a76f..7318a4dc2 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -90,6 +90,7 @@ class FilesController < ApplicationController @tag_list = get_course_tag_list @course end @all_attachments = @result + get_attachment_for_tip(@all_attachments) @limit = 10 @feedback_count = @all_attachments.count @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] @@ -164,6 +165,7 @@ class FilesController < ApplicationController end @all_attachments = @project_attachment_result + get_attachment_for_tip(@all_attachments) @limit = 10 @feedback_count = @all_attachments.count @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] diff --git a/app/views/files/search.js.erb b/app/views/files/search.js.erb index 011b3bb25..4c32a1044 100644 --- a/app/views/files/search.js.erb +++ b/app/views/files/search.js.erb @@ -1,3 +1,4 @@ $("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>"); $("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>'); + $("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>"); \ No newline at end of file