socialforge/app/views/welcome/_search_course_results.html...

29 lines
1.7 KiB
Plaintext

<% unless courses.nil? || courses.empty?%>
<% courses.each do |course|%>
<ul class="searchContent">
<li class="fl">
<%= link_to image_tag(url_to_avatar(Course.find(course.id)), :width => "75", :height => "75",:class=>'searchCourseImage'), course_path(course.id), :alt => "班级图片" %>
</li>
<li class="fl searchContentDes">
<ul class="fl">
<li class="f16 mb5">
<a href="<%= course_path(course.id)%>" class="fontGrey3 fl"><%= course.try(:highlight).try(:name) ? course.highlight.name[0].html_safe : course.name %></a>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag">班级</span></div>
<div class="cl"></div>
</li>
<li class="fontGrey3 mb5"><%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该班级描述') %></li>
<li class="f12 fontGrey2">
<% user = User.find(course.tea_id)%>
<span class="mr30">教师:<%= user.realname %></span>
<span class="mr30">授课时间:<%= course.time.to_s + course.term%></span>
<span class="mr30">更新时间:<%= format_date(course.updated_at)%></span>
<span class="mr30"><%=user.show_occupation.nil? ? "": "单位:"+user.show_occupation %></span></li>
</ul>
</li>
<div class="cl"></div>
</ul>
<% end %>
<div class="pageRoll">
<%= paginate courses,:params => {:controller => 'welcome', :action => 'search',:search_type=>'course'}%>
</div>
<% end %>