个人主页报错

This commit is contained in:
sw 2015-08-25 15:35:45 +08:00
parent c8b1bb5d64
commit e2af9e26f8
3 changed files with 13 additions and 17 deletions

View File

@ -54,7 +54,7 @@
<%= link_to "<div class='mt5 mb8'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%> <%= link_to "<div class='mt5 mb8'>#{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe,user_activities_path(User.current.id)%>
<ul class="topnav_login_list"> <ul class="topnav_login_list">
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li> <li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li> <!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li> <li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
</ul> </ul>
</li> </li>

View File

@ -36,7 +36,7 @@
<div class="homepagePostReply"> <div class="homepagePostReply">
<div class="homepagePostReplyBanner"> <div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复(<%=activity.comments_count %></div> <div class="homepagePostReplyBannerCount">回复(<%=activity.comments_count %></div>
<div class="homepagePostReplyBannerTime"><%=format_date(activity.updated_on)%></div> <div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a> <div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a>
</div> </div>
</div> </div>

View File

@ -27,31 +27,27 @@
</div> </div>
<% @user_activities.each do |user_activity| <% @user_activities.each do |user_activity|
unless @user_activities.nil? %> unless @user_activities.nil? %>
<% act= user_activity.act %>
<% case user_activity.act_type.to_s %> <% case user_activity.act_type.to_s %>
<% when 'CourseActivity' %> <% when 'CourseActivity' %>
<% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first %> <% if act %>
<% unless @course_act.nil? %> <% activity= act.course_act %>
<% case @course_act.course_act_type.to_s %> <% case act.course_act_type.to_s %>
<% when 'HomeworkCommon' %> <% when 'HomeworkCommon' %>
<% @activity=HomeworkCommon.where("id=#{@course_act.course_act_id}").first %> <%= render :partial => 'course_homework', :locals => {:activity => activity,:user_activity =>user_activity} %>
<%= render :partial => 'course_homework', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% when 'News' %> <% when 'News' %>
<% @activity=News.where("id=#{@course_act.course_act_id}").first %> <%= render :partial => 'course_news', :locals => {:activity => activity,:user_activity =>user_activity} %>
<%= render :partial => 'course_news', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% when 'Message'%> <% when 'Message'%>
<% @activity=Message.where("id=#{@course_act.course_act_id}").first %> <%= render :partial => 'course_message', :locals => {:activity => activity,:user_activity =>user_activity} %>
<%= render :partial => 'course_message', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% end %> <% end %>
<% end %> <% end %>
<% when 'ForgeActivity' %> <% when 'ForgeActivity' %>
<% @project_act= ForgeActivity.where("id=#{user_activity.act_id}").first %> <% activity= act.forge_act unless act.forge_act_type == "ProjectCreateInfo" %>
<% case @project_act.forge_act_type.to_s %> <% case act.forge_act_type.to_s %>
<% when 'Issue' %> <% when 'Issue' %>
<% @activity=Issue.where("id=#{@project_act.forge_act_id}").first %> <%= render :partial => 'project_issue', :locals => {:activity => activity,:user_activity =>user_activity} %>
<%= render :partial => 'project_issue', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% when 'Message' %> <% when 'Message' %>
<% @activity=Message.where("id=#{@project_act.forge_act_id}").first %> <%= render :partial => 'project_message', :locals => {:activity => activity,:user_activity =>user_activity} %>
<%= render :partial => 'project_message', :locals => {:activity => @activity,:user_activity =>user_activity} %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>