socialforge/app/views/welcome/_search_syllabus_results.ht...

22 lines
1.4 KiB
Plaintext

<% unless syllabuses.nil? || syllabuses.empty?%>
<% syllabuses.each do |item|%>
<ul class="searchContent w968">
<li class="f16 mb5 fontGrey3">
<!--<a href="<%#= syllabus_path(syllabus.id)%>" class="fontGrey3 fl"><span class="c_red"><%#= syllabus.title %></span>课程</a>-->
<a href="<%= syllabus_path(item.id)%>" class="fontGrey3 fl"><%= item.try(:highlight).try(:title) ? item.highlight.title[0].html_safe : item.title %>课程</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="f12 fontGrey2">
<% user = User.find(item.user_id)%>
<% syllabus = Syllabus.find(item.id) %>
<span class="mr30">创建者:<%=user.login+"("+user.show_name+")"%></span>
<span class="mr30">教师团队:<%=syllabus.syllabus_members.count%></span>
<span class="mr30">班级:<%=syllabus.courses.count%></span>
<span class="mr30">更新时间:<%=format_date(syllabus.updated_at)%></span>
<span class="mr30"><%=user.show_occupation.nil? ? "": "单位:"+user.show_occupation %></span>
</li>
</ul>
<% end %>
<div class="pageRoll">
<%= paginate syllabuses,:params => {:controller => 'welcome', :action => 'search',:search_type=>'syllabus'}%>
</div>
<% end %>