[PATCH conductor] BZ 803948 Fix of filters options in filter tables

Tzu-Mainn Chen tzumainn at redhat.com
Thu Mar 29 16:59:42 UTC 2012


ACK - the master branch doesn't have translations at the moment, so the BZ doesn't apply.  However, it matches 1.0-product code and doesn't break anything.

Mainn

----- Original Message -----
From: jzigmund at redhat.com
To: aeolus-devel at lists.fedorahosted.org
Cc: "Jozef Zigmund" <jzigmund at redhat.com>
Sent: Thursday, March 29, 2012 12:53:07 PM
Subject: [PATCH conductor] BZ 803948 Fix of filters options in filter tables

From: Jozef Zigmund <jzigmund at redhat.com>

---
 src/app/helpers/application_helper.rb |    2 +-
 src/app/models/catalog.rb             |    2 +-
 src/app/models/hardware_profile.rb    |    4 ++--
 src/app/models/instance.rb            |   10 +++++-----
 src/app/models/pool.rb                |   10 +++++-----
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/app/helpers/application_helper.rb b/src/app/helpers/application_helper.rb
index 8cb9c05..3443038 100644
--- a/src/app/helpers/application_helper.rb
+++ b/src/app/helpers/application_helper.rb
@@ -88,7 +88,7 @@ module ApplicationHelper
     else
       preset_filters_options = all_preset_filters_options
     end
-    options_for_select(preset_filters_options.collect{|x| [x[:title], x[:id]]}, :selected => selected)
+    options_for_select(preset_filters_options.collect{|x| [I18n.t(x[:title]), x[:id]]}, :selected => selected)
   end
 
   # Integration of rack-restful_submit convention to be able to call
diff --git a/src/app/models/catalog.rb b/src/app/models/catalog.rb
index 307c4dd..1f3ac9a 100644
--- a/src/app/models/catalog.rb
+++ b/src/app/models/catalog.rb
@@ -69,7 +69,7 @@ class Catalog < ActiveRecord::Base
   end
 
   PRESET_FILTERS_OPTIONS = [
-    {:title => I18n.t("catalogs.preset_filters.belongs_to_default_pool"), :id => "belongs_to_default_pool", :query => includes(:pool).where("pools.name" => "Default")}
+    {:title => "catalogs.preset_filters.belongs_to_default_pool", :id => "belongs_to_default_pool", :query => includes(:pool).where("pools.name" => "Default")}
   ]
 
   def destroy_deployables_related_only_to_self
diff --git a/src/app/models/hardware_profile.rb b/src/app/models/hardware_profile.rb
index befa1a9..9c325c1 100644
--- a/src/app/models/hardware_profile.rb
+++ b/src/app/models/hardware_profile.rb
@@ -157,8 +157,8 @@ class HardwareProfile < ActiveRecord::Base
   end
 
   PRESET_FILTERS_OPTIONS = [
-    #{:title => I18n.t("hardware_profiles.preset_filters.i386architecture"), :id => "i386architecture", :query => includes(:architecture).where('architecture.value' => "i386")},
-    #{:title => I18n.t("hardware_profiles.preset_filters.x86_64architecture"), :id => "x86_64architecture", :query => includes(:architecture).where('architecture.value' => "x86_64")}
+    #{:title => "hardware_profiles.preset_filters.i386architecture", :id => "i386architecture", :query => includes(:architecture).where('architecture.value' => "i386")},
+    #{:title => "hardware_profiles.preset_filters.x86_64architecture", :id => "x86_64architecture", :query => includes(:architecture).where('architecture.value' => "x86_64")}
   ]
 
   private
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index 95e2717..1b18d6e 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -492,11 +492,11 @@ class Instance < ActiveRecord::Base
   end
 
   PRESET_FILTERS_OPTIONS = [
-    {:title => I18n.t("instances.preset_filters.other_than_stopped"), :id => "other_than_stopped", :query => where("instances.state != ?", "stopped")},
-    {:title => I18n.t("instances.preset_filters.create_failed"), :id => "create_failed", :query => where("instances.state" => "create_failed")},
-    {:title => I18n.t("instances.preset_filters.stopped"), :id => "stopped", :query => where("instances.state" => "stopped")},
-    {:title => I18n.t("instances.preset_filters.running"), :id => "running", :query => where("instances.state" => "running")},
-    {:title => I18n.t("instances.preset_filters.pending"), :id => "pending", :query => where("instances.state" => "pending")}
+    {:title => "instances.preset_filters.other_than_stopped", :id => "other_than_stopped", :query => where("instances.state != ?", "stopped")},
+    {:title => "instances.preset_filters.create_failed", :id => "create_failed", :query => where("instances.state" => "create_failed")},
+    {:title => "instances.preset_filters.stopped", :id => "stopped", :query => where("instances.state" => "stopped")},
+    {:title => "instances.preset_filters.running", :id => "running", :query => where("instances.state" => "running")},
+    {:title => "instances.preset_filters.pending", :id => "pending", :query => where("instances.state" => "pending")}
   ]
 
   def destroy_on_provider
diff --git a/src/app/models/pool.rb b/src/app/models/pool.rb
index e568599..9556dee 100644
--- a/src/app/models/pool.rb
+++ b/src/app/models/pool.rb
@@ -147,11 +147,11 @@ class Pool < ActiveRecord::Base
   end
 
   PRESET_FILTERS_OPTIONS = [
-    {:title => I18n.t("pools.preset_filters.enabled_pools"), :id => "enabled_pools", :query => where("pools.enabled" => true)},
-    {:title => I18n.t("pools.preset_filters.with_pending_instances"), :id => "with_pending_instances", :query => includes(:deployments => :instances).where("instances.state" => "pending")},
-    {:title => I18n.t("pools.preset_filters.with_running_instances"), :id => "with_running_instances", :query => includes(:deployments => :instances).where("instances.state" => "running")},
-    {:title => I18n.t("pools.preset_filters.with_create_failed_instances"), :id => "with_create_failed_instances", :query => includes(:deployments => :instances).where("instances.state" => "create_failed")},
-    {:title => I18n.t("pools.preset_filters.with_stopped_instances"), :id => "with_stopped_instances", :query => includes(:deployments => :instances).where("instances.state" => "stopped")}
+    {:title => "pools.preset_filters.enabled_pools", :id => "enabled_pools", :query => where("pools.enabled" => true)},
+    {:title => "pools.preset_filters.with_pending_instances", :id => "with_pending_instances", :query => includes(:deployments => :instances).where("instances.state" => "pending")},
+    {:title => "pools.preset_filters.with_running_instances", :id => "with_running_instances", :query => includes(:deployments => :instances).where("instances.state" => "running")},
+    {:title => "pools.preset_filters.with_create_failed_instances", :id => "with_create_failed_instances", :query => includes(:deployments => :instances).where("instances.state" => "create_failed")},
+    {:title => "pools.preset_filters.with_stopped_instances", :id => "with_stopped_instances", :query => includes(:deployments => :instances).where("instances.state" => "stopped")}
   ]
 
   def object_list
-- 
1.7.7.6




More information about the aeolus-devel mailing list