博客设为首页后,显示在个人主页处
This commit is contained in:
parent
25a24f72e5
commit
2f5ada2d7b
|
@ -26,12 +26,21 @@
|
||||||
) if User.current && User.current.id == activity.author.id %>
|
) if User.current && User.current.id == activity.author.id %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to(
|
<% if activity.id == activity.blog.homepage_id %>
|
||||||
l(:button_set_homepage),
|
<%= link_to(
|
||||||
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
l(:button_cancel_homepage),
|
||||||
:method => :post,
|
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||||
:class => 'postOptionLink'
|
:method => :post,
|
||||||
) if User.current && User.current.id == activity.blog.author_id %>
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.blog.author_id %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to(
|
||||||
|
l(:button_set_homepage),
|
||||||
|
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
|
||||||
|
:method => :post,
|
||||||
|
:class => 'postOptionLink'
|
||||||
|
) if User.current && User.current.id == activity.blog.author_id %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -43,11 +43,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if blog.homepage_id and BlogComment.where("id=?", blog.homepage_id).count > 0 %>
|
|
||||||
<% homepage = BlogComment.find(blog.homepage_id) %>
|
|
||||||
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if User.current.logged? && User.current.id == @user.id %>
|
<% if User.current.logged? && User.current.id == @user.id %>
|
||||||
<%= labelled_form_for @article, :url =>{:controller=>'blog_comments',:action => 'create',:user_id=>user.id , :blog_id => blog.id},
|
<%= labelled_form_for @article, :url =>{:controller=>'blog_comments',:action => 'create',:user_id=>user.id , :blog_id => blog.id},
|
||||||
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
<%end%>
|
<%end%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostTitle hidden m_w530 fl">
|
<div class="homepagePostTitle hidden m_w530">
|
||||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id,
|
<%= 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=> "postGrey", :style => 'text-align:center;' %>
|
:blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey", :style => 'text-align:center;' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -40,4 +40,10 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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 %>
|
||||||
|
|
||||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>
|
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>
|
||||||
|
|
Loading…
Reference in New Issue