diff options
author | Matija Čupić <matteeyah@gmail.com> | 2017-12-05 17:09:04 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2017-12-05 17:09:04 +0100 |
commit | 83648f243d6a1798b89eb7959c179d9fbd159c85 (patch) | |
tree | 8db502a5f1d4873758db6fc3d953c5d329aac614 /app/views | |
parent | 2eb41b5a420d3c755566f23a5839c1b9f2014ba8 (diff) | |
download | gitlab-ce-83648f243d6a1798b89eb7959c179d9fbd159c85.tar.gz |
Move can_toggle_cluster? from helper to presenter
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/clusters/_cluster.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/clusters/index.html.haml | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/views/projects/clusters/_cluster.html.haml b/app/views/projects/clusters/_cluster.html.haml index d292d68386c..18ca01d2d49 100644 --- a/app/views/projects/clusters/_cluster.html.haml +++ b/app/views/projects/clusters/_cluster.html.haml @@ -13,9 +13,9 @@ .table-mobile-header{ role: "rowheader" } .table-mobile-content %button{ type: "button", - class: "js-toggle-cluster-list project-feature-toggle #{'is-checked' if cluster.enabled?} #{'is-disabled' if !can_toggle_cluster?(cluster)}", + class: "js-toggle-cluster-list project-feature-toggle #{'is-checked' if cluster.enabled?} #{'is-disabled' if !cluster.can_toggle_cluster?}", "aria-label": s_("ClusterIntegration|Toggle Cluster"), - disabled: !can_toggle_cluster?(cluster), + disabled: !cluster.can_toggle_cluster?, data: { "enabled-text": s_("ClusterIntegration|Active"), "disabled-text": s_("ClusterIntegration|Inactive"), endpoint: namespace_project_cluster_path(@project.namespace, @project, cluster, format: :json) } } diff --git a/app/views/projects/clusters/index.html.haml b/app/views/projects/clusters/index.html.haml index 4dd956971ae..104e39b0e06 100644 --- a/app/views/projects/clusters/index.html.haml +++ b/app/views/projects/clusters/index.html.haml @@ -14,7 +14,7 @@ = s_("ClusterIntegration|Project namespace") .table-section.section-10{ role: "rowheader" } - @clusters.each do |cluster| - = render "cluster", cluster: cluster + = render "cluster", cluster: cluster.present(current_user: current_user) = paginate @clusters, theme: "gitlab" - elsif @scope == 'all' = render "empty_state" |