From 23bb0103157c7b29b73cdf17f3957546ff3394f3 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 29 Jul 2016 22:49:39 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E8=B5=84=E6=BA=90=E6=95=B0=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_courses_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_courses_list.html.erb b/app/views/users/_courses_list.html.erb index 1abe77b81..83b9ab56b 100644 --- a/app/views/users/_courses_list.html.erb +++ b/app/views/users/_courses_list.html.erb @@ -13,7 +13,7 @@

更新:<%=format_date Time.at(course.updatetime) %>学期:<%=current_time_and_term(course) %>

-

<%=studentCount course %>学生|<%=visable_course_homework course %>作业|<%=visable_attachemnts_incourse(@course).count %>资源

+

<%=studentCount course %>学生|<%=visable_course_homework course %>作业|<%=visable_attachemnts_incourse(course).count %>资源

From 97288d4eb499e3e1a610bf338f2734e58f512f9d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 22:51:13 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/applied_project/_applied_join_project.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/applied_project/_applied_join_project.html.erb b/app/views/applied_project/_applied_join_project.html.erb index 457cdf9cc..e2c447992 100644 --- a/app/views/applied_project/_applied_join_project.html.erb +++ b/app/views/applied_project/_applied_join_project.html.erb @@ -19,8 +19,8 @@
  • - - + + 确  定 取  消
  • From b1fd7048fed572a84cf9e0b7eff3224f7b3e8327 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 22:58:24 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E6=8A=A5=E5=91=8A=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/applied_project_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/applied_project_controller.rb b/app/controllers/applied_project_controller.rb index d779c7759..49ba03eda 100644 --- a/app/controllers/applied_project_controller.rb +++ b/app/controllers/applied_project_controller.rb @@ -61,7 +61,7 @@ class AppliedProjectController < ApplicationController @flag = 3 else @flag = 4 - role = params[:member] == "member_manager" ? 3 : (params[:member] = "member_developer" ? 4 :5) + role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5) applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => @project.id, :role => role) # 申请成功则给项目管理员发送邮件及发送消息 Mailer.run.applied_project(applied_project) From 21eed9ebb39331e806ffbc2d61db8a7944bc5a63 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 23:03:18 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=90=8C=E6=84=8F?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=E2=80=9C=EF=BC=9A=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_applide_action.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_message_applide_action.html.erb b/app/views/users/_user_message_applide_action.html.erb index fc56b9f22..48e479b22 100644 --- a/app/views/users/_user_message_applide_action.html.erb +++ b/app/views/users/_user_message_applide_action.html.erb @@ -1,5 +1,5 @@ <% if allow_to_show(ma) %> - :<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> | + <%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> | <%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %> <% elsif ma.status == 4 %> 被拒绝 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 5/9] =?UTF-8?q?=E5=8D=95=E4=BD=8D=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=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 %>