From 2c03bfbf3a32ee6a3b12d189710b20fa71914cf6 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 2 Sep 2016 16:51:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8F=90=E7=A4=BA=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 14 +++++----- .../files/_tip_attachment_count.html.erb | 27 ++++++++++--------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index d3cc58c71..045eec6f7 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -124,12 +124,14 @@
-
- - -

私有资源:
仅对本班级成员可见

-

公共资源:
对所有用户可见

-
+ <% if !User.current.member_of_course?(@course) && show_attachment_tip(@course.id, "Course") %> +
+ + +

私有资源:
仅对本班级成员可见

+

公共资源:
对所有用户可见

+
+ <% end %>
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %> diff --git a/app/views/files/_tip_attachment_count.html.erb b/app/views/files/_tip_attachment_count.html.erb index 6a21f36be..edcbbea98 100644 --- a/app/views/files/_tip_attachment_count.html.erb +++ b/app/views/files/_tip_attachment_count.html.erb @@ -1,15 +1,18 @@ 共有 <%= @tip_all_attachments %> 个资源 -公共资源:<%= @tip_all_public_attachments %>个 -<% if @project %> - <% if !User.current.member_of?(@project) && params[:tag_name] %> - 私有资源:0个 - <% else %> - 私有资源:<%= @tip_all_private_attachments %>个 - <% end %> -<% elsif @course %> - <% if !User.current.member_of_course?(@course) && params[:tag_name] %> - 私有资源:0个 - <% else %> - 私有资源:<%= @tip_all_private_attachments %>个 +<% if @tip_all_private_attachments != 0 %> + 公共资源:<%= @tip_all_public_attachments %>个 + <% if @project %> + <% if !User.current.member_of?(@project) && params[:tag_name] %> + 私有资源:0个 + <% else %> + 私有资源:<%= @tip_all_private_attachments %>个 + <% end %> + <% elsif @course %> + <% if !User.current.member_of_course?(@course) && params[:tag_name] %> + 私有资源:0个 + <% else %> + 私有资源:<%= @tip_all_private_attachments %>个 + <% end %> <% end %> + <% end %>