From: Jozef Zigmund <jzigmund(a)redhat.com>
---
.../controllers/hardware_profiles_controller.rb | 28 ++++++++++----------
src/app/views/hardware_profiles/_form.html.haml | 6 ++--
src/app/views/hardware_profiles/_history.html.haml | 2 +-
src/app/views/hardware_profiles/_list.html.haml | 4 +-
.../_matching_provider_hardware_profiles.html.haml | 2 +-
.../hardware_profiles/_section_header.html.haml | 4 +-
src/app/views/hardware_profiles/create.html.haml | 2 +-
src/app/views/hardware_profiles/edit.html.haml | 7 ++---
src/app/views/hardware_profiles/new.html.haml | 4 +-
src/app/views/hardware_profiles/show.html.haml | 10 +++---
10 files changed, 34 insertions(+), 35 deletions(-)
diff --git a/src/app/controllers/hardware_profiles_controller.rb
b/src/app/controllers/hardware_profiles_controller.rb
index 071affd..c1b2fee 100644
--- a/src/app/controllers/hardware_profiles_controller.rb
+++ b/src/app/controllers/hardware_profiles_controller.rb
@@ -46,7 +46,7 @@ class HardwareProfilesController < ApplicationController
@hardware_profile = HardwareProfile.find(params[:id].to_a.first)
require_privilege(Privilege::VIEW, @hardware_profile)
- @tab_captions = ['Properties', 'History', 'Matching Provider
Hardware Profiles']
+ @tab_captions = [t('hardware_profiles.tab_captions.properties'),
t('hardware_profiles.tab_captions.history'),
t('hardware_profiles.tab_captions.matching_provider_hwp')]
@details_tab = params[:details_tab].blank? ? 'properties' :
params[:details_tab]
properties
matching_provider_hardware_profiles
@@ -168,21 +168,21 @@ class HardwareProfilesController < ApplicationController
def properties
@properties_header = [
- { :name => "Name", :sort_attr => :name},
- { :name => "Unit", :sort_attr => :unit},
- { :name => "Minimum Value", :sort_attr => :value}]
+ { :name => t('hardware_profiles.properties_headers.name'), :sort_attr
=> :name},
+ { :name => t('hardware_profiles.properties_headers.unit'), :sort_attr
=> :unit},
+ { :name => t('hardware_profiles.properties_headers.min_value'),
:sort_attr => :value}]
@hwp_properties = [@hardware_profile.memory, @hardware_profile.cpu,
@hardware_profile.storage, @hardware_profile.architecture]
end
#TODO Update this method when moving to new HWP Model
def matching_provider_hardware_profiles
@provider_hwps_header = [
- { :name => "Provider Name", :sort_attr => "provider.name"
},
- { :name => "Hardware Profile Name", :sort_attr => :name },
- { :name => "Architecture", :sort_attr => :architecture },
- { :name => "Memory", :sort_attr => :memory},
- { :name => "Storage", :sort_attr => :storage },
- { :name => "Virtual CPU", :sort_attr => :cpu}
+ { :name => t('hardware_profiles.provider_hwp_headers.provider_name'),
:sort_attr => "provider.name" },
+ { :name => t('hardware_profiles.provider_hwp_headers.hwp_name'),
:sort_attr => :name },
+ { :name => t('hardware_profiles.provider_hwp_headers.architecture'),
:sort_attr => :architecture },
+ { :name => t('hardware_profiles.provider_hwp_headers.memory'),
:sort_attr => :memory},
+ { :name => t('hardware_profiles.provider_hwp_headers.storage'),
:sort_attr => :storage },
+ { :name => t('hardware_profiles.provider_hwp_headers.virtual_cpu'),
:sort_attr => :cpu}
]
begin
@@ -193,12 +193,12 @@ class HardwareProfilesController < ApplicationController
end
def setup_hardware_profile
- @tab_captions = ['Matched Provider Hardware Profiles']
+ @tab_captions = [t('hardware_profiles.tab_captions.matching_provider_hwp')]
@details_tab = 'matching_provider_hardware_profiles'
@header = [
- { :name => "Name", :sort_attr => :name},
- { :name => "Unit", :sort_attr => :unit},
- { :name => "Minimum Value", :sort_attr => :value}]
+ { :name => t('hardware_profiles.properties_headers.name'), :sort_attr
=> :name},
+ { :name => t('hardware_profiles.properties_headers.unit'), :sort_attr
=> :unit},
+ { :name => t('hardware_profiles.properties_headers.min_value'),
:sort_attr => :value}]
end
def load_hardware_profiles
diff --git a/src/app/views/hardware_profiles/_form.html.haml
b/src/app/views/hardware_profiles/_form.html.haml
index 8173f82..d1cffb2 100644
--- a/src/app/views/hardware_profiles/_form.html.haml
+++ b/src/app/views/hardware_profiles/_form.html.haml
@@ -1,6 +1,6 @@
- if @hardware_profile.errors.any?
= render 'layouts/error_messages', :object => @hardware_profile
-= hwp_form.label :name
+= hwp_form.label :name, t('hardware_profiles.form.name')
= hwp_form.text_field :name
%table
= sortable_table_header @header
@@ -14,5 +14,5 @@
= hwpp_form.select("value", ["i386", "x86_64"],
{})
-else
= hwpp_form.text_field(:value)
-= hwp_form.submit 'Check Matches', :class => "submit button", :id
=> 'check_matches'
-= hwp_form.submit 'Save', :class => 'submit button', :id =>
'save_button'
+= hwp_form.submit t('hardware_profiles.form.check_matches'), :class =>
"submit button", :id => 'check_matches'
+= hwp_form.submit t('save'), :class => 'submit button', :id =>
'save_button'
diff --git a/src/app/views/hardware_profiles/_history.html.haml
b/src/app/views/hardware_profiles/_history.html.haml
index 894e9cd..f11b9bc 100644
--- a/src/app/views/hardware_profiles/_history.html.haml
+++ b/src/app/views/hardware_profiles/_history.html.haml
@@ -1 +1 @@
-%h3 History
+%h3= t 'hardware_profiles.history.history'
diff --git a/src/app/views/hardware_profiles/_list.html.haml
b/src/app/views/hardware_profiles/_list.html.haml
index 34f0f1b..2020f78 100644
--- a/src/app/views/hardware_profiles/_list.html.haml
+++ b/src/app/views/hardware_profiles/_list.html.haml
@@ -1,7 +1,7 @@
.content
- content_for :form_header do
- %li= restful_submit_tag "Delete Selected", "destroy",
multi_destroy_hardware_profiles_path, 'DELETE', :id => 'delete_button',
:class => 'button danger'
- %li= link_to "New Hardware", new_hardware_profile_path, :id =>
'new_hardware_profile_button', :class => 'button'
+ %li= restful_submit_tag t('hardware_profiles.list.delete_selected'),
"destroy", multi_destroy_hardware_profiles_path, 'DELETE', :id =>
'delete_button', :class => 'button danger'
+ %li= link_to t('hardware_profiles.list.new_hardware'),
new_hardware_profile_path, :id => 'new_hardware_profile_button', :class =>
'button'
= filter_table(hardware_profiles_header, @hardware_profiles) do |hwp|
%tr{:class => cycle('nostripe','stripe')}
diff --git
a/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.html.haml
b/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.html.haml
index 6643ca1..09cb9d3 100644
--- a/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.html.haml
+++ b/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.html.haml
@@ -19,4 +19,4 @@
=hwp.cpu.to_s
- else
%h3
- No Matching Provider Hardware Profiles Could be found
+ = t'hardware_profiles.matching_provider_hwp.no_matching_provider_hwp'
diff --git a/src/app/views/hardware_profiles/_section_header.html.haml
b/src/app/views/hardware_profiles/_section_header.html.haml
index e6770f3..418a6ae 100644
--- a/src/app/views/hardware_profiles/_section_header.html.haml
+++ b/src/app/views/hardware_profiles/_section_header.html.haml
@@ -1,4 +1,4 @@
%header.admin-page-header
- %h1{:class => controller.controller_name} Hardware Profiles
+ %h1{:class =>
controller.controller_name}=t'hardware_profiles.hardware_profiles'
#obj_actions.button-group
- = link_to 'New Hardware Profile', new_hardware_profile_url, :class =>
'button primary', :id => 'new_hardware_profile_button'
+ = link_to t('hardware_profiles.list.new_hardware'), new_hardware_profile_url,
:class => 'button primary', :id => 'new_hardware_profile_button'
diff --git a/src/app/views/hardware_profiles/create.html.haml
b/src/app/views/hardware_profiles/create.html.haml
index c26bbe9..273a403 100644
--- a/src/app/views/hardware_profiles/create.html.haml
+++ b/src/app/views/hardware_profiles/create.html.haml
@@ -1,5 +1,5 @@
%h3
- Check Matching Hardware Profiles
+ = t'hardware_profiles.create.check_matching_hwp'
- content_for :list do
= render :partial => "form"
- content_for :details do
diff --git a/src/app/views/hardware_profiles/edit.html.haml
b/src/app/views/hardware_profiles/edit.html.haml
index aa4da76..eaf6b53 100644
--- a/src/app/views/hardware_profiles/edit.html.haml
+++ b/src/app/views/hardware_profiles/edit.html.haml
@@ -3,14 +3,13 @@
%header.admin-page-header
%h1{:class => controller.controller_name}= @hardware_profile.name.titlecase
#obj_actions.button-container
- = link_to 'New Hardware Profile', hardware_profile_url, :class =>
'button primary', :id => 'new_user_button'
+ = link_to t('hardware_profiles.list.new_hardware'), hardware_profile_url,
:class => 'button primary', :id => 'new_user_button'
%div.button-group
- = link_to 'Cancel Editing', hardware_profile_path(@hardware_profile),
:class => 'button pill danger', :id => 'new_user_button'
+ = link_to t('hardware_profiles.edit.cancel_editing'),
hardware_profile_path(@hardware_profile), :class => 'button pill danger', :id
=> 'new_user_button'
%section.admin-content-section.hardware_profile
%header
- %h2
- Edit Hardware Profile
+ %h2=t('hardware_profiles.edit.edit_hwp')
.content
= form_for @hardware_profile, :url => hardware_profile_path(@hardware_profile),
:html => { :multipart => true } do |hwp_form|
diff --git a/src/app/views/hardware_profiles/new.html.haml
b/src/app/views/hardware_profiles/new.html.haml
index 795a706..ad23320 100644
--- a/src/app/views/hardware_profiles/new.html.haml
+++ b/src/app/views/hardware_profiles/new.html.haml
@@ -2,10 +2,10 @@
%header.admin-page-header
%header
- %h1 New Hardware Profile
+ %h1=t'hardware_profiles.new.new_hwp'
#obj_actions
Return to:
- = link_to "Hardware Profiles", hardware_profiles_path, :class =>
'rounded-link'
+ = link_to t('hardware_profiles.hardware_profiles'), hardware_profiles_path,
:class => 'rounded-link'
%section.admin-content-section
= form_for @hardware_profile, :url => hardware_profiles_path, :html => {
:multipart => true } do |hwp_form|
diff --git a/src/app/views/hardware_profiles/show.html.haml
b/src/app/views/hardware_profiles/show.html.haml
index 8a63c0d..7899631 100644
--- a/src/app/views/hardware_profiles/show.html.haml
+++ b/src/app/views/hardware_profiles/show.html.haml
@@ -2,17 +2,17 @@
%header.admin-page-header
%h1{:class => controller.controller_name}= @hardware_profile.name + " (" +
(@hardware_profile.provider_id.nil? ? "Front End" : "Provider" ) +
")"
#obj_actions.button-container
- = link_to 'New Hardware Profile', new_hardware_profile_url, :class =>
'button primary', :id => 'new_role_button'
+ = link_to t('hardware_profiles.list.new_hardware'), new_hardware_profile_url,
:class => 'button primary', :id => 'new_role_button'
.button-group
- = link_to 'Edit', edit_hardware_profile_path(@hardware_profile), :class
=> 'button pill', :id => 'edit_button'
- = button_to 'Delete', hardware_profile_path(@hardware_profile), :method
=> :delete, :confirm => "Are you sure you want to delete?", :class =>
'button pill danger'
+ = link_to t('edit'), edit_hardware_profile_path(@hardware_profile), :class
=> 'button pill', :id => 'edit_button'
+ = button_to t('delete'), hardware_profile_path(@hardware_profile), :method
=> :delete, :confirm => "Are you sure you want to delete?", :class =>
'button pill danger'
%section.admin-content-section.hardware_profile
%header
- %h2 Properties
+ %h2=t 'propertieso'
.content
= render :partial => 'properties'
%section.admin-content-section.hardware_profile
%header
- %h2 Matching Provider Hardware Profiles
+ %h2=t'hardware_profiles.show.matching_hwp'
.content
= render :partial => 'matching_provider_hardware_profiles'
--
1.7.6.4