[PATCH conductor] BZ798550 added clearfix to administer section form input wrapper elements, to prevent skipping to the side when label is long
jtomasek at redhat.com
jtomasek at redhat.com
Fri Mar 2 15:01:32 UTC 2012
From: Jiri Tomasek <jtomasek at redhat.com>
---
src/app/stylesheets/layout.scss | 16 ++++++++++++++++
.../views/config_servers/_config_server_form.haml | 6 +++---
src/app/views/deployables/_form.html.haml | 10 +++++-----
src/app/views/deployables/_from_url.html.haml | 10 +++++-----
.../views/deployables/_new_from_image.html.haml | 9 +++------
src/app/views/deployables/_upload.html.haml | 10 +++++-----
src/app/views/images/import.html.haml | 6 +++---
src/app/views/images/new.html.haml | 12 ++++++------
src/app/views/pool_families/_form.html.haml | 4 ++--
.../provider_accounts/_provider_form.html.haml | 8 ++++----
.../_provider_selection.html.haml | 6 ++----
src/app/views/providers/_form.html.haml | 8 ++++----
src/app/views/realm_mappings/new.html.haml | 2 +-
src/app/views/realms/_form.html.haml | 11 ++++++-----
src/app/views/users/_form.html.haml | 14 +++++++-------
15 files changed, 72 insertions(+), 60 deletions(-)
diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss
index c58d93a..cfb5a76 100644
--- a/src/app/stylesheets/layout.scss
+++ b/src/app/stylesheets/layout.scss
@@ -12,6 +12,21 @@ Compiled on Wed Jul 13 12:26:53 -0700 2011
*display: inline;
}
+ at mixin clearfix {
+ *zoom: 1;
+ &:before, &:after {
+ display: table;
+ content: "";
+ }
+ &:after {
+ clear: both;
+ }
+}
+
+.clearfix {
+ @include clearfix;
+}
+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page Layout -- v.0.0.2 [layout] (reset.css)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@@ -3509,6 +3524,7 @@ body.administer form.generic{
input[type="text"],input[type="password"]{
padding: 4px;
+ margin: 0px;
width: 200px;
font-size: 13px;
border: 1px solid #C4C4C4;
diff --git a/src/app/views/config_servers/_config_server_form.haml b/src/app/views/config_servers/_config_server_form.haml
index 7f1173e..a2e0a31 100644
--- a/src/app/views/config_servers/_config_server_form.haml
+++ b/src/app/views/config_servers/_config_server_form.haml
@@ -1,14 +1,14 @@
- if @config_server.errors.any?
= render 'layouts/error_messages', :object => @config_server
%fieldset
- %p
+ %p.clearfix
= hidden_field_tag "provider_account_id", @provider_account.id
= form.label :endpoint, t('.endpoint')
= form.text_field :endpoint, :class => 'em long'
- %p
+ %p.clearfix
= form.label :key, t('.key')
= form.text_field :key
- %p
+ %p.clearfix
= form.label :secret, t('.secret')
= password_field_tag "config_server[secret]", @config_server.secret
diff --git a/src/app/views/deployables/_form.html.haml b/src/app/views/deployables/_form.html.haml
index 1a097d3..3a372cd 100644
--- a/src/app/views/deployables/_form.html.haml
+++ b/src/app/views/deployables/_form.html.haml
@@ -3,24 +3,24 @@
%fieldset
- if params[:edit_xml]
= hidden_field_tag :edit_xml, true
- %p
+ %p.clearfix
%h2= t('.deployable_xml')
= form.text_area :xml, :class => 'edit_xml'
- else
- %p
+ %p.clearfix
= label_tag :catalog_id, t('.catalog')
%span.text_instead_input
- if @catalog.present?
=@catalog.name
- else
%em=t('deployables.new.no_catalog_selected')
- %p
+ %p.clearfix
= form.label :name, t('deployables.index.name')
= form.text_field :name, :class => 'long'
- %p
+ %p.clearfix
= form.label :description, t('.description')
= form.text_area :description, :class => 'long'
- %p
+ %p.clearfix
= form.label :xml, t('.deployable_xml')
%span.text_instead_input= link_to t("deployables.properties.edit_deployable_xml"), edit_polymorphic_path([@catalog, @deployable], :edit_xml=>true)
diff --git a/src/app/views/deployables/_from_url.html.haml b/src/app/views/deployables/_from_url.html.haml
index 225948e..dc5c8a4 100644
--- a/src/app/views/deployables/_from_url.html.haml
+++ b/src/app/views/deployables/_from_url.html.haml
@@ -3,23 +3,23 @@
= render 'layouts/error_messages', :object => @deployable
%fieldset
= hidden_field_tag('form_option', @form_option)
- %p
+ %p.clearfix
= form.label :catalog_id, t('deployables.form.catalog')
%span.text_instead_input
- if @catalog.present?
=@catalog.name
- else
%em=t('deployables.new.no_catalog_selected')
- %p
+ %p.clearfix
= form.label :name, t('deployables.index.name')
= form.text_field :name, :class => 'em long'
- %p
+ %p.clearfix
= form.label :description, t('deployables.form.description')
= form.text_area :description, :class => 'long'
- %p
+ %p.clearfix
= label_tag :url, t('deployables.form.deployable_xml_url')
= text_field_tag :url, nil, :class => 'long'
- %p
+ %p.clearfix
= label_tag :edit_xml, t('deployables.form.edit_xml_after_save')
= check_box_tag(:edit_xml, true, false)
diff --git a/src/app/views/deployables/_new_from_image.html.haml b/src/app/views/deployables/_new_from_image.html.haml
index fd2d609..c7d148f 100644
--- a/src/app/views/deployables/_new_from_image.html.haml
+++ b/src/app/views/deployables/_new_from_image.html.haml
@@ -11,15 +11,13 @@
%h2= t('.title')
%p= t('.description', :name => @image.name)
%fieldset
- %div
+ %div.clearfix
= form.label :name, t('catalog_entries.new.name')
= form.text_field :name
- .clear
- %div
+ %div.clearfix
= form.label :hardware_profile, t('catalog_entries.new.hw_profile')
= select_tag :hardware_profile, options_from_collection_for_select(@hw_profiles, :id, :name, params[:hardware_profile])
- .clear
- %div
+ %div.clearfix
= form.label :catalog_id, t('deployables.form.catalog')
%span.text_instead_input#checked_catalogs_list= @selected_catalogs.empty? ? t('deployables.form.none') : @selected_catalogs.count > 1 ? t('deployables.form.multiple') : @selected_catalogs.first.name
%span.catalog_link
@@ -36,7 +34,6 @@
= catalog.name
.clear
- .clear
.centered
%fieldset.align-center
= link_to t('deployables.form.cancel'), catalogs_path, :class => 'button danger'
diff --git a/src/app/views/deployables/_upload.html.haml b/src/app/views/deployables/_upload.html.haml
index b52a63a..e26ae15 100644
--- a/src/app/views/deployables/_upload.html.haml
+++ b/src/app/views/deployables/_upload.html.haml
@@ -3,23 +3,23 @@
= render 'layouts/error_messages', :object => @deployable
%fieldset
= hidden_field_tag('form_option', @form_option)
- %p
+ %p.clearfix
= label_tag :catalog_id, t('deployables.form.catalog')
%span.text_instead_input
-if @catalog.present?
=@catalog.name
- else
%em=t('deployables.new.no_catalog_selected')
- %p
+ %p.clearfix
= form.label :name, t('deployables.index.name')
= form.text_field :name, :class => 'em long'
- %p
+ %p.clearfix
= form.label :description, t('deployables.form.description')
= form.text_area :description, :class => 'long'
- %p
+ %p.clearfix
= form.label :xml, t('deployables.form.choose_xml')
= form.file_field :xml
- %p
+ %p.clearfix
= label_tag :edit_xml, t('deployables.form.edit_xml_after_save')
= check_box_tag(:edit_xml, true, false)
diff --git a/src/app/views/images/import.html.haml b/src/app/views/images/import.html.haml
index e83fa2f..1846aeb 100644
--- a/src/app/views/images/import.html.haml
+++ b/src/app/views/images/import.html.haml
@@ -12,13 +12,13 @@
= form_tag(import_images_path, { :multipart => true, :method => :post, :class => :generic }) do
= hidden_field_tag :environment, @environment.id
%fieldset
- %p
+ %p.clearfix
= label_tag :provider_account, t('.provider_account')
= select_tag :provider_account, options_for_select(@accounts.collect{|x| [x.label, x.id]})
- %p
+ %p.clearfix
= label_tag :image_id, t('.image_id')
= text_field_tag :image_id
- %p
+ %p.clearfix
= label_tag :name, t('.name')
= text_field_tag :name
diff --git a/src/app/views/images/new.html.haml b/src/app/views/images/new.html.haml
index 90a348d..b14fe46 100644
--- a/src/app/views/images/new.html.haml
+++ b/src/app/views/images/new.html.haml
@@ -24,13 +24,13 @@
= form_tag(edit_xml_images_path, { :multipart => true, :class => 'generic' }) do
= hidden_field_tag :environment, @environment.id
%fieldset
- %p
+ %p.clearfix
= label_tag :name, t('.name')
= text_field_tag :name, @name
- %p
+ %p.clearfix
= label_tag :image_file, t('.choose_file')
= file_field_tag :image_file
- %p
+ %p.clearfix
= label_tag :edit, t('.edit_file')
= check_box_tag :edit, 1, true
@@ -42,13 +42,13 @@
= form_tag(edit_xml_images_path, { :multipart => true, :class => 'generic' }) do
= hidden_field_tag :environment, @environment.id
%fieldset
- %p
+ %p.clearfix
= label_tag :name, t('.name')
= text_field_tag :name, @name
- %p
+ %p.clearfix
= label_tag :image_url, t('.image_url')
= text_field_tag :image_url, params[:image_url]
- %p
+ %p.clearfix
= label_tag :edit, t('.edit_file')
= check_box_tag :edit, 1, true
diff --git a/src/app/views/pool_families/_form.html.haml b/src/app/views/pool_families/_form.html.haml
index 7a37c88..44fb02c 100644
--- a/src/app/views/pool_families/_form.html.haml
+++ b/src/app/views/pool_families/_form.html.haml
@@ -1,12 +1,12 @@
- if @pool_family.errors.any?
= render 'layouts/error_messages', :object => @pool_family
%fieldset
- %p
+ %p.clearfix
= form.label :name, t("pool_families.form.pool_family_name")
= form.text_field :name, :title => 'pool_family_name', :value => @pool_family.name, :class => 'em long'
= form.fields_for :quota do |quota_form|
- %p
+ %p.clearfix
= quota_form.label :maximum_running_instances, t(:maximum_running_instances)
= quota_form.text_field :maximum_running_instances
diff --git a/src/app/views/provider_accounts/_provider_form.html.haml b/src/app/views/provider_accounts/_provider_form.html.haml
index 90c2f47..20aa089 100644
--- a/src/app/views/provider_accounts/_provider_form.html.haml
+++ b/src/app/views/provider_accounts/_provider_form.html.haml
@@ -1,10 +1,10 @@
-%p
+%p.clearfix
= label :provider_account, t('provider_accounts.index.provider_account_name')
= text_field :provider_account, :label, :class => 'em long'
- CredentialDefinition::CREDENTIAL_DEFINITIONS_ORDER.each do |cred_order|
- @provider_account.all_credentials(@provider).each do |cred|
- if cred_order == cred.credential_definition.name
- %p
+ %p.clearfix
= label_tag cred.credential_definition.label
- if cred.credential_definition.input_type == "password"
= password_field_tag "provider_account[credentials_hash][#{cred.credential_definition.name}]", cred.value
@@ -14,10 +14,10 @@
- else
= text_field_tag "provider_account[credentials_hash][#{cred.credential_definition.name}]", cred.value
-%p
+%p.clearfix
= label :provider_account, t('provider_accounts.index.priority')
= text_field :provider_account, :priority, :class => 'em'
-%p
+%p.clearfix
= label_tag t("quotas.quota")
= text_field :quota, :maximum_running_instances, :title => t('provider_accounts.form.quota_instances'), :value => @quota.maximum_running_instances || t('provider_accounts.properties.unlimited'), :id => "quota_instances"
(
diff --git a/src/app/views/provider_accounts/_provider_selection.html.haml b/src/app/views/provider_accounts/_provider_selection.html.haml
index 268512f..a62fd2d 100644
--- a/src/app/views/provider_accounts/_provider_selection.html.haml
+++ b/src/app/views/provider_accounts/_provider_selection.html.haml
@@ -1,12 +1,10 @@
%fieldset#provider_type
- %p
+ %p.clearfix
= label_tag :provider_name, t(".provider_name")
%span.text_instead_input= @provider.name
- .clear
- %p
+ %p.clearfix
= label_tag t('.cloud_type')
%span.text_instead_input= @provider.provider_type.name
- .clear
- unless @provider.provider_type.deltacloud_driver.nil?
= render :partial => "provider_form", :locals => { :provider_type => @provider.provider_type}
- else
diff --git a/src/app/views/providers/_form.html.haml b/src/app/views/providers/_form.html.haml
index e0afdb1..a932dc4 100644
--- a/src/app/views/providers/_form.html.haml
+++ b/src/app/views/providers/_form.html.haml
@@ -1,16 +1,16 @@
- if @provider.errors.any?
= render 'layouts/error_messages', :object => @provider
%fieldset
- %p
+ %p.clearfix
= form.label :name, t('providers.form.provider_name')
= form.text_field :name, :title => t('providers.form.provider_name'), :value => @provider.name, :class => 'long'
- %p
+ %p.clearfix
= form.label :url, t('providers.form.provider_url')
= form.text_field :url, :title => t('providers.form.provider_url'), :value => @provider.url, :class => 'long'
- %p
+ %p.clearfix
= form.label :provider_type_id, t('providers.form.provider_type')
= form.select(:provider_type_id, @provider_type_options, :prompt => t('providers.form.select_type_of_provider'))
- %p
+ %p.clearfix
= form.label :deltacloud_provider, t('providers.form.x_deltacloud_provider.generic')
= form.text_field :deltacloud_provider, :title => t('providers.form.x_deltacloud_provider.generic'), :value => @provider.deltacloud_provider, :class => 'long'
%div#x-deltacloud-provider-legend.clearfix
diff --git a/src/app/views/realm_mappings/new.html.haml b/src/app/views/realm_mappings/new.html.haml
index f65943d..aedadf5 100644
--- a/src/app/views/realm_mappings/new.html.haml
+++ b/src/app/views/realm_mappings/new.html.haml
@@ -12,7 +12,7 @@
= f.hidden_field :realm_or_provider_type
%fieldset
- %p
+ %p.clearfix
- label_method = @realm_target.realm_or_provider_type == 'Realm' ? 'name_with_provider' : 'name'
= select_tag 'realm_backend_target[realm_or_provider_id]', options_from_collection_for_select(@backend_targets, 'id', label_method)
diff --git a/src/app/views/realms/_form.html.haml b/src/app/views/realms/_form.html.haml
index da67129..21d7a67 100644
--- a/src/app/views/realms/_form.html.haml
+++ b/src/app/views/realms/_form.html.haml
@@ -1,11 +1,12 @@
- if @realm.errors.any?
= render 'layouts/error_messages', :object => @realm
%fieldset
- = form.label :name, t('realms.form.realm_name')
- = form.text_field :name, :title => 'realm_name', :value => @realm.name, :class => 'em long'
-%fieldset
- = form.label :description, t('.description')
- = form.text_area :description, :title => 'description', :value => @realm.description
+ %p.clearfix
+ = form.label :name, t('realms.form.realm_name')
+ = form.text_field :name, :title => 'realm_name', :value => @realm.name, :class => 'em long'
+ %p.clearfix
+ = form.label :description, t('.description')
+ = form.text_area :description, :title => 'description', :value => @realm.description
%fieldset.options
= form.submit t('save'), :class => "submit button pill"
diff --git a/src/app/views/users/_form.html.haml b/src/app/views/users/_form.html.haml
index 0dc6bc6..008d8e9 100644
--- a/src/app/views/users/_form.html.haml
+++ b/src/app/views/users/_form.html.haml
@@ -2,30 +2,30 @@
= render 'layouts/error_messages', :object => @user
%fieldset
- %p
+ %p.clearfix
= form.label :first_name, t(:first_name)
= form.text_field :first_name, :class =>"check_change"
- %p
+ %p.clearfix
= form.label :last_name, t(:last_name)
= form.text_field :last_name, :class =>"check_change"
- %p
+ %p.clearfix
= form.label :email, t(:email), :required => true
= form.text_field :email, :class =>"check_change"
%fieldset
- %p
+ %p.clearfix
= form.label :login, t(:choose_name), :required => true
= form.text_field :login, :class => "em check_change"
- %p
+ %p.clearfix
= form.label :password, form.object.new_record? ? t(:choose_password) : t(:change_password), :required => form.object.new_record?
= form.password_field :password
- %p
+ %p.clearfix
= form.label :password_confirmation, t(:confirm_password), :required => form.object.new_record?
= form.password_field :password_confirmation
- if check_privilege(Privilege::MODIFY, User)
%fieldset
= form.fields_for :quota do |quota_form|
- %p
+ %p.clearfix
= quota_form.label :maximum_running_instances, t(:maximum_running_instances)
= quota_form.text_field :maximum_running_instances
--
1.7.7.6
More information about the aeolus-devel
mailing list