socialforge/app/views/welcome/_search_user_results.html.erb

27 lines
1.9 KiB
Plaintext

<% unless users.nil? || users.empty?%>
<% users.each do |item|%>
<ul class="searchContent">
<li class="fl">
<!--<img src="images/homepageImage.jpg" alt="个人图片" width="75" height="75" class="searchCourseImage" />-->
<% user = User.find(item.id)%>
<%= link_to image_tag(url_to_avatar(user), :width => "75", :height => "75",:class=>'searchCourseImage'), user_path(user.id), :alt => "用户头像" %>
</li>
<li class="fl searchContentDes">
<ul class="fl">
<li class="f16 mb5"><a href="<%= user_path(user.id)%>" class="fontGrey3 fl"><%= item.try(:highlight).try(:login) ? item.highlight.login[0].html_safe : user.login %>(<%= item.try(:highlight).try(:lastname) ? item.highlight.lastname[0].html_safe : user.lastname%><%= item.try(:highlight).try(:firstname) ? item.highlight.firstname[0].html_safe : user.firstname %>)</a>
<div class="mt5 fl"><%= image_tag("search_icon_03.png", :width=>"8", :height=>"16" ,:class=>"fl") %><span class="searchTag"><%= get_user_identity(user.user_extensions.identity) %></span></div>
<div class="cl"></div>
</li>
<li class="fontGrey3 mb5"><%= user.user_extensions && user.user_extensions.brief_introduction.present? ? user.user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%></li>
<li class="f12 fontGrey2"><span class="mr30">加入时间:<%= format_date( user.created_on)%></span><span class="mr30">
最后登录时间:<%= format_date( user.last_login_on)%></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 users,:params => {:controller => 'welcome', :action => 'search',:search_type=>'user'}%>
</div>
<% end %>