[PATCH conductor] Fix message on launch from catalog

ifarkas at redhat.com ifarkas at redhat.com
Tue Dec 13 15:49:52 UTC 2011


From: Imre Farkas <ifarkas at redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=761456
---
 src/app/stylesheets/custom.scss                    |    4 +
 .../deployments/launch_from_catalog.html.haml      |   66 ++++++++++---------
 src/config/locales/en.yml                          |    1 +
 3 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/src/app/stylesheets/custom.scss b/src/app/stylesheets/custom.scss
index 31953e2..692c61c 100644
--- a/src/app/stylesheets/custom.scss
+++ b/src/app/stylesheets/custom.scss
@@ -241,3 +241,7 @@ form.generic section.services {
     list-style-type: none;
   }
 }
+
+#no-catalog-entry {
+  margin-bottom: 30px;
+}
diff --git a/src/app/views/deployments/launch_from_catalog.html.haml b/src/app/views/deployments/launch_from_catalog.html.haml
index 0c70fcf..53cb9ce 100644
--- a/src/app/views/deployments/launch_from_catalog.html.haml
+++ b/src/app/views/deployments/launch_from_catalog.html.haml
@@ -5,38 +5,42 @@
     = link_to t('edit'), edit_catalog_path(@catalog), :class => 'button pill', :id => 'edit_button'
   .corner &nbsp;
 %section.content-section
-  .align-center
-    %strong= t(".hint", :pool =>  @catalog.pool.name)
-  %ul.catalog_pretty
-    - @deployables.each do |deployable|
-      %li.collapse_entity
-        .summary
-          .info
-            %h2= deployable.name
-            %p= deployable.description
-          .controls
-            = link_to t(".details"),"#", :class => "collapse"
-            = button_to t(".select"), launch_time_params_deployments_path(:deployment => { :name => deployable.name, :pool_id => @catalog.pool.id }, :deployable_id => deployable.id ), :class=> "button pill"
-        .details.collapsible.collapsed
-          %table
-            %tr
-              %th
-                %strong= t'.image_id'
-              %th=t'.profile'
-              %th=t'.hdd'
-              %th=t'.ram'
-              %th=t'.arch'
-              %th
-                %strong=t'.deployable_xml'
-            -deployable.fetch_images.compact.each do |image|
+  - if @deployables.length > 0
+    .align-center
+      %strong= t(".hint", :pool =>  @catalog.pool.name)
+    %ul.catalog_pretty
+      - @deployables.each do |deployable|
+        %li.collapse_entity
+          .summary
+            .info
+              %h2= deployable.name
+              %p= deployable.description
+            .controls
+              = link_to t(".details"),"#", :class => "collapse"
+              = button_to t(".select"), launch_time_params_deployments_path(:deployment => { :name => deployable.name, :pool_id => @catalog.pool.id }, :deployable_id => deployable.id ), :class=> "button pill"
+          .details.collapsible.collapsed
+            %table
               %tr
-                %td
-                  %strong= image.id
-                %td= deployable.hw_profile_for_image(image.id).name
-                %td= deployable.hw_profile_for_image(image.id).storage
-                %td= deployable.hw_profile_for_image(image.id).memory
-                %td= deployable.hw_profile_for_image(image.id).architecture
-                %td= link_to deployable.xml_filename, catalog_deployable_path(deployable.catalogs.first, deployable.catalog_entries.first.id, :deployable_xml => true)
+                %th
+                  %strong= t'.image_id'
+                %th=t'.profile'
+                %th=t'.hdd'
+                %th=t'.ram'
+                %th=t'.arch'
+                %th
+                  %strong=t'.deployable_xml'
+              -deployable.fetch_images.compact.each do |image|
+                %tr
+                  %td
+                    %strong= image.id
+                  %td= deployable.hw_profile_for_image(image.id).name
+                  %td= deployable.hw_profile_for_image(image.id).storage
+                  %td= deployable.hw_profile_for_image(image.id).memory
+                  %td= deployable.hw_profile_for_image(image.id).architecture
+                  %td= link_to deployable.xml_filename, catalog_deployable_path(deployable.catalogs.first, deployable.catalog_entries.first.id, :deployable_xml => true)
+  - else
+    #no-catalog-entry.align-center
+      %strong= t(".no_catalog_entry")
 
   .align-center
     %div= will_paginate @deployables
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index dc25790..10d44c4 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -183,6 +183,7 @@ en:
     launch_from_catalog:
       profile: Profile
       hint: Choose a deployable to launch in the "%{pool}" pool
+      no_catalog_entry: 'No available catalog entry. Please add one first!'
       details: Details
       select: Select
       image_id: Image ID
-- 
1.7.6.4




More information about the aeolus-devel mailing list