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

57 lines
2.7 KiB
Plaintext
Raw Normal View History

2016-04-20 16:12:20 +08:00
<div class="listbox">
<h2 class="list-h2">博客列表</h2>
<div class="category">
<span class="grayTxt ">排序:</span>
2016-04-21 09:39:21 +08:00
<%= 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 %>
2016-03-11 14:39:17 +08:00
<div class="cl"></div>
</div>
2016-04-20 16:12:20 +08:00
<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%>
2016-03-11 14:39:17 +08:00
<% else %>
2016-04-20 16:12:20 +08:00
<% count=activity.children.count%>
2016-03-11 14:39:17 +08:00
<% end %>
2016-04-20 16:12:20 +08:00
<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>
2016-03-11 14:39:17 +08:00
<div class="cl"></div>
2016-04-20 16:12:20 +08:00
</ul>
2016-03-11 14:39:17 +08:00
<% end %>
2016-04-20 16:12:20 +08:00
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>
2016-03-11 14:39:17 +08:00
</div>
</div>