From be9beff0b49c4dcf701c005711ad63fccfb36978 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Apr 2015 15:39:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3Roles=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_join_exit_project.html.erb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index 1d302babf..50c319328 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -1,19 +1,23 @@
- <% if ( !(User.current.member_of? @project) && User.current.login?) %> + <% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %> <%= watcher_link_for_project(@project, User.current) %> <% end %> - <% if ( !(User.current.member_of? @project) && User.current.login?) %> + <% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %> <%= join_in_project_link(@project, User.current) %> <% end %> - + <% 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" %> <% end %> - <% if Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s.include?("Manager") || User.current.admin? %> + + <% if Member.where(:project_id => @project.id).first.roles.first.to_s.include?("Manager") || User.current.admin? %> <%= link_to "#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%> - <% else %> + <% end %> + + <% if (User.current.member_of? @project) && User.current.login? && + Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager" %> <%= exit_project_link(@project) %> <% end %>
From e7d85aad2717849125f9140c31ac6a277534762d Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 27 Apr 2015 16:54:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E3=80=81=E5=85=B3=E6=B3=A8=E3=80=81=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E3=80=81=E7=B1=BB=E5=9E=8B=E7=AD=89=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_join_exit_project.html.erb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index 50c319328..9cd376c60 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -1,10 +1,10 @@
- - <% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %> + + <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %> <%= watcher_link_for_project(@project, User.current) %> <% end %> - <% if ( !(User.current.member_of? @project) && User.current.login?) && !User.current.admin %> + <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %> <%= join_in_project_link(@project, User.current) %> <% end %> @@ -12,12 +12,13 @@ <%= link_to "#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %> <% end %> - <% if Member.where(:project_id => @project.id).first.roles.first.to_s.include?("Manager") || User.current.admin? %> + <% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager")) || User.current.admin? %> <%= link_to "#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%> <% end %> <% if (User.current.member_of? @project) && User.current.login? && - Member.where(:user_id => User.current.id, :project_id=>@project.id).first.roles.first.to_s != "Manager" %> + Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %> <%= exit_project_link(@project) %> <% end %> +