Return-Path: X-Original-To: apmail-incubator-deltacloud-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltacloud-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6EAA693A0 for ; Tue, 11 Oct 2011 11:39:24 +0000 (UTC) Received: (qmail 89113 invoked by uid 500); 11 Oct 2011 11:39:24 -0000 Delivered-To: apmail-incubator-deltacloud-commits-archive@incubator.apache.org Received: (qmail 89093 invoked by uid 500); 11 Oct 2011 11:39:24 -0000 Mailing-List: contact deltacloud-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-commits@incubator.apache.org Received: (qmail 89086 invoked by uid 99); 11 Oct 2011 11:39:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 11:39:24 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_PROFIT2 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 11:39:21 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2E67C23889C5; Tue, 11 Oct 2011 11:39:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: deltacloud-commits@incubator.apache.org From: mfojtik@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111011113900.2E67C23889C5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 }