On Mon, 27 Jun 2011 16:00:31 +0200
jtomasek(a)redhat.com wrote:
From: Jiri Tomasek <jtomasek(a)redhat.com>
---
src/app/views/deployments/_list.haml | 42
++++++++++----------
src/app/views/hardware_profiles/_list.haml | 4
+- .../_matching_provider_hardware_profiles.haml | 9 ++--
src/app/views/hardware_profiles/_properties.haml | 5 +--
src/app/views/hardware_profiles/show.haml | 13 ++++--
src/app/views/instances/_list.haml | 36
+++++++++------- src/app/views/layouts/_filter_table.haml
| 7 ++- src/app/views/pool_families/_list.haml | 4
+- src/app/views/pools/_list.haml | 18 +-------
src/app/views/provider_accounts/_list.haml | 4 +-
src/app/views/providers/_list.haml | 4 +-
src/app/views/realms/_list.haml | 4 +-
src/app/views/realms/_mapping.haml | 21 +++++-----
src/app/views/roles/_list.haml | 4 +-
src/app/views/suggested_deployables/_list.haml | 25
++++++++++++ src/app/views/suggested_deployables/index.haml |
22 +---------- src/app/views/users/_list.haml
| 4 +- src/features/hardware_profile.feature | 2
+- 18 files changed, 113 insertions(+), 115 deletions(-) create mode
100644 src/app/views/suggested_deployables/_list.haml
diff --git a/src/app/views/deployments/_list.haml
b/src/app/views/deployments/_list.haml index 874b21c..5305d49 100644
--- a/src/app/views/deployments/_list.haml
+++ b/src/app/views/deployments/_list.haml
@@ -2,40 +2,40 @@
= render :partial => '/layouts/notification'
- form_tag do
- = restful_submit_tag "Stop", "multi_stop",
multi_stop_deployments_path, 'POST', :id => 'stop_button'
+ = restful_submit_tag "Stop", "multi_stop",
multi_stop_deployments_path, 'POST', :id => 'stop_button', :class
=>
'button' = label_tag "More actions" =
select_tag("more_actions",nil, :disabled => true)
-
%p
Viewing
= select_tag("deployments_running", "<option>Deployments
running</option>",:disabled => true) = @deployments.count.to_s + "
results" = text_field_tag :q, @search_term || "Search result
for...", :disabled => true
+ = render :partial => 'layouts/select_all_none'
- %table#deployments_table
- %tr
- %th
- = check_box_tag "all"
- %th
- -#there will be icons (belongs to mockups)
- %th
- = t("pools.index.deployment_name")
- %th
- = t("pools.index.deployed_on")
- %th
- = t("instances.instances")
- %th
- = t("pools.index.pool")
- %th
- = t("pools.index.pool_family")
- %th
- = t("pools.index.owner")
+ %table#deployments_table.flat.checkbox_table
+ %thead
+ %tr
+ %th.ignore
+ %th
+ -#there will be icons (belongs to mockups)
+ %th
+ = t("pools.index.deployment_name")
+ %th
+ = t("pools.index.deployed_on")
+ %th
+ = t("instances.instances")
+ %th
+ = t("pools.index.pool")
+ %th
+ = t("pools.index.pool_family")
+ %th
+ = t("pools.index.owner")
- @deployments.each do |deployment|
%tr
%td
- selected = params[:select] == 'all'
- %input{:name => "deployments_selected[]", :type =>
"checkbox", :value => deployment.id, :id =>
"deployment_checkbox_#{deployment.id}", :checked => selected }
+ = check_box_tag "deployments_selected[]", deployment.id,
selected, :id => "deployment_checkbox_#{deployment.id}" %td
-#there will be icons (belongs to mockups)
%td
diff --git a/src/app/views/hardware_profiles/_list.haml
b/src/app/views/hardware_profiles/_list.haml index b7a4322..2cb9433
100644 --- a/src/app/views/hardware_profiles/_list.haml
+++ b/src/app/views/hardware_profiles/_list.haml
@@ -9,7 +9,7 @@
= render :partial => 'layouts/select_all_none'
- %table#hardware_profiles_table.checkbox_table
+ %table#hardware_profiles_table.flat.checkbox_table
%thead
%tr
%th.ignore
@@ -19,7 +19,7 @@
%th= link_to "Storage", hardware_profiles_path(:sort_by
=> "storage") %th= link_to "Virtual CPU",
hardware_profiles_path(:sort_by => "cpu")
- @hardware_profiles.each do |hwp|
- %tr{:class => cycle('stripe')}
+ %tr{:class => cycle('nostripe','stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "hardware_profile_selected[]", hwp.id,
selected, :id => "hardware_profile_checkbox_#{hwp.id}" diff --git
a/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.haml
b/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.haml
index 8384aa3..7597aba 100644 ---
a/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.haml
+++
b/src/app/views/hardware_profiles/_matching_provider_hardware_profiles.haml
@@ -1,11 +1,10 @@
- if @hardware_profile
- %h2
- =(a)hardware_profile.name
- if @matching_hwps.size > 0
- %table
- = sortable_table_header @provider_hwps_header
+ %table.flat
+ %thead
+ = sortable_table_header @provider_hwps_header
- @matching_hwps.each do |hwp|
- %tr
+ %tr{:class => cycle('nostripe','stripe')}
%td
- if hwp.provider
= link_to hwp.provider.name, provider_path(hwp.provider)
diff --git a/src/app/views/hardware_profiles/_properties.haml
b/src/app/views/hardware_profiles/_properties.haml index
dd5a05b..d2a9053 100644 ---
a/src/app/views/hardware_profiles/_properties.haml +++
b/src/app/views/hardware_profiles/_properties.haml @@ -1,7 +1,4 @@
-%h3
- = @hardware_profile.name + "(" +
(@hardware_profile.provider_id.nil? ? "Front End" : "Provider" ) +
")"
- = link_to 'Edit',
edit_hardware_profile_path(@hardware_profile), :class => 'button'
-%table +%table.flat
= sortable_table_header @properties_header
- @hwp_properties.each do |hwpp|
%tr
diff --git a/src/app/views/hardware_profiles/show.haml
b/src/app/views/hardware_profiles/show.haml index 81f2d14..4f6dc9d
100644 --- a/src/app/views/hardware_profiles/show.haml
+++ b/src/app/views/hardware_profiles/show.haml
@@ -1,6 +1,6 @@
= render :partial => 'layouts/admin_header'
%header.page-header
- %h1{:class => controller.controller_name}= @hardware_profile.name
+ %h1{:class => controller.controller_name}= @hardware_profile.name
+ " (" + (@hardware_profile.provider_id.nil? ? "Front End" :
"Provider" ) + ")" #obj_actions.button-container = link_to 'New
Hardware Profile', new_hardware_profile_url, :class => 'button
primary', :id => 'new_role_button' .button-group @@ -9,7 +9,10 @@
%section.content-section.hardware_profile
%header
%h2 Properties
-%div#view
- = render :partial => 'properties'
- %h1 Matching Provider Hardware Profiles
- = render :partial => 'matching_provider_hardware_profiles'
\ No newline at end of file
+ .content
+ = render :partial => 'properties'
+%section.content-section.hardware_profile
+ %header
+ %h2 Matching Provider Hardware Profiles
+ .content
+ = render :partial => 'matching_provider_hardware_profiles'
diff --git a/src/app/views/instances/_list.haml
b/src/app/views/instances/_list.haml index 77c2a31..a80606f 100644
--- a/src/app/views/instances/_list.haml
+++ b/src/app/views/instances/_list.haml
@@ -1,21 +1,25 @@
- form_tag do
- = restful_submit_tag 'Stop', 'stop', multi_stop_instances_path,
'GET'
- = restful_submit_tag 'Remove failed', 'remove_failed',
remove_failed_instances_path, 'GET'
+ = 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'
- %p
- Select:
- = link_to "All", params.merge(:select => 'all')
- %span> ,
- = link_to "None", params.merge(:select => 'none')
- %table
- = sortable_table_header @header
- - @instances.each do |inst|
+ = render :partial => 'layouts/select_all_none'
+
+ %table#instances_table.flat.checkbox_table
+ %thead
+ %tr
+ %th.ignore
+ %th Name
+ %th State
+ %th Public addresses
+ %th Provider
+ %th Owner
+ - @instances.each do |instance|
%tr
%td
- selected = params[:select] == 'all'
- %input{:name => 'instance_selected[]', :type =>
'checkbox', :value => inst.id, :id =>
"instance_checkbox_#{inst.id}", :checked => selected }
- = link_to inst.name, instance_path(inst)
- %td= inst.state
- %td= inst.public_addresses
- %td= inst.provider_account ?
inst.provider_account.provider.name : ''
- %td= owner_name(inst)
+ = check_box_tag "instance_selected[]", instance.id,
selected, :id => "instance_checkbox_#{instance.id}"
+ %td= link_to instance.name, instance_path(instance)
+ %td= instance.state
+ %td= instance.public_addresses
+ %td= instance.provider_account ?
instance.provider_account.provider.name : ''
+ %td= owner_name(instance)
diff --git a/src/app/views/layouts/_filter_table.haml
b/src/app/views/layouts/_filter_table.haml index 1c50d2d..b2d6d1c
100644 --- a/src/app/views/layouts/_filter_table.haml
+++ b/src/app/views/layouts/_filter_table.haml
@@ -10,10 +10,13 @@
%p
= link_to('Share this view', '#')
= link_to('Add/Remove Columns', '#')
- %table(class="#{lower_class}_table")
+
+ = render :partial => 'layouts/select_all_none'
+
+ %table.flat.checkbox_table
%thead
%tr
- columns.each do |column|
%th
= column[:name]
- = rows.collect {|row| capture_haml(row, &block)}.to_s
\ No newline at end of file
+ = rows.collect {|row| capture_haml(row, &block)}.to_s
diff --git a/src/app/views/pool_families/_list.haml
b/src/app/views/pool_families/_list.haml index 5ada358..6197b66 100644
--- a/src/app/views/pool_families/_list.haml
+++ b/src/app/views/pool_families/_list.haml
@@ -9,7 +9,7 @@
= render :partial => 'layouts/select_all_none'
- %table#pool_families_table.checkbox_table
+ %table#pool_families_table.flat.checkbox_table
%thead
%tr
%th.ignore
@@ -18,7 +18,7 @@
%th= link_to "Quota currently in use",
pool_families_path(:sort_by => "quota")
- unless @pool_families.blank?
- @pool_families.each do |pool_family|
- %tr{:class => cycle('stripe')}
+ %tr{:class => cycle('nostripe','stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "pool_family_selected[]",
pool_family.id, selected, :id =>
"pool_family_checkbox_#{pool_family.id}" diff --git
a/src/app/views/pools/_list.haml b/src/app/views/pools/_list.haml
index 8f2a91d..fbd972f 100644 --- a/src/app/views/pools/_list.haml
+++ b/src/app/views/pools/_list.haml @@ -1,10 +1,10 @@
- form_header = capture_haml do
= link_to "New Pool", new_pool_path, { :class => 'button' }
- = restful_submit_tag "Destroy", "destroy",
multi_destroy_pools_path, 'DELETE', :id => 'delete_button'
+ = restful_submit_tag "Destroy", "destroy",
multi_destroy_pools_path, 'DELETE', :id => 'delete_button', :class
=>
'button danger' = label_tag "More actions" =
select_tag("more_actions",nil, :disabled => true) =
filter_table(@header, @pools, :form_header => form_header) do |pool|
- %tr
+ %tr{:class => cycle('nostripe','stripe')}
%td
%input{:name => "pools_selected[]", :type =>
"checkbox", :value => pool.id, :id =>
"pool_checkbox_#{pool.id}" } %td
@@ -23,17 +23,3 @@
= pool.quota ? pool.quota.percentage_used.to_s + "%":
'unlimited' %td
= link_to(pool.pool_family.name, pool.pool_family)
-
-:javascript
- $(document).ready(function () {
- $('#delete_button').click(function(e) {
- if ($("#pools_table input[@type=checkbox]:checked").length ==
0) {
- alert('Please select any pool to be deleted before clicking
Delete button.');
- e.preventDefault();
- } else {
- if (!confirm("Are you sure you want to delete this pool?")) {
- e.preventDefault();
- }
- }
- });
- });
diff --git a/src/app/views/provider_accounts/_list.haml
b/src/app/views/provider_accounts/_list.haml index 214f7be..ab16ac3
100644 --- a/src/app/views/provider_accounts/_list.haml
+++ b/src/app/views/provider_accounts/_list.haml
@@ -9,7 +9,7 @@
= render :partial => 'layouts/select_all_none'
- %table#provider_accounts_table.checkbox_table
+ %table#provider_accounts_table.flat.checkbox_table
%thead
%tr
%th.ignore
@@ -17,7 +17,7 @@
%th= link_to "Username", hardware_profiles_path(:sort_by
=> "name") %th= link_to "Provider Type",
hardware_profiles_path(:sort_by => "name")
- @accounts.each do |account|
- %tr
+ %tr{:class => cycle('nostripe','stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "accounts_selected[]", account.id,
selected, :id => "account_checkbox_#{account.id}" diff --git
a/src/app/views/providers/_list.haml
b/src/app/views/providers/_list.haml index 8d0d25d..a8ff255 100644
--- a/src/app/views/providers/_list.haml +++
b/src/app/views/providers/_list.haml @@ -9,7 +9,7 @@
= render :partial => 'layouts/select_all_none'
- %table#providers_table.checkbox_table
+ %table#providers_table.flat.checkbox_table
%thead
%tr
%th.ignore
@@ -17,7 +17,7 @@
%th= link_to "Provider URL", providers_path(:sort_by =>
"url") %th= link_to "Provider Type", providers_path(:sort_by =>
"type")
- @providers.each do |provider|
- %tr{:class => cycle('stripe')}
+ %tr{:class => cycle('nostripe', 'stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "provider_selected[]", provider.id,
selected, :id => "provider_checkbox_#{provider.id}" diff --git
a/src/app/views/realms/_list.haml b/src/app/views/realms/_list.haml
index 94b0ca6..f46e178 100644 --- a/src/app/views/realms/_list.haml
+++ b/src/app/views/realms/_list.haml
@@ -9,14 +9,14 @@
= render :partial => 'layouts/select_all_none'
- %table#realms_table.checkbox_table
+ %table#realms_table.flat.checkbox_table
%thead
%tr
%th.ignore
%th= link_to "Realm Name",
hardware_profiles_path(:sort_by => "name")
- unless @realms.blank?
- @realms.each do |realm|
- %tr{:class => cycle('stripe')}
+ %tr{:class => cycle('nostripe','stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "realm_selected[]", realm.id,
selected, :id => "realm_checkbox_#{realm.id}" diff --git
a/src/app/views/realms/_mapping.haml
b/src/app/views/realms/_mapping.haml index dea5cda..dfdbdbb 100644
--- a/src/app/views/realms/_mapping.haml +++
b/src/app/views/realms/_mapping.haml @@ -1,20 +1,21 @@
-- form_tag do
+- form_tag multi_destroy_realm_mappings_path(:frontend_realm_id =>
@realm.id) do = link_to "Add mapping to realm",
new_realm_mapping_path(:frontend_realm_id =>
@realm.id, :realm_or_provider_type => 'Realm'), :class =>
"button" =
link_to "Add mapping to provider",
new_realm_mapping_path(:frontend_realm_id =>
@realm.id, :realm_or_provider_type => 'Provider'), :class =>
"button"
- = restful_submit_tag "Delete", 'destroy',
multi_destroy_realm_mappings_path(:frontend_realm_id => @realm.id),
'DELETE', :id => 'delete_button', :class => 'button'
+ = submit_tag "Delete", :id => 'delete_button', :class =>
'button
danger' +
- unless @backend_provider_targets.empty?
%h2 Realm '#{(a)realm.name}' is mapped to providers:
- %ul
+ %table.flat.checkbox_table
- @backend_provider_targets.each do |backend|
- %li
- %input{:name => "id[]", :type => "checkbox", :value
=>
backend.id, :id => "backend_id_#{backend.id}"}
- = backend.realm_or_provider.name
+ %tr{:class => cycle('nostripe','stripe')}
+ %td= check_box_tag "id[]", backend.id, :id =>
"backend_id_#{backend.id}"
+ %td= backend.realm_or_provider.name
- unless @backend_realm_targets.empty?
%h2 Realm '#{(a)realm.name}' is mapped to realms:
- %ul
+ %table.flat.checkbox_table
- @backend_realm_targets.each do |backend|
- %li
- %input{:name => "id[]", :type => "checkbox", :value
=>
backend.id, :id => "backend_id_#{backend.id}"}
- = backend.realm_or_provider.name
+ %tr{:class => cycle('nostripe','stripe')}
+ %td= check_box_tag "id[]", backend.id, :id =>
"backend_id_#{backend.id}"
+ %td= backend.realm_or_provider.name
diff --git a/src/app/views/roles/_list.haml
b/src/app/views/roles/_list.haml index dc7251b..eb58090 100644
--- a/src/app/views/roles/_list.haml
+++ b/src/app/views/roles/_list.haml
@@ -8,13 +8,13 @@
= submit_tag "Delete", :id => 'delete_button', :class =>
'button'
= render :partial => 'layouts/select_all_none'
- %table#roles_table.checkbox_table
+ %table#roles_table.flat.checkbox_table
%thead
%tr
%th.ignore
%th= link_to "Role Name", roles_path(:sort_by =>
"name")
- @roles.each do |role|
- %tr{:class => cycle('stripe')}
+ %tr{:class => cycle('nostripe','stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "role_selected[]", role.id,
selected, :id => "role_checkbox_#{role.id}" diff --git
a/src/app/views/suggested_deployables/_list.haml
b/src/app/views/suggested_deployables/_list.haml new file mode 100644
index 0000000..5f53edf --- /dev/null
+++ b/src/app/views/suggested_deployables/_list.haml
@@ -0,0 +1,25 @@
+%section.content-section.roles
+ %header
+ %h2 Deployables List
+ %span.label.badge.dark.count= @suggested_deployables.length
+
+ .content
+ - form_tag multi_destroy_suggested_deployables_path do
+ = submit_tag "Delete", :id => 'delete_button', :class =>
'button danger' +
+ = render :partial => 'layouts/select_all_none'
+ %table#deployables_table.flat.checkbox_table
+ %thead
+ %tr
+ %th.ignore
+ %th= link_to "Name", suggested_deployables_path(:sort_by
=> "name")
+ %th= link_to "URL", suggested_deployables_path(:sort_by
=> "url")
+ - @suggested_deployables.each do |suggested_deployable|
+ %tr{:class => cycle('nostripe','stripe')}
+ %td
+ - selected = params[:select] == 'all'
+ = check_box_tag "suggested_deployables_selected[]",
suggested_deployable.id, selected, :id =>
"suggested_deployable_checkbox_#{suggested_deployable.id}"
+ %td
+ = link_to suggested_deployable.name,
suggested_deployable_path(suggested_deployable.id)
+ %td
+ = suggested_deployable.url
diff --git a/src/app/views/suggested_deployables/index.haml
b/src/app/views/suggested_deployables/index.haml index
3a43440..55fac46 100644 ---
a/src/app/views/suggested_deployables/index.haml +++
b/src/app/views/suggested_deployables/index.haml @@ -1,23 +1,3 @@
= render :partial => 'layouts/admin_header'
= render :partial => 'section_header'
-
-%section.content-section.roles
- %header
- %h2 Deployables List
- %span.label.badge.dark.count= @suggested_deployables.length
-
- .content
- - form_header = capture_haml do
- = restful_submit_tag "Delete", "destroy",
multi_destroy_suggested_deployables_path, 'DELETE', :id =>
'delete_button', :class => 'button danger' -
- = render :partial => 'layouts/select_all_none'
- = filter_table(@header, @suggested_deployables, :form_header =>
form_header) do |deployable|
- %table#deployables_table.checkbox_table
- %tr
- %td
- - selected = params[:select] == 'all'
- = check_box_tag "suggested_deployables_selected[]",
deployable.id, selected, :id =>
"suggested_deployable_checkbox_#{deployable.id}"
- %td
- = link_to deployable.name,
suggested_deployable_path(deployable.id)
- %td
- = deployable.url
+= render :partial => 'list'
diff --git a/src/app/views/users/_list.haml
b/src/app/views/users/_list.haml index 69a9c06..eb016f8 100644
--- a/src/app/views/users/_list.haml
+++ b/src/app/views/users/_list.haml
@@ -9,7 +9,7 @@
= render :partial => 'layouts/select_all_none'
- %table#users_table.checkbox_table
+ %table#users_table.flat.checkbox_table
%thead
%tr
%th.ignore
@@ -22,7 +22,7 @@
%span (Instances)
%th= link_to "e-mail", users_url(:sort_by =>
"email")
-(a)users.each do |user|
- %tr{:class => cycle('stripe')}
+ %tr{:class => cycle('nostripe','stripe')}
%td
- selected = params[:select] == 'all'
= check_box_tag "user_selected[]", user.id,
selected, :id => "user_checkbox_#{user.id}" diff --git
a/src/features/hardware_profile.feature
b/src/features/hardware_profile.feature index d1f1130..9cbf40c 100644
--- a/src/features/hardware_profile.feature +++
b/src/features/hardware_profile.feature @@ -81,7 +81,7 @@ Feature:
Manage Pools And there is a "mock1" hardware profile
And I am on the the hardware profiles page
When I follow "mock1"
- Then I should see "mock1(Front End)"
+ Then I should see "mock1 (Front End)"
Scenario: Create a new Hardware Profile
Given I am on the hardware profiles page
ACK.