隐藏博客首页

This commit is contained in:
cxt 2016-10-19 18:07:19 +08:00
parent e102815f60
commit 800aaf8853
4 changed files with 24 additions and 24 deletions

View File

@ -59,23 +59,23 @@
:class => 'postOptionLink'
) if User.current.admin? || User.current.id == @article.author.id %>
</li>
<li>
<% if @article.id == @article.blog.homepage_id %>
<%= link_to(
l(:button_cancel_homepage),
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id},
:method => :post,
:class => 'postOptionLink'
<!--<li>-->
<!--<%# if @article.id == @article.blog.homepage_id %>-->
<%#= link_to(
# l(:button_cancel_homepage),
# {:controller => 'blogs',:action => 'cancel_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id},
# :method => :post,
# :class => 'postOptionLink'
) if User.current && User.current.id == @article.blog.author_id %>
<% else %>
<%= link_to(
l(:button_set_homepage),
{:controller => 'blogs',:action => 'set_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id},
:method => :post,
:class => 'postOptionLink'
<!--<%# else %>-->
<%#= link_to(
# l(:button_set_homepage),
# {:controller => 'blogs',:action => 'set_homepage',:user_id=>@article.author_id,:id=>@article.blog_id, :article_id => @article.id},
# :method => :post,
# :class => 'postOptionLink'
) if User.current && User.current.id == @article.blog.author_id %>
<% end %>
</li>
<!--<%# end %>-->
<!--</li>-->
</ul>
</li>
</ul>

View File

@ -25,9 +25,9 @@
<% 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=> "list-title fl"%>
<% end %>
<% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<span class="font_normal ml10 fr">[已设为首页]</span>
<% end %>
<%# if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
<!--<span class="font_normal ml10 fr">[已设为首页]</span>-->
<%# end %>
<% if activity.sticky == 1 %>
<span class="fl ml10 red-cir-btn">顶</span>
<% end%>

View File

@ -93,9 +93,9 @@
<%# cache (act) do %>
<% case user_activity.act_type.to_s %>
<% when 'BlogComment' %>
<% if !(act.blog.homepage_id and act.id == act.blog.homepage_id) %>
<%# if !(act.blog.homepage_id and act.id == act.blog.homepage_id) %>
<%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
<% end %>
<%# end %>
<% end %>
<%# end %>
<% end %>

View File

@ -44,8 +44,8 @@
</div>
<!--显示个人主页-->
<% if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<% end %>
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>