socialforge/app/views/homepages/_article_list.html.erb

71 lines
3.6 KiB
Plaintext

<div class="cl"> </div>
<div id="blog-list">
<div class="listbox mt10">
<div class="category" style="padding: 5px 0;">
<span class="grayTxt">排序:</span>
<%= link_to "时间", {:controller => 'homepages', :action => 'index', :user_id =>@user.id, :sort => @b_sort}, :class => "sortTxt", :remote => true %>
<%= link_to "", {:controller => 'homepages', :action => 'index', :user_id =>@user.id, :sort => @b_sort}, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
<div class="fr">
<%=link_to '新 建', new_article_homepage_path(), :target => "_blank", :class => 'BlueCirBtnMiddle', :style => 'margin-right: 0;' %>
</div>
<div class="cl"></div>
</div>
<div class="bloglistbox">
<% if @articles.any? %>
<% @articles.each do |activity| %>
<ul class="list-file pr" onmouseover='$("#message_setting_<%= activity.id%>").show();' onmouseout='$("#message_setting_<%= activity.id%>").hide();'>
<li><span class="item_list fl"></span>
<% if activity.homepage.article_id and activity.id == activity.homepage.article_id %>
<%= link_to activity.title.to_s.html_safe, homepage_user_path(activity.user.login), :class=> "list-title fl", :target => '_blank' %>
<span class="red_homework_btn_cir ml5">主页</span>
<% else %>
<%= link_to activity.title.to_s.html_safe, user_homepage_show_path(:user_id=>activity.user_id,:id=>activity), :class=> "list-title fl", :target => '_blank' %>
<% end %>
<div class="cl"></div>
</li>
<li class="ml15">
<span class="grayTxt fl">更新:<%= format_time(activity.updated_at) %></span>
<div>
<%= link_to(
l(:button_delete),
{:controller => 'article_homepages',:action => 'destroy', :id => activity.id},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'fr'
) if User.current.admin? || User.current.id == activity.user_id %>
<%= link_to(
l(:button_edit),
{:controller => 'article_homepages',:action => 'edit', :id => activity.id},
:class => 'fr mr10'
) if User.current.admin? || User.current.id == activity.user_id %>
<div class="cl"></div>
</div>
</li>
<div class="cl"></div>
</ul>
<% end %>
<div>
<ul class="wlist" id="pages" >
<%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
</ul>
<div class="cl"></div>
</div>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
</div>
</div>
</div>
<script type="text/javascript">
//如果右边的博客列表比左边的高度低则将右边的高度设为与左边对齐
$(function() {
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 10;
var rightHeight = $(".homepageRight").height();
if (rightHeight < leftHeight) {
var diffHeight = leftHeight - rightHeight;
var tmpHeight = $(".listbox").height() + diffHeight;
$(".listbox").css("height", tmpHeight);
}
});
</script>