删除的个人主页报500

This commit is contained in:
cxt 2016-10-20 15:01:05 +08:00
parent 453e91dcfb
commit bee1597167
3 changed files with 17 additions and 40 deletions

View File

@ -3581,11 +3581,9 @@ class UsersController < ApplicationController
end
def homepage
if @user.base_homepage
@article = @user.base_homepage
respond_to do |format|
format.html {render :layout => 'clear_base'}
end
@article = @user.base_homepage
respond_to do |format|
format.html {render :layout => 'clear_base'}
end
end

View File

@ -1,50 +1,28 @@
<div class="homepageContentContainer" style="margin-top: 25px;">
<div class="homepageMainContent">
<div class="postRightContainer pr" style="padding: 25px 40px;">
<% if User.current && User.current == @article.user %>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="top: -25px;">
<% if User.current == @user %>
<div class="homepagePostSetting" style="top: -25px;">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to(l(:button_conf_base_homepage), user_homepages_path(:user_id=>@article.user_id), :class => 'postOptionLink' )%>
<%# if @article.id == @article.homepage.article_id %>
<%#= link_to(
l(:button_cancel_base_homepage),
{:controller => 'homepages',:action => 'cancel_homepage',:user_id=>@article.user_id,:id=>@article.homepage_id, :article_id => @article.id, :show => 1},
:method => :post,
:class => 'postOptionLink'
)%>
<%# else %>
<%#= link_to(
l(:button_set_base_homepage),
{:controller => 'homepages',:action => 'set_homepage',:user_id=>@article.user_id,:id=>@article.homepage_id, :article_id => @article.id, :show => 1},
:method => :post,
:class => 'postOptionLink'
) %>
<%# end %>
<%= link_to(l(:button_conf_base_homepage), user_homepages_path(:user_id=>@user.id), :class => 'postOptionLink' )%>
</li>
<!--<li>-->
<!--<%#= link_to(-->
<!--l(:button_edit),-->
<!--{:controller => 'article_homepages',:action => 'edit', :id => @article.id},-->
<!--:class => 'postOptionLink'-->
<!--) %>-->
<!--</li>-->
<!--<li>-->
<!--<%#= link_to(-->
<!--l(:button_delete),-->
<!--{:controller => 'article_homepages',:action => 'destroy', :id => @article.id},-->
<!--:method => :delete,-->
<!--:data => {:confirm => l(:text_are_you_sure)},-->
<!--:class => 'postOptionLink'-->
<!--) %>-->
<!--</li>-->
</ul>
</li>
</ul>
</div>
<% end %>
<% if @article.nil? %>
<% if User.current == @user && @user.homepage.article_homepages.empty? %>
<p class="nodata mt10" style="text-align: left;">您还没有创建属于自己的个人主页。<%=link_to '新建', new_user_homepage_article_homepage_path(:user_id=> @user.id, :homepage_id => @user.homepage.id), :target => "_blank", :class => 'linkBlue' %></p>
<% elsif User.current == @user %>
<p class="nodata mt10 mb0" style="text-align: left;">您还没有设置个人主页,其他用户无法查看哦</p>
<% else %>
<p class="nodata mt10 mb0" style="text-align: left;">该用户还未设置个人主页</p>
<% end %>
<% else %>
<div class="cl"></div>
<div class="postThemeContainer">
<div class="postDetailPortrait">
@ -64,6 +42,7 @@
<div class="break_word mt10" style="padding: 5px 5px 0 0" id="intro_content">
<%=@article.content.html_safe %>
</div>
<% end %>
</div>
</div>
</div>

View File

@ -2,7 +2,7 @@
<% if User.current.logged?%>
<% if User.current == target%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;"><%= link_to("编辑基本资料", my_account_path, :class => "user_editinfo") %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user.login), :class => "user_editinfo" %></li>
<li style="width: 118px; float: left;"><%= link_to '个人主页', homepage_user_path(@user.login), :class => "user_editinfo", :target => '_blank' %></li>
<li class="cl"></li>
<% else%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;">