Commit 232d42b7 authored by Matija Čupić's avatar Matija Čupić

Use helper for feature check in cluster partials

parent b3cdd336
module ClustersHelper
def has_multiple_clusters?(project)
project.feature_available?(:multiple_clusters)
end
end
......@@ -10,10 +10,7 @@
.form-group
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
- if @project.feature_available?(:multiple_clusters)
= field.text_field :environment_scope, class: 'form-control', placeholder: s_('ClusterIntegration|Environment scope')
- else
= field.text_field :environment_scope, class: 'form-control', readonly: true, placeholder: s_('ClusterIntegration|Environment scope')
= field.text_field :environment_scope, class: 'form-control', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
= field.fields_for :provider_gcp, @cluster.provider_gcp do |provider_gcp_field|
.form-group
......
......@@ -11,10 +11,7 @@
.form-group
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
- if @project.feature_available?(:multiple_clusters)
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Environment scope')
- else
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', readonly: true, placeholder: s_('ClusterIntegration|Environment scope')
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
.form-group
......
......@@ -6,10 +6,7 @@
.form-group
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
- if @project.feature_available?(:multiple_clusters)
= field.text_field :environment_scope, class: 'form-control', placeholder: s_('ClusterIntegration|Environment scope')
- else
= field.text_field :environment_scope, class: 'form-control', readonly: true, placeholder: s_('ClusterIntegration|Environment scope')
= field.text_field :environment_scope, class: 'form-control', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
.form-group
......
......@@ -6,10 +6,7 @@
.form-group
= field.label :environment_scope, s_('ClusterIntegration|Environment scope')
- if @project.feature_available?(:multiple_clusters)
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', placeholder: s_('ClusterIntegration|Environment scope')
- else
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', readonly: true, placeholder: s_('ClusterIntegration|Environment scope')
= field.text_field :environment_scope, class: 'form-control js-select-on-focus', readonly: has_multiple_clusters?(@project), placeholder: s_('ClusterIntegration|Environment scope')
= field.fields_for :platform_kubernetes, @cluster.platform_kubernetes do |platform_kubernetes_field|
.form-group
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment