summaryrefslogtreecommitdiff
path: root/app/views/clusters
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2018-11-07 14:06:33 +1300
committerThong Kuah <tkuah@gitlab.com>2018-11-08 23:28:30 +1300
commitb019224ff2bf6c8282a210eff1e98d0225e98a0c (patch)
tree61cb0f7bcce5fe41354abe68050133c61e3e5fdf /app/views/clusters
parent85066afb0ffc2ef973a459c23fbb7afa2f939390 (diff)
downloadgitlab-ce-b019224ff2bf6c8282a210eff1e98d0225e98a0c.tar.gz
Refactor to use presenter
Refacotr project or group specific `if` logic to be contained within each presenter instead. Also add :override to ensure super method exists.
Diffstat (limited to 'app/views/clusters')
-rw-r--r--app/views/clusters/clusters/_empty_state.html.haml7
-rw-r--r--app/views/clusters/clusters/_sidebar.html.haml13
2 files changed, 2 insertions, 18 deletions
diff --git a/app/views/clusters/clusters/_empty_state.html.haml b/app/views/clusters/clusters/_empty_state.html.haml
index 1cbff0a0e23..c926ec258f0 100644
--- a/app/views/clusters/clusters/_empty_state.html.haml
+++ b/app/views/clusters/clusters/_empty_state.html.haml
@@ -6,11 +6,8 @@
%h4.text-center= s_('ClusterIntegration|Integrate Kubernetes cluster automation')
%p
= s_('ClusterIntegration|Kubernetes clusters allow you to use review apps, deploy your applications, run your pipelines, and much more in an easy way.')
- - if clusterable.project?
- = link_to(s_('ClusterIntegration|Learn more about Kubernetes'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
- - else
- = s_('ClusterIntegration|Adding an integration to your group will share the cluster across all your projects.')
- = link_to(s_('ClusterIntegration|Learn more about group Kubernetes clusters'), help_page_path('user/project/clusters/index'), target: '_blank', rel: 'noopener noreferrer')
+ = clusterable.empty_state_help_text
+ = clusterable.learn_more_link
- if clusterable.can_create_cluster?
.text-center
diff --git a/app/views/clusters/clusters/_sidebar.html.haml b/app/views/clusters/clusters/_sidebar.html.haml
deleted file mode 100644
index 66cda3ee83b..00000000000
--- a/app/views/clusters/clusters/_sidebar.html.haml
+++ /dev/null
@@ -1,13 +0,0 @@
-- clusters_help_url = help_page_path('user/project/clusters/index.md')
-- help_link_start = "<a href=\"%{url}\" target=\"_blank\" rel=\"noopener noreferrer\">".html_safe
-- help_link_end = '</a>'.html_safe
-%h4.prepend-top-0
- = s_('ClusterIntegration|Add a Kubernetes cluster integration')
-- if clusterable.project?
- %p
- = s_('ClusterIntegration|With a Kubernetes cluster associated to this project, you can use review apps, deploy your applications, run your pipelines, and much more in an easy way.')
- %p
- = s_('ClusterIntegration|Learn more about %{help_link_start}Kubernetes%{help_link_end}.').html_safe % { help_link_start: help_link_start % { url: clusters_help_url }, help_link_end: help_link_end }
-- else
- %p
- = s_('ClusterIntegration|Adding a Kubernetes cluster to your group will automatically share the cluster across all your projects. Use review apps, deploy your applications, and easily run your pipelines for all projects using the same cluster.')