summaryrefslogtreecommitdiff
path: root/app/views/projects/merge_requests/widget/_heading.html.haml
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-20 22:42:07 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-21 10:23:16 +0200
commitd891051cd24e8ef15ed091e16bf80925c08907d6 (patch)
tree0dff49598d2995bbbf554c3fec6c0fd6700ab595 /app/views/projects/merge_requests/widget/_heading.html.haml
parent5416ab8a0df000bfa9f853840d44d992a975db83 (diff)
downloadgitlab-ce-d891051cd24e8ef15ed091e16bf80925c08907d6.tar.gz
Limit number of shown environments for Merge Requests
- For target project show only environments for target branch or with tags - For source project show only environments for source branch
Diffstat (limited to 'app/views/projects/merge_requests/widget/_heading.html.haml')
-rw-r--r--app/views/projects/merge_requests/widget/_heading.html.haml23
1 files changed, 12 insertions, 11 deletions
diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml
index 494695a03a5..d8b19d8c951 100644
--- a/app/views/projects/merge_requests/widget/_heading.html.haml
+++ b/app/views/projects/merge_requests/widget/_heading.html.haml
@@ -44,14 +44,15 @@
Could not connect to the CI server. Please check your settings and try again.
- @merge_request.environments.each do |environment|
- .mr-widget-heading
- .ci_widget.ci-success
- = ci_icon_for_status("success")
- %span.hidden-sm
- Deployed to
- = succeed '.' do
- = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment), class: 'environment'
- - external_url = environment.external_url
- - if external_url
- = link_to external_url, target: '_blank' do
- = icon('external-link', text: "View on #{external_url.gsub(/\A.*?:\/\//, '')}", right: true)
+ - if can?(current_user, :read_environment, environment)
+ .mr-widget-heading
+ .ci_widget.ci-success
+ = ci_icon_for_status("success")
+ %span.hidden-sm
+ Deployed to
+ = succeed '.' do
+ = link_to environment.name, namespace_project_environment_path(@project.namespace, @project, environment), class: 'environment'
+ - external_url = environment.external_url
+ - if external_url
+ = link_to external_url, target: '_blank' do
+ = icon('external-link', text: "View on #{external_url.gsub(/\A.*?:\/\//, '')}", right: true)