Providers in conductor, deltacloud and image_factory
by Mark McLoughlin
Hey,
I started looking at this:
https://www.aeolusproject.org/redmine/issues/1200
"Use deltacloud api for provider names"
but decided to think through things from a higher level again.
I've a fairly jumbled set of notes below, but I'd summarize my
conclusions as:
1) We should move to using a single instance of deltacloud
2) We should drop current provider management UI in Conductor
3) The provider account UI should allow you to supply details of a
RHEV-M or VMWare instance that is not currently known to Conductor
or deltacloud. Or, indeed, choose from any of the known instances.
4) You shouldn't have to re-enter your EC2 credentials for each region
5) Image factory should use the provider/driver details from the
deltacloud API, once some more details are exposed
6) aeolus-image should be able to supply the RHEV-M or VMWare
instance URL to image_factory when doing a push; it gets this URL
from Conductor
7) Similarly, it looks like image_factory requires some other details
for each RHEV-M and VMWare instance. This would need to be in the
'Add Provider Account' dialog and passed by aeolus-image to
image_factory
Meh, that's quite a random set of work items. Anyone have any better
ideas?
Cheers,
Mark.
== Adding Provider Accounts =
In conductor, we need a UI for adding provider accounts.
This should be as straightforward as:
New Provider Account
Provider: [ mock v]
Username: mockuser
Password: ********
[ Add ]
for EC2:
New Provider Account
Provider: [ Amazon EC2 v]
Account number: 1234-5678-1337
Access key: 1DEADBEEF01234567890
Secret access key: ****************************************
Key: [ _________ ] [ Browse ]
Certificate: [ ________ ] [ Browse ]
[ Add ]
for RHEV-M:
New Provider Account
Provider: [ RHEV-M v]
( ) Use existing RHEV-M data center: [ default v]
(x) URL for other RHEV-M data center: http://rhevm.mycorp.com/rhevm-api/
Username: markmc
Domain: rhevm.mycorp.com
Password: ******
[ Add ]
Changes, improvements and rationale:
- When we have a single deltacloud instance for multiple providers, we
can reduce the importance of the "provider" concept in the UI. Only
provider accounts really matter any more
- deltacloud knows about all EC2 regions and automatically exposes a
provider for each one. See the /api/drivers collection and the
configuration in drivers.yaml describing each region/provider
- You only need to enter your credentials once and it is available for
use with all EC2 regions
- We can allow admins to add details of known RHEV-M or VMWare
instances so that they appear as an option. One simple way admins
can do that is by adding the RHEV-M instances as providers in
drivers.yaml, but we should probably have a conductor-level way of
doing it too
- Where deltacloud/conductor doesn't know anything about your RHEV-M
or VMWare instance, you can just enter its URL
- The credentials form is specific to each provider type
= Deltacloud Interface =
Deltacloud has a drivers.yaml file where it stores its knowledge about
different drivers and providers:
---
...
:mock:
:name: Mock
:rhevm:
:name: RHEVM
:entrypoints:
default:
default: "https://rhev-m.localhost:8443/rhevm-api-powershell"
...
:ec2:
:entrypoints:
...
ec2:
us-west-1: ec2.us-west-1.amazonaws.com
ap-southeast-1: ec2.ap-southeast-1.amazonaws.com
eu-west-1: ec2.eu-west-1.amazonaws.com
us-east-1: ec2.us-east-1.amazonaws.com
:name: EC2
Deltacloud can list all the providers it knows about through
the /api/drivers collection:
<drivers>
...
<driver href='http://localhost:3003/api/drivers/ec2' id='ec2'>
<name>EC2</name>
<provider id='us-west-1'></provider>
<provider id='ap-southeast-1'></provider>
<provider id='eu-west-1'></provider>
<provider id='us-east-1'></provider>
</driver>
...
<driver href='http://localhost:3003/api/drivers/rhevm' id='rhevm'>
<name>RHEVM</name>
<provider id='default'></provider>
</driver>
</drivers>
With any deltacloud API call, you should be able to specify the driver
and provider using headers:
X-Deltacloud-Driver: rhevm
X-Deltacloud-Provider: http://rhevm.mycorp.com/rhevm-api/
or matrix params:
GET /api;driver=ec2;provider=us-east-1/instances HTTP/1.1
Work needed:
- It would be nice to see the provider details in the /api/drivers
listing - e.g. the RHEV-M URLs, the EC2 endpoints etc.
- A simple change is needed to support having multiple RHEV-M URLs in
drivers.yaml and exposing them as different providers
- The driver= and provider= matrix params need to be URI encoded so
that we can pass a RHEV-M URL using the param
= Image Factory =
Getting to the original point of all this, image_factory has its own
notion of drivers/provider types/targets and providers.
Much of the information in deltacloud's drivers.yaml could form the
basis for image_factory's knowledge. For a start, we'd stop using
'rhevm' in deltacloud and 'rhev-m' in image_factory.
However, that doesn't account for providers added by Conductor when
deltacloud doesn't already know about the provider.
And finally, it also doesn't account for the other per-provider
knowledge that image_factory has, including:
- For EC2, the boto Location key for a given region:
https://github.com/boto/boto/blob/master/boto/s3/connection.py#L124
- For EC2, the i386 and x86_64 AMIs and AKIs IDs for Fedora 13 and 14
in each region
- For each RHEV-M provider, an NFS host and remote/local paths to use
for doing image uploads
- For VMWare providers, a 'VM host' which is used for image uploads
Some conclusions:
- image_factory doesn't depend on deltacloud right now. However, I
guess that in some far-flung future image_factory should be using
the deltacloud APIs rather than provider specific APIs. Therefore,
we shouldn't be afraid to add a dependency
- The easiest thing would be for image_factory to use deltacloud's
drivers.yaml directly but that's not an API, and may change format.
So, it makes sense that the info that image_factory requires should
from drivers.yaml should be exposed in the api/drivers collection.
- image_factory's other EC2 info should be in a config file, for easy
maintenance (i.e. the AMI/AKI IDs etc.)
- The per RHEV-M and VMWare instance info could be in an
image_factory config file, but we also need to handle the case
where the conductor user has added a provider account for a RHEV-M
instance not in the image_factory config
Perhaps the credentials XML should also contain the provider URL,
as well as the credentials?
- For the RHEV-M NFS details and VMWare 'VM host' details, we need to
consider whether they should be exposed in the conductor 'Add
Provider Account' UI or just in the image_factor config or, even,
automatically detected
12 years, 9 months
Redmine#1808 aeolus-image list work
by Martyn Taylor
Resent 1 and 2, for ease of review.
These patches do not include spec tests. Reason for making this decision:
a) We do not have a HTTP mock setup to produce mock responses
b) Hashing aeolus-image out is higher priority that setting up a)
c) Given a) and b) it would mean tests would have to rely on entries in conductor and iwhd
d) As with other tests in aeolus-image we would have to rewrite the tests once we adding a mocking feature
12 years, 9 months
#671 - BZ 691562 fix
by Matt Wagner
Hi all,
I spent a bit of time tracking down the remnants of #671 / BZ 651562, in
which Apache throws proxy timeout errors because the backend does not
respond in time as a result of API calls timing out.
Most of these errors were fixed a bit ago in deltacloud-client, but it
seems that the versions yum and gem know about don't have this fix, so
the issue was seemingly not fixed. I spent a bit getting deltacloud
0.3.0 running, and was unable to reproduce any errors with Apache
timeouts after attempting to simulate unreachable providers and other
cases where a timeout may occur. The timeouts in deltacloud-client are
slightly shorter than Apache's timeout value.
I'm attaching a patch that cleans up error handling in Conductor
slightly. There were a few spots (e.g., adding a new ProviderAccount
when the provider was unreachable) where the timeout exception was
reaching the user unhandled. This exception now triggers as a
flash[:error] message when raised, in lieu of a hard error.
You will need the 0.3.0 version of deltacloud to test this. (Some older
versions may work, but best not to chance it.) You can build this from
their source, although I suspect some of you already the 0.3.0 RC
installed.
-- Matt
12 years, 10 months
[PATCH conductor] Enhanced match method
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Added check for matching HW profile
---
src/app/models/instance.rb | 4 ++++
src/spec/models/instance_spec.rb | 7 +++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index aba031b..c34d647 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -325,6 +325,10 @@ class Instance < ActiveRecord::Base
# hardware_profile that can satisfy the input hardware_profile
hwp = HardwareProfile.match_provider_hardware_profile(account.provider,
hardware_profile)
+ unless hwp
+ errors << "#{account.name}: hardware profile match not found"
+ next
+ end
account_images = provider_images.select {|pi| pi.provider == account.provider}
if account_images.empty?
errors << "#{account.name}: image is not pushed to this provider account"
diff --git a/src/spec/models/instance_spec.rb b/src/spec/models/instance_spec.rb
index de2154c..5856951 100644
--- a/src/spec/models/instance_spec.rb
+++ b/src/spec/models/instance_spec.rb
@@ -153,6 +153,13 @@ describe Instance do
@instance.matches.last.should include('testaccount: image is not pushed to this provider account')
end
+ it "shouldn't match provider accounts where matching hardware profile not found" do
+ account = Factory(:mock_provider_account, :label => 'testaccount')
+ account.provider.hardware_profiles.destroy_all
+ @pool.pool_family.provider_accounts << account
+ @instance.matches.last.should include('testaccount: hardware profile match not found')
+ end
+
it "should return a match if all requirements are satisfied" do
build = @instance.image_build || @instance.image.latest_build
provider = Factory(:mock_provider, :name => build.provider_images.first.provider_name)
--
1.7.4
12 years, 10 months
[PATCH conductor] Add delete confirmation to Pools filter view pages
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
This is somewhat related to the bug #717538
https://bugzilla.redhat.com/show_bug.cgi?id=717538
When a table of objects was loaded via ajax (for example by switching to the
Filter View), the javascript click handlers set up in `multiDestroyValidation`
under application.js were lost.
As a result, some Delete buttons no longer asked for confirmation on delete.
---
src/public/javascripts/application.js | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/public/javascripts/application.js b/src/public/javascripts/application.js
index 975cf92..e6b5c42 100644
--- a/src/public/javascripts/application.js
+++ b/src/public/javascripts/application.js
@@ -147,7 +147,7 @@ var Conductor = {
},
multiDestroyValidation: function() {
- $('#delete_button').click(function(e) {
+ $('#delete_button').live('click', function(e) {
if ($(".checkbox_table input[@type=radio]:checked").length == 0) {
alert('Please make a selection before clicking Delete button.');
e.preventDefault();
--
1.7.4.4
12 years, 10 months
[PATCH conductor] BZ 717172 - fixed realm mapping deletion
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
Added class "checkbox_table" to mapping lists (this class is required for using
global delete confirm hook). Class name is little bit confusing, but this view
will be reworked anyway.
---
src/app/views/realms/_mapping.haml | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/views/realms/_mapping.haml b/src/app/views/realms/_mapping.haml
index dea5cda..f89cc8b 100644
--- a/src/app/views/realms/_mapping.haml
+++ b/src/app/views/realms/_mapping.haml
@@ -5,7 +5,7 @@
- unless @backend_provider_targets.empty?
%h2 Realm '#{(a)realm.name}' is mapped to providers:
- %ul
+ %ul{:class => 'checkbox_table'}
- @backend_provider_targets.each do |backend|
%li
%input{:name => "id[]", :type => "checkbox", :value => backend.id, :id => "backend_id_#{backend.id}"}
@@ -13,7 +13,7 @@
- unless @backend_realm_targets.empty?
%h2 Realm '#{(a)realm.name}' is mapped to realms:
- %ul
+ %ul{:class => 'checkbox_table'}
- @backend_realm_targets.each do |backend|
%li
%input{:name => "id[]", :type => "checkbox", :value => backend.id, :id => "backend_id_#{backend.id}"}
--
1.7.4
12 years, 10 months
[PATCH conductor] BZ 717585 - fixed flash[:error] formatting
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
---
src/app/views/layouts/_new_notification.haml | 50 ++++++++++++++------------
1 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/src/app/views/layouts/_new_notification.haml b/src/app/views/layouts/_new_notification.haml
index 8e7fbbd..67ded3d 100644
--- a/src/app/views/layouts/_new_notification.haml
+++ b/src/app/views/layouts/_new_notification.haml
@@ -25,29 +25,33 @@
%li= flash[:warning]
-if flash[:error]
- -if !flash[:error][:successes].nil? && !flash[:error][:successes].empty?
- .notice.flash-group
- .flash-subset
- %div.heading
- =image_tag 'flash_notice_icon.png', :alt => 'Notices'
- %ul.flashes
- - flash[:error][:successes].each do |k, v|
- %li= "#{k}: #{v}"
- .error.flash-group
- .flash-subset
- %div.heading
- =image_tag 'flash_warning_icon.png', :alt => 'Warnings'
- %ul.flashes
- %li= flash[:error][:summary]
+ -if flash[:error].kind_of?(String)
.flash-subset
%div.heading
=image_tag 'flash_error_icon.png', :alt => 'Errors'
- %ul.flashes
- -if flash[:error].kind_of?(String)
- %li= flash[:error]
- -elsif !flash[:error][:failures].nil? && !flash[:error][:failures].empty?
- -flash[:error][:failures].each do |k, v|
- %li= [k, ': ', v]
- -else
- -flash[:error].each do |e|
- %li= e
+ =flash[:error]
+ -else
+ -if !flash[:error][:successes].nil? && !flash[:error][:successes].empty?
+ .notice.flash-group
+ .flash-subset
+ %div.heading
+ =image_tag 'flash_notice_icon.png', :alt => 'Notices'
+ %ul.flashes
+ - flash[:error][:successes].each do |k, v|
+ %li= "#{k}: #{v}"
+ .error.flash-group
+ .flash-subset
+ %div.heading
+ =image_tag 'flash_warning_icon.png', :alt => 'Warnings'
+ %ul.flashes
+ %li= flash[:error][:summary]
+ .flash-subset
+ %div.heading
+ =image_tag 'flash_error_icon.png', :alt => 'Errors'
+ %ul.flashes
+ -if !flash[:error][:failures].nil? && !flash[:error][:failures].empty?
+ -flash[:error][:failures].each do |k, v|
+ %li= [k, ': ', v]
+ -else
+ -flash[:error].each do |e|
+ %li= e
--
1.7.4
12 years, 10 months
[PATCH conductor] UI for deleting deployables
by Tomas Sedovic
From: Tomas Sedovic <tsedovic(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=711294
A deployable can be deleted only when all of its instances are stopped or in
the "create_failed" state.
This also removes UI for deleting instances directly.
---
src/app/controllers/deployments_controller.rb | 2 +-
src/app/controllers/instances_controller.rb | 22 ----------------------
src/app/models/deployment.rb | 2 +-
src/app/views/deployments/_header_show.haml | 2 ++
src/app/views/instances/_list.haml | 1 -
src/features/deployment.feature | 7 +++++++
src/features/instance.feature | 8 --------
src/spec/models/deployment_spec.rb | 18 ++++++++++++++++++
8 files changed, 29 insertions(+), 33 deletions(-)
diff --git a/src/app/controllers/deployments_controller.rb b/src/app/controllers/deployments_controller.rb
index 4140620..6fadb88 100644
--- a/src/app/controllers/deployments_controller.rb
+++ b/src/app/controllers/deployments_controller.rb
@@ -163,7 +163,7 @@ class DeploymentsController < ApplicationController
load_deployments
render :partial => 'list'
end
- format.html { redirect_to deployments_url }
+ format.html { redirect_to pools_url }
format.json { render :json => {:success => destroyed, :errors => failed} }
end
end
diff --git a/src/app/controllers/instances_controller.rb b/src/app/controllers/instances_controller.rb
index fa60438..004da1f 100644
--- a/src/app/controllers/instances_controller.rb
+++ b/src/app/controllers/instances_controller.rb
@@ -151,28 +151,6 @@ class InstancesController < ApplicationController
end
end
- def remove_failed
- notices = ""
- errors = ""
- Instance.find(params[:instance_selected]).each do |instance|
- begin
- require_privilege(Privilege::USE,instance)
- raise ActionError.new("remove failed cannot be performed on this instance.") unless
- instance.state == Instance::STATE_ERROR
- condormatic_instance_reset_error(instance)
- notices << "#{instance.name}: remove failed action was successfully queued."
- rescue Exception => err
- errors << "#{instance.name}: " + err + "<br/>"
- end
- end
- flash[:notice] = notices unless notices.blank?
- flash[:error] = errors unless errors.blank?
- respond_to do |format|
- format.html { redirect_to instances_path }
- format.json { render :json => {:success => notices, :errors => errors}, :status => :unprocessable_entity }
- end
- end
-
def can_create
respond_to do |format|
begin
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index ea78cd8..dae2f65 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -47,7 +47,7 @@ class Deployment < ActiveRecord::Base
belongs_to :pool
- has_many :instances
+ has_many :instances, :dependent => :destroy
belongs_to :realm
belongs_to :frontend_realm
diff --git a/src/app/views/deployments/_header_show.haml b/src/app/views/deployments/_header_show.haml
index a6ecc9c..511917c 100644
--- a/src/app/views/deployments/_header_show.haml
+++ b/src/app/views/deployments/_header_show.haml
@@ -4,4 +4,6 @@
#obj_actions.button-container
.button-group
= pretty_filter_toggle(deployment_path(@deployment, :view => 'pretty'), deployment_path(@deployment, :view => 'filter'))
+ .button-group
+ = button_to 'Delete', deployment_path(@deployment), :method => :delete, :confirm => "Are you sure you vant to delete this deployment?", :class => "button pill danger"
.corner
diff --git a/src/app/views/instances/_list.haml b/src/app/views/instances/_list.haml
index a80606f..fe34ed6 100644
--- a/src/app/views/instances/_list.haml
+++ b/src/app/views/instances/_list.haml
@@ -1,6 +1,5 @@
- form_tag do
= restful_submit_tag 'Stop', 'stop', multi_stop_instances_path, 'GET', :class => 'button'
- = restful_submit_tag 'Remove failed', 'remove_failed', remove_failed_instances_path, 'GET', :class => 'button'
= render :partial => 'layouts/select_all_none'
diff --git a/src/features/deployment.feature b/src/features/deployment.feature
index 257fedc..9c72262 100644
--- a/src/features/deployment.feature
+++ b/src/features/deployment.feature
@@ -166,3 +166,10 @@ Feature: Manage Deployments
When I follow "Instances"
Then I should see "testdeployment"
+
+ Scenario: Delete a deployment
+ Given there is a deployment named "testdeployment" belonging to "testdeployable" owned by "testuser"
+ And I am on the pools page
+ When I follow "testdeployment"
+ And I press "Delete"
+ Then I should see "The deployment testdeployment was successfully deleted"
diff --git a/src/features/instance.feature b/src/features/instance.feature
index 4ae087a..4b1bed4 100644
--- a/src/features/instance.feature
+++ b/src/features/instance.feature
@@ -65,14 +65,6 @@ Feature: Manage Instances
Then I should get back a partial
And I should see "Name"
- Scenario: Remove failed instances
- Given there is a "mock1" failed instance
- And I am on the instances page
- When I check "mock1" instance
- And I press "Remove failed"
- Then I should be on the instances page
- And I should see "mock1: remove failed action was successfully queued"
-
Scenario: Stop instance
Given there is a "mock1" running instance
And I am on the instances page
diff --git a/src/spec/models/deployment_spec.rb b/src/spec/models/deployment_spec.rb
index bde2358..b7d9883 100644
--- a/src/spec/models/deployment_spec.rb
+++ b/src/spec/models/deployment_spec.rb
@@ -70,4 +70,22 @@ describe Deployment do
@deployment.properties.should be_a_kind_of(Hash)
@deployment.properties.should == {:created=>nil, :pool=>@deployment.pool.name, :owner=>"John Smith", :name=>@deployment.name}
end
+
+ it "should be removable under with stopped or create_failed instances" do
+ @deployment.save!
+ inst1 = Factory.create :mock_running_instance, :deployment_id => @deployment.id
+ inst2 = Factory.create :mock_running_instance, :deployment_id => @deployment.id
+
+ @deployment.should_not be_destroyable
+ @deployment.destroy.should == false
+
+ inst1.state = Instance::STATE_CREATE_FAILED
+ inst1.save!
+ inst2.state = Instance::STATE_STOPPED
+ inst2.save!
+
+ @deployment = Deployment.find((a)deployment.id)
+ @deployment.should be_destroyable
+ expect { @deployment.destroy }.to change(Deployment, :count).by(-1)
+ end
end
--
1.7.4.4
12 years, 10 months
[PATCH conductor] Cleaned up forms across the application.
by kkeiter@redhat.com
From: Kenneth Keiter <kkeiter(a)redhat.com>
---
src/app/stylesheets/layout.scss | 178 +++++++++++++++++++-
src/app/views/pool_families/_form.haml | 14 +-
src/app/views/pool_families/edit.haml | 2 +-
src/app/views/pool_families/new.haml | 2 +-
src/app/views/pools/_form.haml | 50 ++++---
src/app/views/provider_accounts/_form.haml | 4 +-
.../views/provider_accounts/_provider_form.haml | 33 ++--
.../provider_accounts/_provider_selection.haml | 20 ++-
src/app/views/provider_accounts/edit.haml | 2 +-
src/app/views/provider_accounts/new.haml | 2 +-
src/app/views/providers/_form.haml | 23 ++--
src/app/views/providers/edit.haml | 2 +-
src/app/views/providers/new.haml | 2 +-
src/app/views/realms/_form.haml | 6 +-
src/app/views/realms/edit.haml | 2 +-
src/app/views/realms/new.haml | 2 +-
src/app/views/roles/_form.haml | 6 +-
src/app/views/roles/edit.haml | 2 +-
src/app/views/roles/new.haml | 2 +-
src/app/views/suggested_deployables/_form.haml | 19 +-
src/app/views/suggested_deployables/edit.haml | 2 +-
src/app/views/suggested_deployables/new.haml | 2 +-
src/app/views/users/_form.haml | 74 +++++----
src/app/views/users/edit.haml | 2 +-
src/app/views/users/new.haml | 2 +-
25 files changed, 331 insertions(+), 124 deletions(-)
diff --git a/src/app/stylesheets/layout.scss b/src/app/stylesheets/layout.scss
index 18fff1c..d8e8315 100644
--- a/src/app/stylesheets/layout.scss
+++ b/src/app/stylesheets/layout.scss
@@ -1,6 +1,6 @@
/* ###########################################################################
Generated SCSS for Aeolus UI [aeolus_ui]
-Compiled on 2011-06-16 22:42:20 -0700
+Compiled on Wed Jun 29 20:41:07 -0700 2011
########################################################################### */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2331,6 +2331,182 @@ ul.deployment-array.small + ul.deployment-array.small{
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Flat Table Component -- v.0.0.1 [flat_table] (flat_table.scss)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+$font-family-primary: Helvetica, Arial, "Lucida Grande", sans-serif;
+
+/* padding configuration */
+$th_padding: 8px 10px 8px 10px;
+$td_padding: 8px;
+
+/* color configuration */
+$cell_color_base: #ffffff;
+$cell_color_header: #cccccc;
+$cell_color_stripe: #efefef;
+$cell_color_selected: #f9fafe;
+$cell_color_gradient: 5%;
+
+$cell_header_text_color: #666666;
+
+/* useful mixins */
+@mixin gradient-bg($from, $to){
+ background-color: $cell_color_base;
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($from), to($to));
+ background-image: -moz-linear-gradient($from, $to);
+ background-image: -o-linear-gradient($from, $to);
+ background-image: linear-gradient($from, $to);
+}
+
+/* Flat Table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+table.flat{
+
+ border-collapse: separate;
+ font-family: $font-family-primary;
+
+ /* header */
+
+ th{
+ @include gradient-bg($cell_color_base, $cell_color_header);
+ text-align: center;
+ font-size: 11px;
+ color: $cell_header_text_color;
+ font-weight: bold;
+ text-shadow: 0px 1px 0px #ffffff;
+ padding: $th_padding;
+ border-bottom: 1px solid #D6DADD;
+ border-left: 1px solid darken(#E9EAEC, $cell_color_gradient);
+ }
+
+ th.ignore{
+ background-color: transparent;
+ background-image: none;
+ border: 0;
+ }
+
+ th.ignore + th{
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-left-radius: 5px;
+ }
+
+ td{
+ $cell_color_end: darken($cell_color_base, $cell_color_gradient);
+ border-spacing: 0px;
+ text-align: center;
+ padding: $td_padding;
+ border-top: 1px solid #fff;
+ font-size: 12px;
+ color: #333;
+ @include gradient-bg($cell_color_base, $cell_color_end);
+ border-top: 1px solid #fff;
+ border-left: 1px solid #fff;
+ border-bottom: 1px solid darken($cell_color_end, $cell_color_gradient);
+ border-right: 1px solid darken($cell_color_end, $cell_color_gradient);
+ }
+
+ tr{
+ height: 30px;
+ }
+
+ tr.stripe{
+ td{
+ $cell_color_end: darken($cell_color_stripe, $cell_color_gradient);
+ @include gradient-bg($cell_color_stripe, $cell_color_end);
+ border-bottom: 1px solid darken($cell_color_stripe, $cell_color_gradient);
+ border-right: 1px solid darken($cell_color_stripe, $cell_color_gradient);
+ }
+ }
+
+ tr.selected{
+ td{
+ $cell_color_end: darken($cell_color_selected, $cell_color_gradient);
+ @include gradient-bg($cell_color_selected, $cell_color_end);
+ border-top: 1px solid #fff;
+ border-left: 1px solid #fff;
+ border-bottom: 1px solid darken($cell_color_end, $cell_color_gradient);
+ border-right: 1px solid darken($cell_color_end, $cell_color_gradient);
+ }
+ }
+
+}
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Form Components -- v.0.0.1 [form] (form.scss)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+$font-family-base: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
+$label-font: "Lucida Sans", "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
+$font-family-primary: Helvetica, Arial, "Lucida Grande", sans-serif;
+
+form.generic{
+
+ fieldset{
+ p + p{
+ margin-top: 10px;
+ }
+ p.radio-group label{
+ display: inline;
+ }
+ }
+
+ fieldset.inline p{
+ display: inline-block;
+ }
+
+ fieldset.em{
+ padding: 10px;
+ background-color: #dfdfdf;
+ border: 1px solid #999;
+ margin: 10px 0px 10px 0px;
+ }
+
+ fieldset + fieldset{
+ margin-top: 10px;
+ }
+
+ fieldset legend{
+ font-family: $font-family-primary;
+ font-size: 16px;
+ font-weight: light;
+ }
+
+ label{
+ display: block;
+ font-family: $label-font;
+ font-size: 12px;
+ text-shadow: 0px 1px 0px #ffffff;
+ padding-bottom: 2px;
+ font-weight: normal;
+ }
+
+ label span{
+ font-size: 11px;
+ color: #666;
+ }
+
+ input[type="text"],input[type="password"]{
+ padding: 4px;
+ width: 200px;
+ font-size: 13px;
+ }
+
+ input.em{
+ font-size: 16px;
+ padding: 6px;
+ }
+
+ input.long{
+ width: 400px;
+ }
+
+ input.short{
+ width: 100px;
+ }
+
+}
+
+/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Page Footer -- v.0.0.1 [footer] (footer.scss)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
diff --git a/src/app/views/pool_families/_form.haml b/src/app/views/pool_families/_form.haml
index e196468..2027f78 100644
--- a/src/app/views/pool_families/_form.haml
+++ b/src/app/views/pool_families/_form.haml
@@ -1,12 +1,14 @@
= error_messages_for :pool_family
-= form.error_message_on :name, 'Name '
%fieldset
- = form.label :name,'Pool Family Name:'
- = form.text_field :name, :title => 'pool_family_name', :value => @pool_family.name
+ %p
+ = form.label :name,'Pool Family Name'
+ = form.text_field :name, :title => 'pool_family_name', :value => @pool_family.name, :class => 'em long'
+
%fieldset
- form.fields_for :quota do |quota_form|
- %fieldset
- = quota_form.label :maximum_running_instances, t(:maximum_running_instances), :class => "alpha grid_3"
+ %p
+ = quota_form.label :maximum_running_instances, t(:maximum_running_instances)
= quota_form.text_field :maximum_running_instances
-%fieldset
+
+%fieldset.options
= form.submit "Save", :class => "submit button"
diff --git a/src/app/views/pool_families/edit.haml b/src/app/views/pool_families/edit.haml
index e827862..73c35b3 100644
--- a/src/app/views/pool_families/edit.haml
+++ b/src/app/views/pool_families/edit.haml
@@ -13,5 +13,5 @@
%h2 Properties
.content
- -form_for @pool_family, :url => pool_family_path(@pool_family), :html => { :method => :put } do |f|
+ -form_for @pool_family, :url => pool_family_path(@pool_family), :html => { :method => :put, :class => 'generic' } do |f|
= render :partial => 'form', :locals => { :form => f, :cancel_path => providers_path }
diff --git a/src/app/views/pool_families/new.haml b/src/app/views/pool_families/new.haml
index 45130fa..0bf86b2 100644
--- a/src/app/views/pool_families/new.haml
+++ b/src/app/views/pool_families/new.haml
@@ -6,5 +6,5 @@
%h2 New Pool Family
.content
- - form_for @pool_family, :url => pool_families_path do |f|
+ - form_for @pool_family, :url => pool_families_path, :html => {:class => 'generic'} do |f|
= render :partial => "form", :locals => { :form => f, :cancel_path => pool_families_path }
diff --git a/src/app/views/pools/_form.haml b/src/app/views/pools/_form.haml
index e2f1b66..ad79aaa 100644
--- a/src/app/views/pools/_form.haml
+++ b/src/app/views/pools/_form.haml
@@ -1,27 +1,37 @@
-- form_for @pool do |form|
+- form_for @pool, :html => {:class => 'generic'} do |form|
= error_messages_for :pool
+
%fieldset
- = form.label :name, "Name:", :class => "grid_2 alpha"
- = form.text_field :name
- %fieldset
- = form.label :pool_family_id, "Pool Family:", :class => "grid_2 alpha"
- = form.collection_select :pool_family_id, PoolFamily.all, :id, :name
+ %p
+ = form.label :name, "Name"
+ = form.text_field :name, :class => 'em long'
+ %p
+ = form.label :pool_family_id, "Pool Family"
+ = form.collection_select :pool_family_id, PoolFamily.all, :id, :name
+
%fieldset
- = label_tag "Quota:"
- = text_field :quota, :maximum_running_instances, :title => t('provider_accounts.form.quota_instances'), :value => @quota.maximum_running_instances || "unlimited", :id => "quota_instances", :class => "grid_3 omega"
- (
- %button.linkbutton.nospace{ :type => 'button', :onclick => "set_unlimited_quota(\"quota_instances\");" }<>
- = t('provider_accounts.form.unlimited_quota')
- )
+ %p
+ %label
+ Quota
+ %span
+ (# instances or
+ %a#unlimited_quota_btn{:href => '#'} unlimited
+ )
+ = text_field :quota, :maximum_running_instances, :title => t('provider_accounts.form.quota_instances'), :value => @quota.maximum_running_instances || "unlimited", :id => "quota_instances"
+
%fieldset
- = form.label :enabled, "Enabled:",{ :class => "grid_2 alpha" }
- = form.check_box :enabled
- %fieldset.clear
+ %p
+ = form.label :enabled, "Pool Enabled?"
+ = form.check_box :enabled
- = form.submit "Save", :class => 'button'
- = link_to 'Cancel', pools_path, :class => 'button danger'
+ %fieldset.options
+ = form.submit "Save", :class => 'button'
+ = link_to 'Cancel', pools_path, :class => 'button danger'
:javascript
- function set_unlimited_quota(elem_id) {
- $("#" + elem_id)[0].value = "unlimited";
- }
+ $(document).ready(function(){
+ $('#unlimited_quota_btn').click(function(){
+ $('#quota_instances').val('unlimited');
+ return false;
+ });
+ });
diff --git a/src/app/views/provider_accounts/_form.haml b/src/app/views/provider_accounts/_form.haml
index 8959966..b935687 100644
--- a/src/app/views/provider_accounts/_form.haml
+++ b/src/app/views/provider_accounts/_form.haml
@@ -1,5 +1,5 @@
= error_messages_for :provider_account
= render :partial => 'provider_selection'
-%fieldset
+%fieldset.options
= form.submit 'Save', :class => "button"
- = link_to t(:cancel), provider_accounts_path, :class => 'button button danger'
+ = link_to t(:cancel), provider_accounts_path, :class => 'button danger'
diff --git a/src/app/views/provider_accounts/_provider_form.haml b/src/app/views/provider_accounts/_provider_form.haml
index 9240934..35e2520 100644
--- a/src/app/views/provider_accounts/_provider_form.haml
+++ b/src/app/views/provider_accounts/_provider_form.haml
@@ -1,25 +1,28 @@
%fieldset
- = label :provider_account, "Account name:"
- = text_field :provider_account, :label
+ %p
+ = label :provider_account, "Account Name"
+ = text_field :provider_account, :label, :class => 'em long'
- CredentialDefinition::CREDENTIAL_DEFINITIONS_ORDER.each do |cred_order|
- @provider_account.all_credentials((a)selected_provider).each do |cred|
- if cred_order == cred.credential_definition.name
%fieldset
- = 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
- - elsif cred.credential_definition.input_type == "file"
- = file_field_tag "provider_account[credentials_hash][#{cred.credential_definition.name}]", :value => cred.value
- - else
- = text_field_tag "provider_account[credentials_hash][#{cred.credential_definition.name}]", cred.value
+ %p
+ = 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
+ - elsif cred.credential_definition.input_type == "file"
+ = file_field_tag "provider_account[credentials_hash][#{cred.credential_definition.name}]", :value => cred.value
+ - else
+ = text_field_tag "provider_account[credentials_hash][#{cred.credential_definition.name}]", cred.value
-= label_tag "Quota"
-= text_field :quota, :maximum_running_instances, :title => t('provider_accounts.form.quota_instances'), :value => @quota.maximum_running_instances || "unlimited", :id => "quota_instances", :class => "grid_3 omega"
-(
-%button.linkbutton.nospace{ :type => 'button', :onclick => "set_unlimited_quota(\"quota_instances\");" }<>
- = t('provider_accounts.form.unlimited_quota')
-)
%fieldset
+ %p
+ = label_tag "Quota"
+ = text_field :quota, :maximum_running_instances, :title => t('provider_accounts.form.quota_instances'), :value => @quota.maximum_running_instances || "unlimited", :id => "quota_instances"
+ (
+ %button.linkbutton.nospace{ :type => 'button', :onclick => "set_unlimited_quota(\"quota_instances\");" }<>
+ = t('provider_accounts.form.unlimited_quota')
+ )
:javascript
function set_unlimited_quota(elem_id) {
diff --git a/src/app/views/provider_accounts/_provider_selection.haml b/src/app/views/provider_accounts/_provider_selection.haml
index 27176b5..0dee71e 100644
--- a/src/app/views/provider_accounts/_provider_selection.haml
+++ b/src/app/views/provider_accounts/_provider_selection.haml
@@ -1,13 +1,15 @@
%fieldset#provider_type
- = label_tag "Provider: "
- = select(:provider_account, :provider_id, options_for_select((a)providers.map{ |p| [p.name, p.id] }, :selected => @selected_provider.id))
- = restful_submit_tag "Choose", 'set_selected_provider',set_selected_provider_provider_accounts_path, 'GET', :class => 'button'
- = label_tag "Cloud type: "
- = @selected_provider.provider_type.name
- - unless @selected_provider.provider_type.codename.nil?
- = render :partial => "provider_form", :locals => { :provider_type => @selected_provider.provider_type}
- - else
- = flash.now[:warning] = "You don't have any provider yet"
+ %p
+ = label_tag "Provider"
+ = select(:provider_account, :provider_id, options_for_select((a)providers.map{ |p| [p.name, p.id] }, :selected => @selected_provider.id))
+ = restful_submit_tag "Choose", 'set_selected_provider',set_selected_provider_provider_accounts_path, 'GET', :class => 'button'
+ %p
+ = label_tag "Cloud type: "
+ = @selected_provider.provider_type.name
+ - unless @selected_provider.provider_type.codename.nil?
+ = render :partial => "provider_form", :locals => { :provider_type => @selected_provider.provider_type}
+ - else
+ = flash.now[:warning] = "You don't have any provider yet"
:javascript
$(document).ready(function(){
diff --git a/src/app/views/provider_accounts/edit.haml b/src/app/views/provider_accounts/edit.haml
index 8a35dbf..4ab22b1 100644
--- a/src/app/views/provider_accounts/edit.haml
+++ b/src/app/views/provider_accounts/edit.haml
@@ -15,5 +15,5 @@
.content
- unless @providers.empty?
- - form_for(@provider_account, :url => provider_account_path(@provider_account), :html => {:multipart => true,:method => :put}) do |f|
+ - form_for(@provider_account, :url => provider_account_path(@provider_account), :html => {:multipart => true,:method => :put, :class => 'generic'}) do |f|
= render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/provider_accounts/new.haml b/src/app/views/provider_accounts/new.haml
index f5ef97d..61346c7 100644
--- a/src/app/views/provider_accounts/new.haml
+++ b/src/app/views/provider_accounts/new.haml
@@ -7,5 +7,5 @@
.content
- unless @providers.empty?
- - form_for(@provider_account, :url => provider_accounts_path, :html => {:multipart => true}) do |f|
+ - form_for(@provider_account, :url => provider_accounts_path, :html => {:multipart => true, :class => 'generic'}) do |f|
= render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/providers/_form.haml b/src/app/views/providers/_form.haml
index 7c7b991..f07ed24 100644
--- a/src/app/views/providers/_form.haml
+++ b/src/app/views/providers/_form.haml
@@ -1,14 +1,15 @@
= form.error_messages
%fieldset
- = form.label :name,'Provider name:'
- = form.text_field :name, :title => 'provider_name', :value => @provider.name
-%fieldset
- = form.label :url, 'Provider URL:'
- = form.text_field :url, :title => 'provider_url', :value => @provider.url
-%fieldset
- = form.label :provider_type
- = form.select(:provider_type_id, ProviderType.all.collect {|provider_type| [provider_type.name,provider_type.id] }, :prompt => "Select type of provider")
+ %p
+ = form.label :name,'Provider name:'
+ = form.text_field :name, :title => 'provider_name', :value => @provider.name, :class => 'em long'
+ %p
+ = form.label :url, 'Provider URL:'
+ = form.text_field :url, :title => 'provider_url', :value => @provider.url, :class => 'long'
+ %p
+ = form.label :provider_type
+ = form.select(:provider_type_id, ProviderType.all.collect {|provider_type| [provider_type.name,provider_type.id] }, :prompt => "Select type of provider")
-%fieldset
- = form.submit "Save", :class => "submit button button"
- = link_to t(:cancel), cancel_path, :class => 'button button danger'
+%fieldset.options
+ = form.submit "Save", :class => "submit button"
+ = link_to t(:cancel), cancel_path, :class => 'button danger'
diff --git a/src/app/views/providers/edit.haml b/src/app/views/providers/edit.haml
index 89e4b3a..2cef1e2 100644
--- a/src/app/views/providers/edit.haml
+++ b/src/app/views/providers/edit.haml
@@ -15,5 +15,5 @@
= @provider.name
.content
- -form_for @provider, :url => provider_path(@provider), :html => { :method => :put } do |f|
+ -form_for @provider, :url => provider_path(@provider), :html => { :method => :put, :class => 'generic' } do |f|
= render :partial => 'form', :locals => { :form => f, :cancel_path => provider_path(@provider)}
diff --git a/src/app/views/providers/new.haml b/src/app/views/providers/new.haml
index 763e250..4cb3965 100644
--- a/src/app/views/providers/new.haml
+++ b/src/app/views/providers/new.haml
@@ -5,5 +5,5 @@
%header
%h2 New Provider
.content
- - form_for @provider, :url => providers_path do |f|
+ - form_for @provider, :url => providers_path, :html => {:class => 'generic'} do |f|
= render :partial => "form", :locals => { :form => f, :cancel_path => providers_path }
diff --git a/src/app/views/realms/_form.haml b/src/app/views/realms/_form.haml
index 6b826f2..684aa1a 100644
--- a/src/app/views/realms/_form.haml
+++ b/src/app/views/realms/_form.haml
@@ -1,6 +1,6 @@
= form.error_messages
%fieldset
- = form.label :name,'Realm Name :'
- = form.text_field :name, :title => 'realm_name', :value => @realm.name
-%fieldset
+ = form.label :name, 'Realm Name'
+ = form.text_field :name, :title => 'realm_name', :value => @realm.name, :class => 'em long'
+%fieldset.options
= form.submit "Save", :class => "submit button"
diff --git a/src/app/views/realms/edit.haml b/src/app/views/realms/edit.haml
index b05ea79..8d77484 100644
--- a/src/app/views/realms/edit.haml
+++ b/src/app/views/realms/edit.haml
@@ -13,5 +13,5 @@
%h2 Properties
.content
- - form_for @realm, :url => realm_path(@realm), :html => { :method => :put } do |f|
+ - form_for @realm, :url => realm_path(@realm), :html => { :method => :put, :class => 'generic' } do |f|
= render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/realms/new.haml b/src/app/views/realms/new.haml
index 50b6865..0f0c13a 100644
--- a/src/app/views/realms/new.haml
+++ b/src/app/views/realms/new.haml
@@ -6,5 +6,5 @@
%h2 Create a new Realm
.content
- - form_for @realm, :url => realms_path do |f|
+ - form_for @realm, :url => realms_path, :html => {:class => 'generic'} do |f|
= render :partial => "form", :locals => { :form => f, :cancel_path => realms_path }
diff --git a/src/app/views/roles/_form.haml b/src/app/views/roles/_form.haml
index 5b224bc..a22b97c 100644
--- a/src/app/views/roles/_form.haml
+++ b/src/app/views/roles/_form.haml
@@ -1,7 +1,7 @@
= form.error_messages
%fieldset
- = form.label :name, 'Name', :class => "grid_3 alpha"
- = form.text_field :name, :class => "grid_5"
-%fieldset
+ = form.label :name, 'Name'
+ = form.text_field :name, :class => "em long"
+%fieldset.options
= form.submit "Save", :class => "submit button"
= link_to t(:cancel), roles_path, :class => 'button button'
diff --git a/src/app/views/roles/edit.haml b/src/app/views/roles/edit.haml
index 756d43c..0bae7b4 100644
--- a/src/app/views/roles/edit.haml
+++ b/src/app/views/roles/edit.haml
@@ -18,5 +18,5 @@
- else
%h2 Editing Role:
- - form_for @role, :url => role_path(@role), :html => { :method => :put } do |f|
+ - form_for @role, :url => role_path(@role), :html => { :method => :put, :class => 'generic' } do |f|
= render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/roles/new.haml b/src/app/views/roles/new.haml
index 7f94487..bc9fb06 100644
--- a/src/app/views/roles/new.haml
+++ b/src/app/views/roles/new.haml
@@ -5,5 +5,5 @@
%h2 New Role
.content
- - form_for @role, :url => roles_path do |f|
+ - form_for @role, :url => roles_path, :html => {:class => 'generic'} do |f|
= render :partial => "form", :locals => { :form => f }
\ No newline at end of file
diff --git a/src/app/views/suggested_deployables/_form.haml b/src/app/views/suggested_deployables/_form.haml
index cf47953..cef100e 100644
--- a/src/app/views/suggested_deployables/_form.haml
+++ b/src/app/views/suggested_deployables/_form.haml
@@ -1,14 +1,15 @@
= error_messages_for 'suggested_deployable'
-%ul
- %li
+%fieldset
+ %p
= form.label :name
- = form.text_field :name
- %li
+ = form.text_field :name, :class => 'em long'
+ %p
= form.label :description
- = form.text_area :description
- %li
+ = form.text_area :description, :class => 'long'
+ %p
= form.label :url, 'URL'
- = form.text_field :url
+ = form.text_field :url, :class => 'long'
-= link_to 'Cancel', suggested_deployables_path, :class => 'button danger'
-= submit_tag 'Save', :name => 'save', :class => 'button'
+%fieldset.options
+ = link_to 'Cancel', suggested_deployables_path, :class => 'button danger'
+ = submit_tag 'Save', :name => 'save', :class => 'button'
diff --git a/src/app/views/suggested_deployables/edit.haml b/src/app/views/suggested_deployables/edit.haml
index 5eb800b..4b2b05f 100644
--- a/src/app/views/suggested_deployables/edit.haml
+++ b/src/app/views/suggested_deployables/edit.haml
@@ -11,5 +11,5 @@
%h2 Editing Deployable
.content
- - form_for @suggested_deployable, :url => suggested_deployable_path(@suggested_deployable), :html => { :method => :put } do |f|
+ - form_for @suggested_deployable, :url => suggested_deployable_path(@suggested_deployable), :html => { :method => :put, :class => 'generic' } do |f|
= render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/suggested_deployables/new.haml b/src/app/views/suggested_deployables/new.haml
index 0ba6a5e..d7f8035 100644
--- a/src/app/views/suggested_deployables/new.haml
+++ b/src/app/views/suggested_deployables/new.haml
@@ -6,5 +6,5 @@
%h2 Add New Deployable
.content
- - form_for @suggested_deployable, :url => suggested_deployables_path do |f|
+ - form_for @suggested_deployable, :url => suggested_deployables_path, :html => {:class => 'generic'} do |f|
= render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/users/_form.haml b/src/app/views/users/_form.haml
index 48bf857..b174b1b 100644
--- a/src/app/views/users/_form.haml
+++ b/src/app/views/users/_form.haml
@@ -1,43 +1,55 @@
= form.error_messages
%fieldset
- = form.label :login, t(:choose_name), :class => "grid_3 alpha"
- = form.text_field :login, :class => "grid_5"
-%fieldset
- = form.label :password, form.object.new_record? ? t(:choose_password) : t(:change_password), :class => "grid_3 alpha"
- = form.password_field :password, :class => "grid_5"
+ %p
+ = form.label :login, t(:choose_name)
+ = form.text_field :login, :class => "em"
+
+%fieldset.inline
+ %p
+ = form.label :password, form.object.new_record? ? t(:choose_password) : t(:change_password)
+ = form.password_field :password
+ %p
+ = form.label :password_confirmation, t(:confirm_password)
+ = form.password_field :password_confirmation
+
+%fieldset.inline
+ %p
+ = form.label :first_name, t(:first_name)
+ = form.text_field :first_name
+ %p
+ = form.label :last_name, t(:last_name)
+ = form.text_field :last_name
+
%fieldset
- = form.label :password_confirmation, t(:confirm_password), :class => "grid_3 alpha"
- = form.password_field :password_confirmation, :class => "grid_5"
+ %p
+ = form.label :email, t(:email)
+ = form.text_field :email, :class => 'long'
+
+-if check_privilege(Privilege::MODIFY, User)
+ %fieldset.inline
+ %legend User Treatment
+ %p
+ = select_tag 'user_treatment', options_for_select([t(:choose_treatment)])
+ %p
+ = submit_tag t(:apply), :disabled => true
+
+ - form.fields_for :quota do |quota_form|
+ %fieldset
+ %p
+ = quota_form.label :maximum_running_instances, t(:maximum_running_instances)
+ = quota_form.text_field :maximum_running_instances
+ (instances)
+ = quota_form.error_message_on :maximum_running_instances, 'Maximum Running Instances '
+
-if check_privilege(Privilege::MODIFY, User)
%fieldset
- = form.label :user_status, "User Status:", :class => "alpha grid_3"
- .grid_5
+ %legend User Status
+ %p.radio-group
= 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
- = form.label :first_name, t(:first_name), :class => "alpha grid_3"
- = form.text_field :first_name, :class => "grid_5"
-%fieldset
- = form.label :last_name, t(:last_name), :class => "alpha grid_3"
- = form.text_field :last_name, :class => "grid_5"
-%fieldset
- = form.label :email, t(:email), :class => "alpha grid_3"
- = form.text_field :email, :class => "grid_5"
--if check_privilege(Privilege::MODIFY, User)
- %h3.grid_16 User Treatment
- %fieldset
- = 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
- = 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)
- = quota_form.error_message_on :maximum_running_instances, 'Maximum Running Instances '
-%fieldset
+%fieldset.options
= form.submit "Save", :class => "submit button"
= link_to t(:cancel), cancel_path, :class => 'button danger'
diff --git a/src/app/views/users/edit.haml b/src/app/views/users/edit.haml
index 710c53e..063c6a7 100644
--- a/src/app/views/users/edit.haml
+++ b/src/app/views/users/edit.haml
@@ -16,5 +16,5 @@
%h2 Editing Account
.content
- - form_for @user, :url => user_path(@user), :html => { :method => :put } do |f|
+ - form_for @user, :url => user_path(@user), :html => { :method => :put, :class => 'generic' } do |f|
= render :partial => "form", :locals => { :form => f, :cancel_path => users_path }
diff --git a/src/app/views/users/new.haml b/src/app/views/users/new.haml
index 26befe6..66eb648 100644
--- a/src/app/views/users/new.haml
+++ b/src/app/views/users/new.haml
@@ -6,7 +6,7 @@
%h2 New Account
.content
- - form_for @user, :url => users_path do |f|
+ - form_for @user, :url => users_path, :html => {:class => 'generic'} do |f|
-if current_user
= render :partial => "form", :locals => { :form => f, :cancel_path => users_path }
-else
--
1.7.4.1
12 years, 10 months