summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-12-22 19:30:32 +0000
committerStan Hu <stanhu@gmail.com>2015-12-22 19:30:32 +0000
commit3b61dc47ec377b857b66f9b2a81a183276163f4e (patch)
treeb125241794a7d7143628dd685b1e8682c8586cc1 /app/helpers
parent1cf45407d3be9e9767d27e55b6f3e2e0d8dea36f (diff)
parent66a8281fddf8e4f9d39265a6bfb38e8a6a8309c2 (diff)
downloadgitlab-ce-3b61dc47ec377b857b66f9b2a81a183276163f4e.tar.gz
Merge branch 'fix_leave_project_display' into 'master'
Fix and test leave project display The 'Leave this project' display on project page was broken. It was calling the method incorrectly, which returned `nil` and displayed nothing. This fixes the display and also adds 2 different tests for it. cc/ @jvanbaarsen @stanhu Please review and merge if you think it looks good. Thank you! See merge request !2166
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/projects_helper.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 777817e24aa..77ba612548a 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -105,6 +105,14 @@ module ProjectsHelper
end
end
+ def user_max_access_in_project(user_id, project)
+ level = project.team.max_member_access(user_id)
+
+ if level
+ Gitlab::Access.options_with_owner.key(level)
+ end
+ end
+
private
def get_project_nav_tabs(project, current_user)
@@ -277,14 +285,6 @@ module ProjectsHelper
end
end
- def user_max_access_in_project(user, project)
- level = project.team.max_member_access(user)
-
- if level
- Gitlab::Access.options_with_owner.key(level)
- end
- end
-
def leave_project_message(project)
"Are you sure you want to leave \"#{project.name}\" project?"
end