From c3eb8e05cd10706b87602fc96141c594972f35b7 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 7 Mar 2016 18:12:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E7=A7=81=E6=9C=89?= =?UTF-8?q?=E8=B5=84=E6=BA=90=EF=BC=8C=E6=95=B0=E9=87=8F=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/files_helper.rb | 2 +- app/views/files/_subfield_files.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 6b748649b..238999a71 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -126,7 +126,7 @@ module FilesHelper (attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))|| (attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)|| attachment.author_id == User.current.id || - attachment.container_type == "OrgSubfield" + (attachment.container_type == "OrgSubfield" and User.current.member_of_org?(attachment.container.organization)) result << attachment end end diff --git a/app/views/files/_subfield_files.html.erb b/app/views/files/_subfield_files.html.erb index 6531aa96b..7fb9e2e0a 100644 --- a/app/views/files/_subfield_files.html.erb +++ b/app/views/files/_subfield_files.html.erb @@ -54,7 +54,7 @@ <%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
-

共有 <%= @all_attachments.count %> 个资源

+

共有 <%= User.current.member_of_org?(@org_subfield.organization) ? @all_attachments.count : @all_attachments.select{|attach| attach.is_public == 1 }.count %> 个资源

<% if @order == "asc" %> 按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %> /