2016-04-29 13:42:58 +08:00
|
|
|
<div class = "cl"> </div>
|
|
|
|
<div id="course-newslist">
|
|
|
|
<div class="listbox mt10" >
|
|
|
|
<h2 class="list-h2">通知列表</h2>
|
|
|
|
<div class="category">
|
|
|
|
<span class="grayTxt ">排序:</span>
|
|
|
|
<%= link_to "时间", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
|
|
|
<% if @type.to_i == 1 %>
|
|
|
|
<%= link_to "", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
|
|
|
|
<% end %>
|
|
|
|
<%= link_to "人气", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 2 }, :class => "sortTxt", :remote => true %>
|
|
|
|
<% if @type.to_i == 2 %>
|
|
|
|
<%= link_to "", {:controller => 'news', :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>
|
|
|
|
<%= link_to activity.title.to_s, news_path(activity), :class => "list-title fl" %>
|
|
|
|
<% if activity.sticky == 1 %>
|
|
|
|
<span class="fl ml10 red-cir-btn">顶</span>
|
|
|
|
<% end%>
|
|
|
|
<% u = User.where("id=?",activity.author_id).first%>
|
|
|
|
<div class="cl"></div>
|
|
|
|
</div>
|
|
|
|
<div class="massages-content ml15">
|
2016-05-23 15:58:32 +08:00
|
|
|
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :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>
|
2016-05-16 16:57:18 +08:00
|
|
|
<span class="grayTxt">更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span>
|
2016-05-04 16:28:40 +08:00
|
|
|
<% count=0 %>
|
|
|
|
<% count=activity.comments.count %>
|
|
|
|
<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-29 13:42:58 +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-29 13:42:58 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
|
|
|
|
$(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);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|