课程列表中的私有班级不可访问

This commit is contained in:
cxt 2016-07-27 10:11:00 +08:00
parent 76eca76728
commit 4422bb1bc0
3 changed files with 5 additions and 3 deletions

View File

@ -1,11 +1,13 @@
<% unless courses.nil? %>
<% courses.each_with_index do |course, i| %>
<li class="syllabus_class_list <%=i > 2 ? 'none' : '' %>">
<a href="<%=course_path(course.id) %>" target="_blank">
<% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %>
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问"%>">
<span class="icons_sy_cir "></span>
<div class="fl">
<div class="syllabus_class_w ">
<p class="syllabus_class_title fl"><%=course.name %></p>
<span class="icon_si fl"><%=course.is_public == 0 ? '私有' : '公开' %></span>
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%=course.teacher.show_name %></span>
<div class="cl"></div>
</div>

View File

@ -11,7 +11,7 @@
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
<% end %>
<%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
<span class="grayTxt fl ">我<%= list_type == 1 ? "创建" : "加入"%>的课程</span>
<span class="grayTxt fl "><%=@user == User.current ? "" : "他" %><%= list_type == 1 ? "创建" : "加入"%>的课程</span>
<div class="cl"></div>
</div>

View File

@ -110,7 +110,7 @@ input.syllabus_input_min{
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
.syllabus_class_list_more:hover{ background:#ececec;}
.syllabus_class_list_more a{ color:#ff7e00;}
.syllabus_class_title{ font-size:14px; color:#333; width:500px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.syllabus_class_w{ width:650px;}
.dis {display:block;}
.undis {display:none;}