deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject svn commit: r1181723 - in /incubator/deltacloud/trunk/server: public/javascripts/application.js public/stylesheets/new.css views/instances/new.html.haml
Date Tue, 11 Oct 2011 11:39:00 GMT
Author: mfojtik
Date: Tue Oct 11 11:38:59 2011
New Revision: 1181723

URL: http://svn.apache.org/viewvc?rev=1181723&view=rev
Log:
UI: Improved hardware profile selection

Modified:
    incubator/deltacloud/trunk/server/public/javascripts/application.js
    incubator/deltacloud/trunk/server/public/stylesheets/new.css
    incubator/deltacloud/trunk/server/views/instances/new.html.haml

Modified: incubator/deltacloud/trunk/server/public/javascripts/application.js
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/public/javascripts/application.js?rev=1181723&r1=1181722&r2=1181723&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/public/javascripts/application.js (original)
+++ incubator/deltacloud/trunk/server/public/javascripts/application.js Tue Oct 11 11:38:59
2011
@@ -30,6 +30,11 @@ $(document).ready(function() {
 
 })
 
+function expandHWP(id) {
+  $('div.hwp_properties .property_block').appendTo('.hidden_content');
+  $('div#hwp_properties_'+id).hide().appendTo('div#property_container_'+id).fadeIn();
+}
+
 // NOTE: This code was copied from http://phpjs.org/functions/base64_encode:358
 // phpjs.org license it under the MIT and GPL licenses
 

Modified: incubator/deltacloud/trunk/server/public/stylesheets/new.css
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/public/stylesheets/new.css?rev=1181723&r1=1181722&r2=1181723&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/public/stylesheets/new.css (original)
+++ incubator/deltacloud/trunk/server/public/stylesheets/new.css Tue Oct 11 11:38:59 2011
@@ -51,3 +51,7 @@ form.link {
 p.right-float {
   float : right;
 }
+
+.hidden_content {
+  display : none;
+}

Modified: incubator/deltacloud/trunk/server/views/instances/new.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/new.html.haml?rev=1181723&r1=1181722&r2=1181723&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/new.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/new.html.haml Tue Oct 11 11:38:59 2011
@@ -1,6 +1,22 @@
 =header "Launch new instance"
 =subheader "#{@image.id}"
 
+.hidden_content
+  - @hardware_profiles.each do |profile|
+    %div{ :'data-role' => :fieldcontain, :id => "hwp_properties_#{profile.name}", :class
=> 'property_block'}
+      - profile.properties.reject { |prop| prop.fixed? }.each do |prop|
+        %label{ :for => "#{prop.param}_#{profile.name}", :class => 'ui-input-text'
}=prop.name
+        %span.radio-group-details
+          - if prop.kind == :enum
+            %select{ :size => 1, :name => prop.param }
+              - for v in prop.values
+                %option= v
+                = prop.unit
+          - elsif prop.kind == :range
+            %input{ :type => :range, :value => prop.first, :min => prop.first, :max
=> prop.last, :name => prop.param}
+          - else
+            %input{ :name => prop.param, :size => 10, :value => "#{prop.default}"
}= prop.unit
+
 %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
   %form{ :action => instances_url, :method => :post, :class => :new_instance, :'data-ajax'
=> 'false'}
     %input{ :name => :image_id, :type => :hidden, :value => @instance.image_id }/
@@ -59,21 +75,8 @@
         %fieldset{ :'data-role' => :fieldcontain}
           - @hardware_profiles.each do |profile|
             %input{ :type => :radio, :name => 'hwp_id', :value => profile.name,
:id => profile.name, :'data-theme' => 'b'}/
-            %label{ :for => profile.name}=profile.name
-            - profile.properties.reject { |prop| prop.fixed? }.each do |prop|
-              %div{ :'data-role' => :fieldcontain}
-                %label{ :for => "#{prop.param}_#{profile.name}", :class => 'ui-input-text'
}=prop.name
-                %span.radio-group-details
-                  - if prop.kind == :enum
-                    %select{ :size => 1, :name => prop.param }
-                      - for v in prop.values
-                        %option= v
-                    = prop.unit
-                  - elsif prop.kind == :range
-                    %input{ :type => :range, :value => prop.first, :min => prop.first,
:max => prop.last, :name => prop.param}
-                  - else
-                    %input{ :name => prop.param, :size => 10, :value => "#{prop.default}"
}
-                    = prop.unit
+            %label{ :for => profile.name, :onclick => "expandHWP('#{profile.name}');"}=profile.name
+            %div{ :'data-role' => :fieldcontain, :id => "property_container_#{profile.name}",
:class => 'hwp_properties'}
 
     - if !@realms.empty?
       %div{ 'data-role' => :fieldcontain }



Mime
View raw message