部分用户右上角下拉框不显示我的课程

This commit is contained in:
sw 2015-07-02 15:30:30 +08:00
parent 5bacd5c772
commit a6e80ed938
2 changed files with 8 additions and 9 deletions

View File

@ -17,15 +17,14 @@
visiable = hidden_non_project && hidden_non_project.value == "0"%>
<ul class="sub_menu">
<% if @show_course == 1 && !visiable %>
<% if User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) -%>
<% hasCourse=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<% hasCourse=true %>
<% end %>
<% hasCourse=false %>
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<% hasCourse=true %>
<% break %>
<% end %>
<%= render :partial => 'layouts/user_courses_list', :locals => {:hasCourse => hasCourse} %>
<% end -%>
<% end %>
<%= render :partial => 'layouts/user_courses_list', :locals => {:hasCourse => hasCourse} %>
<% end %>
<%= render :partial => 'layouts/user_project_list', :locals => {:hasCourse => hasCourse} %>
<li style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">

View File

@ -20,7 +20,7 @@
<li id="current_user_li">
<%= link_to "#{User.current.login}<span class='pic_triangle'></span>".html_safe, {:controller=> 'users', :action => 'show', id: User.current.id, host: Setting.host_user}, target:"_blank", :class => "uses_name"%>
<ul id="user_sub_menu" style="right: 0px;display: none;">
<% if @show_course == 1 && User.current.user_extensions && [UserExtensions::TEACHER, UserExtensions::STUDENT].include?(User.current.user_extensions.identity) %>
<% if @show_course == 1 %>
<% user_course = get_user_course User.current%>
<% unless user_course.empty? %>
<li id="my_courses_li">