These two patches result from the feedback to the original "small UI fixes" patchset.
I've joined the first and second patch from the previous set together as they touch the same thing.
From: Jakub Steiner jsteiner@redhat.com
This fixes the Cancel button and changes the markup to wrap the form in the .modalbox class only when the user is not logged in. --- src/app/stylesheets/aggregator.scss | 3 +- src/app/views/users/_form.haml | 80 +++++++++++++++++++---------------- src/app/views/users/new.haml | 13 ++---- 3 files changed, 51 insertions(+), 45 deletions(-)
diff --git a/src/app/stylesheets/aggregator.scss b/src/app/stylesheets/aggregator.scss index ffe9777..fd23d86 100644 --- a/src/app/stylesheets/aggregator.scss +++ b/src/app/stylesheets/aggregator.scss @@ -121,6 +121,7 @@ input[type='submit'],button,.button { display: inline-block; margin-left: 3px; margin: 40px 4px 4px; + float: left; } &.actionlink { margin: 40px 0 0; @@ -862,7 +863,7 @@ fieldset.gap { padding: 4px 10px 0 0; max-width: 10em; } - input { + input[type='text'], input[type='password'], textarea { display: inline-block; width: 20em; } diff --git a/src/app/views/users/_form.haml b/src/app/views/users/_form.haml index bb3c0c2..5607298 100644 --- a/src/app/views/users/_form.haml +++ b/src/app/views/users/_form.haml @@ -1,37 +1,45 @@ -%fieldset.clear - = form.label :login, t(:choose_name), :class => "grid_3 alpha" - = form.text_field :login, :class => "grid_5" -%fieldset.clear - = form.label :password, form.object.new_record? ? t(:choose_password) : t(:change_password), :class => "grid_3 alpha" - = form.password_field :password, :class => "grid_5" -%fieldset - = form.label :password_confirmation, t(:confirm_password), :class => "grid_3 alpha" - = form.password_field :password_confirmation, :class => "grid_5" --if has_user_modify? - %fieldset.clear - = form.label :user_status, "User Status:", :class => "alpha grid_3" - .grid_5 - = radio_button_tag "user_status","Active",true - = label_tag "user_status_active", "Active" - = radio_button_tag "user_status","Inactive", false, :disabled => true - = label_tag "user_status_inactive", "Inactive" -%fieldset.clear - = form.label :first_name, t(:first_name), :class => "alpha grid_3" - = form.text_field :first_name, :class => "grid_5" -%fieldset.clear - = form.label :last_name, t(:last_name), :class => "alpha grid_3" - = form.text_field :last_name, :class => "grid_5" -%fieldset.clear - = form.label :email, t(:email), :class => "alpha grid_3" - = form.text_field :email, :class => "grid_5" --if has_user_modify? - %h3.grid_16 User Treatment - = label_tag 'apply_treatment', t(:apply_treatment), :class => "alpha grid_3" - = select_tag 'user_treatment', options_for_select([t(:choose_treatment)]), :class => "grid_5" - = submit_tag t(:apply), :disabled => true - - - form.fields_for :quota do |quota_form| +%h2 New Account +.dcloud_form + - form_for @user, :url => account_path do |form| + = form.error_messages + %fieldset.clear + = form.label :login, t(:choose_name), :class => "grid_3 alpha" + = form.text_field :login, :class => "grid_5" + %fieldset.clear + = form.label :password, form.object.new_record? ? t(:choose_password) : t(:change_password), :class => "grid_3 alpha" + = form.password_field :password, :class => "grid_5" + %fieldset + = form.label :password_confirmation, t(:confirm_password), :class => "grid_3 alpha" + = form.password_field :password_confirmation, :class => "grid_5" + -if has_user_modify? + %fieldset.clear + = form.label :user_status, "User Status:", :class => "alpha grid_3" + .grid_5 + = radio_button_tag "user_status","Active",true + = label_tag "user_status_active", "Active" + = radio_button_tag "user_status","Inactive", false, :disabled => true + = label_tag "user_status_inactive", "Inactive" %fieldset.clear - = quota_form.label :maximum_running_instances, t(:maximum_running_instances), :class => "alpha grid_3" - = quota_form.text_field :maximum_running_instances, :class => "grid_5" - (instances) + = form.label :first_name, t(:first_name), :class => "alpha grid_3" + = form.text_field :first_name, :class => "grid_5" + %fieldset.clear + = form.label :last_name, t(:last_name), :class => "alpha grid_3" + = form.text_field :last_name, :class => "grid_5" + %fieldset.clear + = form.label :email, t(:email), :class => "alpha grid_3" + = form.text_field :email, :class => "grid_5" + -if has_user_modify? + %h3.grid_16 User Treatment + %fieldset.clearfix + = label_tag 'apply_treatment', t(:apply_treatment), :class => "alpha grid_3" + = select_tag 'user_treatment', options_for_select([t(:choose_treatment)]), :class => "grid_5" + = submit_tag t(:apply), :disabled => true, :class => "grid_2" + + - form.fields_for :quota do |quota_form| + %fieldset.clear + = quota_form.label :maximum_running_instances, t(:maximum_running_instances), :class => "alpha grid_3" + = quota_form.text_field :maximum_running_instances, :class => "grid_5" + (instances) + %fieldset.clearfix + = form.submit t(:create_account), :class => "submit formbutton" + = link_to t(:cancel), cancel_path, :class => 'button formbutton' diff --git a/src/app/views/users/new.haml b/src/app/views/users/new.haml index b6ed86b..4cd3e76 100644 --- a/src/app/views/users/new.haml +++ b/src/app/views/users/new.haml @@ -1,8 +1,5 @@ -.modalbox - %h2 New Account - .dcloud_form - - form_for @user, :url => account_path do |f| - = f.error_messages - = render :partial => "form", :object => f - = f.submit t(:create_account), :class => "submit dialogbutton" - = link_to t(:cancel), :class => 'actionlink button dialogbutton' +-if (current_user) + = render :partial => "form", :locals => { :cancel_path => users_path} +-else + .modalbox + = render :partial => "form", :locals => { :cancel_path => login_path}
From: Jakub Steiner jsteiner@redhat.com
This bring the Instance Management page closer to the latest mockups.
We show the per-user quota (as opposed to per-pool quota) and put it in a separate place. --- src/app/stylesheets/aggregator.scss | 4 ++-- src/app/views/instance/index.haml | 35 +++++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/app/stylesheets/aggregator.scss b/src/app/stylesheets/aggregator.scss index fd23d86..9fb8a05 100644 --- a/src/app/stylesheets/aggregator.scss +++ b/src/app/stylesheets/aggregator.scss @@ -270,7 +270,7 @@ table { } } td { - padding: 2px; + padding: 4px; vertical-align: top; min-height: 16px; } @@ -1036,7 +1036,7 @@ footer { }
/* GRINDS */ -.status { +.status,.capacity { span { display: inline-block; width: 10px; diff --git a/src/app/views/instance/index.haml b/src/app/views/instance/index.haml index 8bca1ee..4c147c5 100644 --- a/src/app/views/instance/index.haml +++ b/src/app/views/instance/index.haml @@ -12,11 +12,11 @@ - pool_columns = [ | { :name => "Pool name", :sort_attr => :name }, | { :name => "Alerts", :sortable => false }, | - { :name => "% Quota used", :sortable => false }, | - { :name => "Quota (Instances)", :sort_attr => "quotas.total_instances"}, | + { :name => "Capacity", :sortable => false }, | { :name => "Zone", :sort_attr => "zones.name" } | ] |
+ - form_tag(:action => 'instance_action') do .actionsidebar.grid_3 %dl @@ -61,24 +61,39 @@ %span = submit_tag "Request Help", :name => "request_help", :class => "icon", :disabled => true
- .grid_13 + .grid_5 + %h2 My Quota + %table + %thead + %tr + %th % Quota Used + %th + Quota + %span.small (Instances) + %tbody + %tr + - quota = current_user.quota.maximum_running_instances + %td + - if quota.respond_to? '>' and quota > 0 + = "%.2f" % ((current_user.quota.running_instances / quota.to_f) * 100) + - else + = 0 + %td + = quota or "unlimited" + .grid_8 %h2 Pool Status %table =sortable_table_header pool_columns - %tbody - @pools.each do |pool| %tr %td =link_to pool.name, pool_url(pool.id) %td N/A - %td - =((pool.quota.maximum_running_instances || 0)/100)*pool.quota.total_instances - ='%' - %td - =pool.quota.total_instances + %td.capacity + %span.good %td =pool.zone.name - + .grid_13 %h2 Instances by Pool - @pools.each do |pool| .grid_6.alpha.poolname
deltacloud-devel@lists.fedorahosted.org