diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-13 20:06:51 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-16 23:51:22 +0300 |
commit | 7844fa1fc2e54de9b36f6bb2faa6d2f3385fc4f7 (patch) | |
tree | 053b42a3cce696ae37ed014f96cd3984b7a64b5a /app/helpers/blob_helper.rb | |
parent | 67312fceaa69abb2bc88aa62601625e9f6a62270 (diff) |
Add auxiliary viewer for CONTRIBUTING
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 7eb3512378c..622e14e21ff 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -278,4 +278,19 @@ module BlobHelper options end + + def contribution_options(project) + options = [] + + if can?(current_user, :create_issue, project) + options << link_to("submit an issue", new_namespace_project_issue_path(project.namespace, project)) + end + + merge_project = can?(current_user, :create_merge_request, project) ? project : (current_user && current_user.fork_of(project)) + if merge_project + options << link_to("create a merge request", new_namespace_project_merge_request_path(project.namespace, project)) + end + + options + end end |