Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1480819: Fix labels for Scale Infrastructure Provider form #4896

Merged
merged 1 commit into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/helpers/ems_infra_helper.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
module EmsInfraHelper
include_concern 'TextualSummary'

def scaling_field_label(param_name)
field_name = param_name.dup
case field_name
when 'BlockStorageCount'
_('Number of Block Storage Hosts')
when 'ObjectStorageCount'
_('Number of Object Storage Hosts')
when 'CephStorageCount'
_('Number of Ceph Storage Hosts')
when 'ComputeCount'
_('Number of Compute Hosts')
when 'ControllerCount'
_('Number of Controller Hosts')
else
field_name.sub!("Count", "")
field_name.sub!("::count", "")
_("Number of %{host_type} Hosts") % {:host_type => field_name.underscore.humanize.titleize}
end
end
end
2 changes: 1 addition & 1 deletion app/views/ems_infra/scaling.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
- @count_parameters.each do |parameter|
.form-group
%label.col-md-2.control-label
= parameter.name
= scaling_field_label(parameter.name)
.col-md-8
= text_field_tag(parameter.name, parameter.value, :maxlength => 5)
%table{:width => "100%"}
Expand Down