资源提示权限控制

This commit is contained in:
huang 2016-09-02 16:51:05 +08:00
parent b588495847
commit 2c03bfbf3a
2 changed files with 23 additions and 18 deletions

View File

@ -124,12 +124,14 @@
</div>
</div>
<div class="cl"></div>
<div class="resource_tip_box fontGrey2">
<em></em>
<span></span>
<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>
<p>公共资源:<br/>对所有用户可见</p>
</div>
<% if !User.current.member_of_course?(@course) && show_attachment_tip(@course.id, "Course") %>
<div class="resource_tip_box fontGrey2">
<em></em>
<span></span>
<p class="mb5">私有资源:<br/>仅对本班级成员可见</p>
<p>公共资源:<br/>对所有用户可见</p>
</div>
<% end %>
</div>
<div id="course_list">
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>

View File

@ -1,15 +1,18 @@
共有&nbsp;<span id="attachment_count"><%= @tip_all_attachments %></span>&nbsp;个资源
<span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span>
<% if @project %>
<% if !User.current.member_of?(@project) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %>
<% elsif @course %>
<% if !User.current.member_of_course?(@course) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% if @tip_all_private_attachments != 0 %>
<span id="attachment_count_public" class="fontGrey2 ml10" style="font-weight: normal;">公共资源:<%= @tip_all_public_attachments %>个</span>
<% if @project %>
<% if !User.current.member_of?(@project) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %>
<% elsif @course %>
<% if !User.current.member_of_course?(@course) && params[:tag_name] %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源0个</span>
<% else %>
<span id="attachment_count_private" class="fontGrey2 ml10" style="font-weight: normal;">私有资源:<%= @tip_all_private_attachments %>个</span>
<% end %>
<% end %>
<% end %>