diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 0b813c4a7..cc0825652 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -26,12 +26,21 @@ ) if User.current && User.current.id == activity.author.id %>
  • - <%= 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 %> + <% if activity.id == activity.blog.homepage_id %> + <%= link_to( + l(:button_cancel_homepage), + {:controller => 'blogs',:action => 'cancel_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 %> + <% 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 %>
  • diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb index 182db9dd0..ca85c0ba2 100644 --- a/app/views/blogs/_article_list.html.erb +++ b/app/views/blogs/_article_list.html.erb @@ -43,11 +43,6 @@ - <% 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 %> <%= 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| %> diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb index 30e1b69a5..99835c87d 100644 --- a/app/views/blogs/_homepage.html.erb +++ b/app/views/blogs/_homepage.html.erb @@ -36,7 +36,7 @@ <%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} %>