个人主页加入项目,如果已经申请了则提示已申请

This commit is contained in:
huang 2016-08-01 09:50:05 +08:00
parent 30ce469483
commit f7e8c5232c
3 changed files with 5 additions and 1 deletions

View File

@ -50,7 +50,7 @@ gem 'elasticsearch-model'
gem 'elasticsearch-rails' gem 'elasticsearch-rails'
#rails 3.2.22.2 bug #rails 3.2.22.2 bug
gem "test-unit", "~>3.0" # gem "test-unit", "~>3.0"
### profile ### profile
# gem 'oneapm_rpm' # gem 'oneapm_rpm'

View File

@ -59,6 +59,8 @@ class AppliedProjectController < ApplicationController
@flag = 2 @flag = 2
elsif params[:member].nil? elsif params[:member].nil?
@flag = 3 @flag = 3
elsif !AppliedProject.where(:project_id => @project.id, :user_id => User.current.id).first.nil?
@flag = 5
else else
@flag = 4 @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)

View File

@ -15,6 +15,8 @@
<p>请选择一个角色</p> <p>请选择一个角色</p>
<% elsif @flag == 4 %> <% elsif @flag == 4 %>
<p>您的申请已提交,请等待项目管理员审批</p> <p>您的申请已提交,请等待项目管理员审批</p>
<% elsif @flag == 5 %>
<p>您已经申请加入该项目了,请耐心等待</p>
<% end %> <% end %>
</li> </li>
<li> <li>