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

28 lines
1.8 KiB
Plaintext
Raw Normal View History

2015-11-26 09:57:53 +08:00
<% 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">
2015-11-30 11:21:21 +08:00
<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>
2015-11-26 09:57:53 +08:00
<li class="fontGrey3 mb5"><%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该课程描述') %></li>
2015-12-14 11:11:09 +08:00
<li class="f12 fontGrey2">
<span class="mr30">教师:<%= User.find(course.tea_id).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.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%></span></li>
2015-11-26 09:57:53 +08:00
</ul>
</li>
<div class="cl"></div>
</ul>
<% end %>
<div class="pageRoll">
<%= paginate courses,:params => {:controller => 'welcome', :action => 'search',:search_type=>'course'}%>
</div>
<% end %>