socialforge/app/views/blogs/_article.html.erb

57 lines
2.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="listbox">
<h2 class="list-h2">博客列表</h2>
<div class="category">
<span class="grayTxt ">排序:</span>
<%= link_to "时间", user_blog_sort_blog_path(:sort => @score, :order => 1, :search => " "), :class => "sortTxt", :remote => true %>
<% if @order == 1 %>
<%= link_to "", user_blog_sort_blog_path(:sort => @score, :order => 1, :search => " "), :class => "#{@score == 'desc' ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
<% end %>
<%= link_to "人气", user_blog_sort_blog_path(:sort => @score, :order => 2, :search => " "), :class => "sortTxt", :remote => true %>
<% if @order == 2 %>
<%= link_to "", user_blog_sort_blog_path(:sort => @score, :order => 2, :search => " "), :class => "#{@score == 'desc' ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
<% end %>
<div class="cl"></div>
</div>
<div class="bloglistbox">
<% topics.each do |activity| %>
<ul class="list-file">
<li><span class="item_list fl"></span>
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "c_red ml10" %>
<% else %>
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id, :blog_id=>activity.blog.id,:id=>activity), :class=> "c_red ml10"%>
<% end %>
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<span class="c_red ml10">[已设为首页]</span></a>
<% end %>
</li>
<% count=0 %>
<% if activity.parent %>
<% count=activity.parent.children.count%>
<% else %>
<% count=activity.children.count%>
<% end %>
<li class="ml15">
<span class="grayTxt">发帖时间:<%= format_time(activity.created_on) %></span>
<span class="grayTxt">更新时间:<%= format_time(activity.updated_on) %></span>
<p class="list-info fr grayTxt">
<span><%= count>0 ? "#{count}" : "" %></span>
<span>回复</span>
<span>|</span>
<span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "" %></span>
<span>赞</span>
</p>
</li>
<div class="cl"></div>
</ul>
<% end %>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>
</div>
</div>