From 3881e5c5c5fb11e6cf71b9142a0fe668d6fca8ef Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 2 Sep 2016 14:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=90=9C=E7=B4=A2=E7=9A=84?= =?UTF-8?q?=E6=98=AF=E6=97=B6=E5=80=99tip=E5=B1=80=E9=83=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0=20=E7=BB=84=E7=BB=87=E8=B5=84=E6=BA=90=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=85=AC=E5=BC=80=E7=A7=81=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 5 +++-- app/controllers/files_controller.rb | 2 ++ app/views/files/search.js.erb | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) 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