[PATCH] BZ 790824 hide build select unless build exists; make sure build select button is always visible if form is visible

Tzu-Mainn Chen tzumainn at redhat.com
Mon Feb 20 19:57:04 UTC 2012


---
 src/app/views/images/show.html.haml |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/app/views/images/show.html.haml b/src/app/views/images/show.html.haml
index c4ad8d7..a7a758d 100644
--- a/src/app/views/images/show.html.haml
+++ b/src/app/views/images/show.html.haml
@@ -19,10 +19,11 @@
     %h3= t('images.environment', :environment => @image.environment)
     %h2= t('.provider_images')
     .section-controls
-      = t'.view_build'
-      = form_tag image_path(@image.id), :method => :get do
-        = select_tag :build, options_for_build_select(@builds, @build, @latest_build)
-        = submit_tag t('.select_build'), :id => 'seletect_build_button'
+      - if @builds.any?
+        = t'.view_build'
+        = form_tag image_path(@image.id), :method => :get do
+          = select_tag :build, options_for_build_select(@builds, @build, @latest_build)
+          = submit_tag t('.select_build'), :id => 'select_build_button'
       - if check_privilege(Privilege::USE, PoolFamily) and @environment
         - if @image.imported?
           = t('.can_not_build_imported_image')
@@ -94,14 +95,6 @@
                                
             .clear
 
-:javascript
-  $(document).ready(function(){
-    $("#seletect_build_button").hide();
-    $("#build").change(function() {
-      $("#seletect_build_button").click();
-    });
-  });
-
 %script#imageBuildsTemplate{ :type => 'text/x-jquery-tmpl' }
   :plain
     {{each(driver, group) account_groups}}
-- 
1.7.6.5




More information about the aeolus-devel mailing list