优化base_head代码

This commit is contained in:
sw 2014-11-20 09:15:29 +08:00
parent 5c4a9ac1f8
commit 14da0c7d73
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<% if hasCourse %>
<li id="course_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%=link_to l(:label_my_course), "http://" + Setting.host_course + user_courses_user_path(User.current.id) %>
<%=link_to l(:label_my_course), user_courses_user_path(User.current.id) %>
<ul class="course_sub_menu">
<% course_index = 0 %>
<% User.current.courses.each do |course| %>

View File

@ -1,10 +1,10 @@
<% if course %>
<li id="homework_loggedas_li" style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title="<%=course.name%>" onmouseover="homeworkSlipMenuOver(<%= course.id%>);" onmouseout="homeworkSlipMenuOut(<%= course.id%>);">
<%= link_to course.name, "http://" + Setting.host_course + course_path(course.id) %>
<%= link_to course.name, course_path(course.id, host: Setting.host_course) %>
<ul class="homework_sub_menu" id="homework_loggedas_ul_<%= course.id%>" style="top:<%= course_index * 28.1%>px;">
<% course.homework_for_courses.map(&:bid).each do |bid| %>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=bid.name%>">
<%= link_to bid.name, "http://" + Setting.host_course + course_for_bid_path(bid), :target => "_blank" %>
<%= link_to bid.name, course_for_bid_path(bid, host: Setting.host_course), :target => "_blank" %>
</li>
<% end %>
</ul>