From f7e8c5232c0e80d908df7ad9304f7358b38d9a19 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 1 Aug 2016 09:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E9=A1=B9=E7=9B=AE=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E7=94=B3=E8=AF=B7=E4=BA=86=E5=88=99=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=B7=B2=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- app/controllers/applied_project_controller.rb | 2 ++ app/views/applied_project/_applied_project_tip.js.erb | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6e8a4dcdf..6ee66a592 100644 --- a/Gemfile +++ b/Gemfile @@ -50,7 +50,7 @@ gem 'elasticsearch-model' gem 'elasticsearch-rails' #rails 3.2.22.2 bug -gem "test-unit", "~>3.0" +# gem "test-unit", "~>3.0" ### profile # gem 'oneapm_rpm' diff --git a/app/controllers/applied_project_controller.rb b/app/controllers/applied_project_controller.rb index 539a974c1..883fd1c68 100644 --- a/app/controllers/applied_project_controller.rb +++ b/app/controllers/applied_project_controller.rb @@ -59,6 +59,8 @@ class AppliedProjectController < ApplicationController @flag = 2 elsif params[:member].nil? @flag = 3 + elsif !AppliedProject.where(:project_id => @project.id, :user_id => User.current.id).first.nil? + @flag = 5 else @flag = 4 role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5) diff --git a/app/views/applied_project/_applied_project_tip.js.erb b/app/views/applied_project/_applied_project_tip.js.erb index 56e5270d6..c2bc555db 100644 --- a/app/views/applied_project/_applied_project_tip.js.erb +++ b/app/views/applied_project/_applied_project_tip.js.erb @@ -15,6 +15,8 @@

请选择一个角色

<% elsif @flag == 4 %>

您的申请已提交,请等待项目管理员审批

+ <% elsif @flag == 5 %> +

您已经申请加入该项目了,请耐心等待

<% end %>