2016-04-26 15:10:47 +08:00
|
|
|
<div class = "cl"> </div>
|
2016-04-27 16:02:52 +08:00
|
|
|
<div id="course-boardlist">
|
2016-04-26 15:10:47 +08:00
|
|
|
<div class="listbox mt10" >
|
2016-08-25 15:59:09 +08:00
|
|
|
<h2 class="list-h2">讨论区列表</h2>
|
2016-04-26 15:10:47 +08:00
|
|
|
<div class="category">
|
|
|
|
<span class="grayTxt ">排序:</span>
|
|
|
|
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
|
|
|
<% if @type.to_i == 1 %>
|
|
|
|
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
|
|
|
<% end %>
|
|
|
|
<%= link_to "人气", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
|
|
|
<% if @type.to_i == 2 %>
|
|
|
|
<%= link_to "", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
|
|
|
<% end %>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
<div class="bloglistbox">
|
2016-05-04 16:28:40 +08:00
|
|
|
<% if topics.any? %>
|
|
|
|
<% topics.each do |activity| %>
|
|
|
|
<div class="list-file">
|
|
|
|
<div><span class="item_list fl"></span>
|
|
|
|
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
|
|
|
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title fl" %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "list-title f1" %>
|
|
|
|
<% end %>
|
|
|
|
<% if activity.sticky == 1 %>
|
|
|
|
<span class="fl ml10 red-cir-btn">顶</span>
|
|
|
|
<% end%>
|
|
|
|
<% if activity.locked %>
|
|
|
|
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
|
|
|
<% end %>
|
|
|
|
<% u = User.where("id=?",activity.author_id).first%>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
<div class="massages-content ml15">
|
|
|
|
<% if activity.parent_id.nil? %>
|
|
|
|
<% content = activity.content %>
|
|
|
|
<% else %>
|
|
|
|
<% content = activity.parent.content %>
|
|
|
|
<% end %>
|
2016-05-23 15:58:32 +08:00
|
|
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>
|
2016-05-04 16:28:40 +08:00
|
|
|
</div>
|
|
|
|
<div class="ml15 mt10">
|
2016-05-23 15:58:32 +08:00
|
|
|
<span class="grayTxt">
|
|
|
|
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
|
|
|
</span>
|
|
|
|
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
2016-07-04 14:45:50 +08:00
|
|
|
<% all_comments = []%>
|
|
|
|
<% count=get_all_children(all_comments, activity).count %>
|
2016-05-04 16:28:40 +08:00
|
|
|
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<div>
|
|
|
|
<ul class="wlist" id="pages" >
|
|
|
|
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
|
|
|
|
</ul>
|
2016-04-26 15:10:47 +08:00
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
2016-05-04 16:28:40 +08:00
|
|
|
<% else %>
|
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
2016-04-26 15:10:47 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
2016-04-29 13:42:58 +08:00
|
|
|
$(function(){
|
|
|
|
var leftHeight = $("#LSide").height()-$(".fontGrey5").height()-20;
|
|
|
|
var rightHeight = $(".homepageRight").height();
|
|
|
|
if (rightHeight < leftHeight){
|
|
|
|
var diffHeight = leftHeight - rightHeight;
|
|
|
|
var tmpHeight = $(".listbox").height()+diffHeight;
|
|
|
|
$(".listbox").css("height",tmpHeight);
|
|
|
|
}
|
|
|
|
});
|
2016-04-26 15:10:47 +08:00
|
|
|
</script>
|