From 8530abf7694fab45c8b85203e8cfef113c7aa6cf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 16 Sep 2014 11:11:40 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=202.=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=85=A5=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=BA=BA=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E5=90=8D=E5=AD=97=E4=BB=8D=E6=98=AF?= =?UTF-8?q?"=E6=88=91"=E7=9A=84BUG=20#1251=20=E8=A7=A3=E5=86=B3=E6=96=B9?= =?UTF-8?q?=E6=A1=88=EF=BC=9A=E5=A2=9E=E5=8A=A0=E8=AE=BF=E9=97=AE=E7=94=A8?= =?UTF-8?q?=E6=88=B7ID=E5=92=8C=E5=BD=93=E5=89=8D=E7=99=BB=E5=BD=95Id?= =?UTF-8?q?=E6=98=AF=E4=B8=8D=E6=98=AF=E4=B8=80=E8=87=B4=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 490 ++++++++++++++++++++++------------ 1 file changed, 318 insertions(+), 172 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 551f7e724..bc485325c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,61 +1,72 @@ - <% if User.current.id == @user.id %> -
+
+ <%= text_field_tag 'user', params[:user], :size => 30 %>
+ <%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
+
+ |
+
-
- <%= text_field_tag 'user', params[:user], :size => 30 %>
- <%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
-
- |
-
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %> | -
+<% unless @state == 2 %>
+ <% unless @activity.empty? %>
+
+ <% @activity.each do |e| %>
+ <%# 以下一行代码解决有未知的活动无法转换成Model报错%>
+ <% (Rails.logger.error "[Error] =========================================================> NameError: uninitialized constant " + e.act_type.to_s; next;) if e.act_type.safe_constantize.nil? %>
+ <% act = e.act %>
+ <% unless act.nil? %>
+ <% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
+
-
-
- <% else %>
- <% if @user == User.current %>
- <%= l(:label_user_activities) %>
- <% else %>
-
- <%= l(:label_user_activities_other) %> - - <% end %> - <% end %> - - <% else %> - <% unless @message.empty? %> -
- <% @message.each do |e| -%>
-
-
-
-
-
+
|
<%= l(:label_no_user_respond_you) %>
++ <%= l(:label_user_activities_other) %> +
<% end %> + <% end %> + +<% else %> + <% unless @message.empty? %> +<%= image_tag(url_to_avatar(e.user), :class => "avatar") %> | +
+
|
+
<%= l(:label_no_user_respond_you) %>
<% end %> - + }); +