非本课程成员无法看到邀请码

This commit is contained in:
cxt 2016-07-27 16:47:47 +08:00
parent 35b3993c0c
commit 2fea69359d
1 changed files with 9 additions and 1 deletions

View File

@ -32,7 +32,15 @@
<%= image_tag(url_to_avatar(@course), :width => "110", :height => "110", :alt => "班级logo") %>
</div>
<div class="sy_class_id fl">
<p>邀请码<br /><span class="sy_corange"><%=@course.generate_invite_code %></span></p>
<p>邀请码<br />
<span class="sy_corange">
<% if User.current.admin? || User.current.member_of_course?(@course) %>
<%=@course.generate_invite_code %>
<% else %>
*****
<% end %>
</span>
</p>
</div>
<div class="sy_class_info fl ml15">
<div class="sy_class_titbox">