This layout really doesn't work as a single row if input fields if we have 7 +
1 columns.
The horrible file input overflow could be worked around in JS, by making it a
button -- wrapping it in a relatively positioned element that would hold the
button styling, and making the input absolutely positioned, transparent (will
trigger clicks). But it still won't make this layout any more usable.
---
src/app/stylesheets/aggregator.scss | 8 ++-
src/app/views/provider/accounts.haml | 104 +++++++++++++++++-----------------
2 files changed, 60 insertions(+), 52 deletions(-)
diff --git a/src/app/stylesheets/aggregator.scss
b/src/app/stylesheets/aggregator.scss
index 33dfb0d..41539bb 100644
--- a/src/app/stylesheets/aggregator.scss
+++ b/src/app/stylesheets/aggregator.scss
@@ -53,8 +53,14 @@ input,textarea {
}
}
+/* FILE INPUT */
+input[type="file"] {
+ width: 20px;
+ border: 1px solid red;
+}
+
/* compensate grid_* for padding+border of the inputboxes and textareas */
-input.grid_1 { width: 40px !important; }
+input.grid_1 { width: 30px !important; }
input.grid_2 { width: 90px !important; }
input.grid_3 { width: 150px !important; }
.grid_3 input[type="search"] { width: 118px; }
diff --git a/src/app/views/provider/accounts.haml
b/src/app/views/provider/accounts.haml
index 821b3d2..2bbd6f0 100644
--- a/src/app/views/provider/accounts.haml
+++ b/src/app/views/provider/accounts.haml
@@ -4,46 +4,50 @@
}
= render :partial => 'providers'
#details.grid_13
- = render_navigation(:level => 4)
+ %nav.subsubnav
+ = render_navigation(:level => 4)
+
+ %h1
+ = t('.provider_accounts')
- form_tag({:controller => 'cloud_accounts', :action => 'update_accounts'},
:multipart => true) do
- %h2.wider
- = t('.provider_accounts')
- %h3.first
- = t('.account_name')
- %span.required *
- %h3.second
- = t('.user_name')
- %span.required *
- %h3.third
- = t('.password')
- %span.required *
- %h3.fourth
- = t('.quota_instances')
- %span.required *
- %h3.fifth
- = t('.account_number')
- %span.required *
- %h3.sixth
- = t('.account_private_cert')
- %span.required *
- %h3.seventh
- = t('.account_public_cert')
- %span.required *
+ %fieldset.clearfix
+ %label.grid_2.la.alpha
+ = t('.account_name')
+ %span.required *
+ %label.grid_2.la
+ = t('.user_name')
+ %span.required *
+ %label.grid_2.la
+ = t('.password')
+ %span.required *
+ %label.grid_1.la
+ = t('.quota_instances')
+ %span.required *
+ %label.grid_1.la
+ = t('.account_number')
+ %span.required *
+ %label.grid_2.la
+ = t('.account_private_cert')
+ %span.required *
+ %label.grid_2.la
+ = t('.account_public_cert')
+ %span.required *
+ .grid_1.omega
= hidden_field :provider, :id, :value => @provider.id
- @provider.cloud_accounts.each do |acct|
- .fieldGroup.clearfix
+ %fieldset
- disabled = 'disabled' unless has_account_modify?(@provider)
- cloud_account_id = "cloud_accounts[#{acct.id}]"
- = text_field cloud_account_id, :label, :title => t('.account_name'),
:value => acct.label, :disabled => disabled
- = text_field cloud_account_id, :username, :title => t('.access_key'),
:value => acct.username, :disabled => disabled
- = password_field cloud_account_id, :password, :title =>
t('.secret_access_key'), :disabled => disabled
- = text_field cloud_account_id, :account_number, :title =>
t('.account_number'), :value => acct.account_number, :disabled => disabled
- = file_field cloud_account_id, :x509_cert_priv_file, :title =>
t('.account_private_cert'), :disabled => disabled
- = file_field cloud_account_id, :x509_cert_pub_file, :title =>
t('.account_public_cert'), :disabled => disabled
- = text_field "quota[#{acct.id}]", :maximum_running_instances, :title
=> t('.quota_instances'), :value => (acct.quota.maximum_running_instances.nil?
? "unlimited" : acct.quota.maximum_running_instances), :disabled => disabled,
:id => "quota_instances#{acct.id}"
+ = text_field cloud_account_id, :label, :title => t('.account_name'),
:value => acct.label, :disabled => disabled, :class => "grid_2 alpha"
+ = text_field cloud_account_id, :username, :title => t('.access_key'),
:value => acct.username, :disabled => disabled, :class => "grid_2"
+ = password_field cloud_account_id, :password, :title =>
t('.secret_access_key'), :disabled => disabled, :class => "grid_2"
+ = text_field "quota[#{acct.id}]", :maximum_running_instances, :title
=> t('.quota_instances'), :value => (acct.quota.maximum_running_instances.nil?
? "unlimited" : acct.quota.maximum_running_instances), :disabled => disabled,
:id => "quota_instances#{acct.id}", :class => "grid_1"
+ = text_field cloud_account_id, :account_number, :title =>
t('.account_number'), :value => acct.account_number, :disabled => disabled,
:class => "grid_1"
+ = file_field cloud_account_id, :x509_cert_priv_file, :title =>
t('.account_private_cert'), :disabled => disabled, :class => "grid_2"
+ = file_field cloud_account_id, :x509_cert_pub_file, :title =>
t('.account_public_cert'), :disabled => disabled, :class => "grid_2"
- remove_path = url_for :controller => 'cloud_accounts', :action =>
'destroy', :id => acct.id if has_account_modify?(@provider) && acct.destroyable?
- %a.button{ :href => remove_path, :name => "remove_acc_#{acct.id}",
:class => ('disabled' unless remove_path) }
+ %a.button{ :href => remove_path, :name => "remove_acc_#{acct.id}",
:class => 'grid_1 ' + ('disabled' unless remove_path) }
= t(:remove)
.subtext
%span
@@ -59,34 +63,32 @@
= t('.unlimited_quota')
)
- #prefooter
- %p.requirement
- %span.required *
- \-
- = t('.required_field')
= submit_tag t(:reset), :name => 'reset_form' unless
@provider.cloud_accounts.empty?
= submit_tag t(:save), :name => 'update_cloud_accounts' unless
@provider.cloud_accounts.empty?
- form_tag({:controller => 'cloud_accounts', :action => 'create'},
:multipart => true) do
- .fieldGroup.clearfix
- = text_field :cloud_account, :label, :title => t('.account_name')
- = text_field :cloud_account, :username, :title => t('.access_key')
- = password_field :cloud_account, :password, :title =>
t('.secret_access_key')
- = text_field :cloud_account, :account_number, :title =>
t('.account_number')
- = file_field :cloud_account, :x509_cert_priv_file, :title =>
t('.account_private_cert')
- = file_field :cloud_account, :x509_cert_pub_file, :title =>
t('.account_public_cert')
- = text_field :quota, :maximum_running_instances, :title =>
t('.quota_instances'), :id => "new_quota_instances", :value => "unlimited"
+ %fieldset.clearfix
+ = text_field :cloud_account, :label, :title => t('.account_name'),
:class => "grid_2 alpha"
+ = text_field :cloud_account, :username, :title => t('.access_key'),
:class => "grid_2"
+ = password_field :cloud_account, :password, :title =>
t('.secret_access_key'), :class => "grid_2"
+ = text_field :quota, :maximum_running_instances, :title =>
t('.quota_instances'), :id => "new_quota_instances", :value => "unlimited",
:class => "grid_1"
+ = text_field :cloud_account, :account_number, :title =>
t('.account_number'), :class => "grid_1"
+ = file_field :cloud_account, :x509_cert_priv_file, :title =>
t('.account_private_cert'), :class => "grid_2"
+ = file_field :cloud_account, :x509_cert_pub_file, :title =>
t('.account_public_cert'), :class => "grid_2"
= hidden_field :cloud_account, :provider_id, :value => @provider.id
= submit_tag t(:add)
- .subtext
- %span
+ .subtext.clearfix
+ .grid_2.alpha
(
%a{ :href => '' }<>
= t('.test_account')
)
- %span
- %span
- %span
+ .grid_2.prefix_4
(
%a{ :href => '#', :onclick =>
'set_unlimited_quota("new_quota_instances");' }<>
= t('.unlimited_quota')
)
+ %section
+ %p.requirement
+ %span.required *
+ \-
+ = t('.required_field')
--
1.7.2.3
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel