From 153efb7edabfd3afb228ba15524fef85c3ccdaf8 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 29 Jul 2016 19:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_join_exit_project.html.erb | 10 +++------- app/views/projects/_applied_status.html.erb | 9 +++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 app/views/projects/_applied_status.html.erb diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index d39d3d67b..7d2f1b4d2 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -1,12 +1,8 @@
- <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %> - <%= watcher_link_for_project(@project, User.current) %> - - - <%= join_in_project_link(@project, User.current) %> - - <% end %> +
+ <%= render :partial => "projects/applied_status" %> +
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %> <%= link_to "#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %> diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb new file mode 100644 index 000000000..d29819c03 --- /dev/null +++ b/app/views/projects/_applied_status.html.erb @@ -0,0 +1,9 @@ +<% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %> + <%= watcher_link_for_project(@project, User.current) %> + + <% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %> + <%= join_in_project_link(@project, User.current) %> + <% else %> + 等待审批 + <% end %> +<% end %> \ No newline at end of file