From d6178ec7dd2a1be954ddf9b2380274d858cc4eb6 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Fri, 29 Jul 2016 21:45:52 +0800
Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C=E9=9D=A2?=
=?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=94=B3=E8=AF=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/school_controller.rb | 2 +-
app/models/applied_message.rb | 3 ++-
app/views/admin/applied_schools.html.erb | 2 +-
app/views/admin/has_applied_schools.html.erb | 2 +-
app/views/users/_user_message_applied.html.erb | 10 ++++++----
5 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb
index b927b1108..037fdd411 100644
--- a/app/controllers/school_controller.rb
+++ b/app/controllers/school_controller.rb
@@ -191,7 +191,7 @@ class SchoolController < ApplicationController
# status=4 向管理员发送信息
users = User.where(:admin => 1)
users.each do |user|
- AppliedMessage.create(:user_id => user.id, :status => 4, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
+ AppliedMessage.create(:user_id => user.id, :status => 4, :applied_user_id => User.current.id, :viewed => true, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
end
else
data[:result] = 3
diff --git a/app/models/applied_message.rb b/app/models/applied_message.rb
index c008a2284..2e8891fcd 100644
--- a/app/models/applied_message.rb
+++ b/app/models/applied_message.rb
@@ -1,6 +1,7 @@
class AppliedMessage < ActiveRecord::Base
# status: 0表示未批准; status:1表示已批准; status: 2表示已拒绝
- attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name belongs_to :applied ,:polymorphic => true
+ attr_accessible :applied_id, :applied_type, :status, :user_id, :viewed, :applied_user_id, :role, :project_id, :name
+ belongs_to :applied ,:polymorphic => true
belongs_to :apply_add_schools
belongs_to :user
has_many :message_alls, :class_name => 'MessageAll', :as =>:message, :dependent => :destroy
diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb
index 507cb7c49..518624b5f 100644
--- a/app/views/admin/applied_schools.html.erb
+++ b/app/views/admin/applied_schools.html.erb
@@ -59,7 +59,7 @@
<% user = User.where("id=?", apply.user_id).first %>
<% unless user.nil? %>
- <%= user.login %>
+ <%=link_to user.show_name, user_path(user) %>
<% end %>
|
diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb
index 555dce689..286edbd19 100644
--- a/app/views/admin/has_applied_schools.html.erb
+++ b/app/views/admin/has_applied_schools.html.erb
@@ -65,7 +65,7 @@
|
<% user = User.where("id=?", apply.user_id).first %>
<% unless user.nil? %>
- <%= user.login %>
+ <%=link_to user.show_name, user_path(user) %>
<% end %>
|
diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb
index b2735f32a..d52e4c2c8 100644
--- a/app/views/users/_user_message_applied.html.erb
+++ b/app/views/users/_user_message_applied.html.erb
@@ -1,6 +1,7 @@
<% if ma.class == AppliedMessage %>
<% if ma.applied_type == "ApplyAddSchools" %>
+ <% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 4 %>
-
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
@@ -10,21 +11,21 @@
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">您添加新的高校(单位):
-
- <%= ma.name %>的申请,已通过
+ <%= ma.name %>的申请,已通过
- <%= time_tag(ma.created_at).html_safe %>
<% elsif ma.status == 2 %>
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">您添加新的高校(单位):
-
- <%= ma.applied.name %>的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”
+ <%= ma.applied.name %>的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”
- <%= time_tag(ma.created_at).html_safe %>
<% elsif ma.status == 3 %>
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">您添加新的高校(单位):
-
- <%= link_to ma.name + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" } %>
+ <%= link_to ma.name + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "#{ma.name}的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料" %>
- <%= time_tag(ma.created_at).html_safe %>
<% elsif ma.status == 4 %>
@@ -32,12 +33,13 @@
">
-
- <%= User.where("id=?", ma.user_id).first.login %>提交了申请:添加新的单位“<%= ma.name %>”
+ <%= 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 %>
+ <% end %>
<% elsif ma && ma.applied_type == "AppliedProject" %>
|