From db690bedab1e27605b6263de4870195ef7912f61 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Fri, 29 Jul 2016 23:22:32 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 12 ++++++----
app/views/admin/applied_schools.html.erb | 11 ++++++----
app/views/admin/has_applied_schools.html.erb | 15 ++++++++-----
.../users/_user_message_applied.html.erb | 22 ++++++++++++-------
4 files changed, 38 insertions(+), 22 deletions(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 7602b10a5..935ca1d71 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -615,8 +615,10 @@ class AdminController < ApplicationController
# 获取申请的高校列表
# status: 0 未审批; 1 已批阅;
def applied_schools
- @name = params[:name]
- @apply_status = ApplyAddSchools.where(:status => 0).order('created_at desc')
+ @name = params[:name] || ""
+ condition = "#{@name.strip}".gsub(" ","")
+
+ @apply_status = ApplyAddSchools.where("status = 0 and name like '%#{condition}%'").order('created_at desc')
@apply_count = @apply_status.count
@apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
@@ -629,8 +631,10 @@ class AdminController < ApplicationController
end
def has_applied_schools
- @name = params[:name]
- @has_apply_status = ApplyAddSchools.where("status = 1 or status = 2").order('created_at desc')
+ @name = params[:name] || ""
+ condition = "#{@name.strip}".gsub(" ","")
+
+ @has_apply_status = ApplyAddSchools.where("(status = 1 or status = 2) and name like '%#{condition}%'").order('created_at desc')
@has_apply_count = @has_apply_status.count
@has_apply_pages = Paginator.new @has_apply_count, 30, params['page'] || 1
diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb
index c9ebdfb66..2f139ca72 100644
--- a/app/views/admin/applied_schools.html.erb
+++ b/app/views/admin/applied_schools.html.erb
@@ -53,14 +53,14 @@
<%= apply.id %>
|
-
- <%= apply.name %>
+ |
+ <%= apply.name %>
|
<% user = User.where("id=?", apply.user_id).first %>
<% unless user.nil? %>
- <%=link_to user.show_name, user_path(user) %>
+ <%=link_to user.show_name, user_path(user),:target => '_blank' %>
<% end %>
|
@@ -141,4 +141,7 @@
<% end %>
-
\ No newline at end of file
+
+
+ <%= pagination_links_full @apply_pages, @apply_count ,:per_page_links => true, :remote => false, :flag => true %>
+
\ No newline at end of file
diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb
index b0419bcab..5be3517c8 100644
--- a/app/views/admin/has_applied_schools.html.erb
+++ b/app/views/admin/has_applied_schools.html.erb
@@ -23,7 +23,7 @@
|
序号
|
-
+ |
单位名称
|
@@ -41,7 +41,7 @@
|
用户
|
-
+ |
创建时间
|
@@ -56,7 +56,7 @@
|
<%= apply.id %>
|
-
+ |
<% unless apply.school_id.nil? %>
<% school_name = School.where("id=?", apply.school_id).first %>
<%= school_name %>
@@ -64,9 +64,9 @@
<% end %>
|
- <% user = User.where("id=?", apply.user_id).first %>
+ <% user = User.where("id=?", apply.user_id).first%>
<% unless user.nil? %>
- <%=link_to user.show_name, user_path(user) %>
+ <%=link_to user.show_name, user_path(user), :target => '_blank'%>
<% end %>
|
@@ -137,4 +137,7 @@
<% end %>
-
\ No newline at end of file
+
+
+ <%= pagination_links_full @has_apply_pages, @has_apply_count ,:per_page_links => true, :remote => false, :flag => true %>
+
\ No newline at end of file
diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb
index e6fcfb25d..dd1b787fd 100644
--- a/app/views/users/_user_message_applied.html.erb
+++ b/app/views/users/_user_message_applied.html.erb
@@ -4,33 +4,39 @@
<% 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' %>
+
+ <% 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 == 4 %>
+ <%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
+ <% end %>
+
-
<% if ma.status == 1 %>
- <%=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 %>”
- <%= 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" }, :title => "#{ma.name}的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料" %>
+ <%= link_to ma.name + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "#{ma.name}的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", :target => '_blank'%>
- <%= time_tag(ma.created_at).html_safe %>
<% elsif ma.status == 4 %>
- <%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
- ">
+ <%=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}”" %>
|