diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 91743289a..c21446e86 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -92,6 +92,22 @@ module UsersHelper
end
end
+ # 单位申请消息:通过用户的状态判断
+ # status(0:申请消息;1,2,3:系统消息)
+ def applied_school_users applied_message
+ user = User.find(applied_message.applied_user_id)
+ end
+
+ # 单位申请消息通过状态判断tip描述
+ def applied_school_tip applied_message
+ case applied_message.status
+ when 1,2,3
+ "您添加新的单位:"
+ when 0
+ "申请了单位:"
+ end
+ end
+
def get_resource_origin attach
type = attach.container_type
content = attach.container
diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb
index 494489a95..eef6128f3 100644
--- a/app/views/users/_user_message_applied.html.erb
+++ b/app/views/users/_user_message_applied.html.erb
@@ -1,51 +1,24 @@
<% if ma.class == AppliedMessage %>
<% if ma.applied_type == "ApplyAddSchools" %>
- <% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 0 %>
-
- <% if ma.status == 1 || ma.status == 2 || ma.status == 3 %>
- <%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
- <% elsif ma.status == 0 %>
- <%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
+ <% if ma.status == 0 %>
+ <%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
+ <% else %>
+ <%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
<% end %>
-
- <% if ma.status == 1 %>
- 系统提示
- ">您添加新的单位:
-
-
- “<%= ma.name %>”的申请,已通过审核。谢谢!
-
- - <%= time_tag(ma.created_at).html_safe %>
- <% elsif ma.status == 2 %>
- 系统提示
- ">您添加新的单位:
- -
- “<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!
-
- - <%= time_tag(ma.created_at).html_safe %>
- <% elsif ma.status == 3 %>
- 系统提示
- ">您添加新的单位:
- -
- <%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
-
- - <%= time_tag(ma.created_at).html_safe %>
- <% elsif ma.status == 0 %>
- <%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
- "> 申请了单位:
- -
-
- <%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
-
- - <%= time_tag(ma.created_at).html_safe %>
- <% end %>
+ <%= render :partial => "users/user_message_applied_schools", :locals =>{:ma => ma} %>
+ -
+ <%= render :partial => "users/user_message_applied_school_action", :locals =>{:ma => ma} %>
+
+ - <%= time_tag(ma.created_at).html_safe %>
- <% end %>
<% elsif ma && ma.applied_type == "AppliedProject" %>
-
diff --git a/app/views/users/_user_message_applied_school_action.html.erb b/app/views/users/_user_message_applied_school_action.html.erb
new file mode 100644
index 000000000..b4b0cdb6d
--- /dev/null
+++ b/app/views/users/_user_message_applied_school_action.html.erb
@@ -0,0 +1,15 @@
+<% if ma.status == 1 %>
+
+ “<%= ma.name %>”的申请,已通过审核。谢谢!
+
+<% elsif ma.status == 2 %>
+
+ “<%= ma.applied.name %>”的申请,因名称不符合规范,系统已将其更改为“<%= ma.name %>”。谢谢!
+
+<% elsif ma.status == 3 %>
+ <%= link_to "“"+ma.name+"”" + "的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,经确认为无效的单位信息,已被删除,请重新编辑您的单位资料。谢谢!", :target => '_blank'%>
+<% elsif ma.status == 0 %>
+
+ <%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_message_applied_schools.html.erb b/app/views/users/_user_message_applied_schools.html.erb
new file mode 100644
index 000000000..9de70a03a
--- /dev/null
+++ b/app/views/users/_user_message_applied_schools.html.erb
@@ -0,0 +1,7 @@
+
+<% if ma.status != 0 %>
+ 系统提示
+<% else %>
+ <%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+<% end %>
+"><%= applied_school_tip(ma) %>
\ No newline at end of file