[PATCH conductor 1/3] Updated "Content" admin section
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
https://www.aeolusproject.org/redmine/issues/2420
Tabs which are not accessible from anywhere are now linked from "Content"
section (catalogs, realms, hw profiles). Not saying this is ideal but
allows users to navigate to this sections for now.
What is not still accessible is "Settings" tab - maybe it could be separate section?
---
src/app/controllers/application_controller.rb | 9 +++++++++
src/app/controllers/catalogs_controller.rb | 5 +++++
.../controllers/hardware_profiles_controller.rb | 11 ++++++++---
src/app/controllers/realms_controller.rb | 5 +++++
src/app/views/catalogs/_list.haml | 7 ++++---
src/app/views/catalogs/index.haml | 3 +--
src/app/views/catalogs/new.haml | 14 ++++++++------
src/app/views/hardware_profiles/_list.haml | 2 +-
src/app/views/hardware_profiles/index.haml | 3 +--
src/app/views/hardware_profiles/new.haml | 16 +++++++++-------
src/app/views/layouts/_admin_content_tabs.haml | 14 ++++++++++++++
src/app/views/realms/index.haml | 3 +--
src/config/navigation.rb | 4 ++--
13 files changed, 68 insertions(+), 28 deletions(-)
create mode 100644 src/app/views/layouts/_admin_content_tabs.haml
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index 8f8934c..b2d7453 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -232,4 +232,13 @@ class ApplicationController < ActionController::Base
session[:breadcrumbs] = breadcrumbs
end
+ def set_admin_content_tabs(tab)
+ @tabs = [{:name => 'Catalogs', :url => catalogs_url, :id => 'catalogs'},
+ {:name => 'Realms', :url => realms_url, :id => 'realms'},
+ {:name => 'Hardware', :url => hardware_profiles_url, :id => 'hardware_profiles'},
+ ]
+ unless @details_tab = @tabs.find {|t| t[:id] == tab}
+ raise "Tab '#{tab}' doesn't exist"
+ end
+ end
end
diff --git a/src/app/controllers/catalogs_controller.rb b/src/app/controllers/catalogs_controller.rb
index e299f98..59b0eca 100644
--- a/src/app/controllers/catalogs_controller.rb
+++ b/src/app/controllers/catalogs_controller.rb
@@ -24,6 +24,11 @@ class CatalogsController < ApplicationController
@catalogs = Catalog.list_for_user(current_user, Privilege::VIEW)
save_breadcrumb(catalogs_path(:viewstate => @viewstate ? @viewstate.id : nil))
set_header
+ set_admin_content_tabs 'catalogs'
+ respond_to do |format|
+ format.html
+ format.js { render :partial => 'list' }
+ end
end
def new
diff --git a/src/app/controllers/hardware_profiles_controller.rb b/src/app/controllers/hardware_profiles_controller.rb
index b478873..8df760f 100644
--- a/src/app/controllers/hardware_profiles_controller.rb
+++ b/src/app/controllers/hardware_profiles_controller.rb
@@ -27,12 +27,17 @@ class HardwareProfilesController < ApplicationController
clear_breadcrumbs
save_breadcrumb(hardware_profiles_path)
@params = params
+ set_admin_content_tabs 'hardware_profiles'
respond_to do |format|
format.html
format.js do
- build_hardware_profile(params[:hardware_profile])
- matching_provider_hardware_profiles
- render :partial => 'matching_provider_hardware_profiles' and return
+ if params[:hardware_profile]
+ build_hardware_profile(params[:hardware_profile])
+ matching_provider_hardware_profiles
+ render :partial => 'matching_provider_hardware_profiles'
+ else
+ render :partial => 'list'
+ end
end
end
end
diff --git a/src/app/controllers/realms_controller.rb b/src/app/controllers/realms_controller.rb
index 8e707b6..0e9e64e 100644
--- a/src/app/controllers/realms_controller.rb
+++ b/src/app/controllers/realms_controller.rb
@@ -23,6 +23,11 @@ class RealmsController < ApplicationController
def index
clear_breadcrumbs
save_breadcrumb(realms_path)
+ set_admin_content_tabs 'realms'
+ respond_to do |format|
+ format.html
+ format.js { render :partial => 'list' }
+ end
end
def new
diff --git a/src/app/views/catalogs/_list.haml b/src/app/views/catalogs/_list.haml
index 3e1a6cf..9b0555d 100644
--- a/src/app/views/catalogs/_list.haml
+++ b/src/app/views/catalogs/_list.haml
@@ -1,11 +1,12 @@
%section.admin-content-section.catalogs
- %header
- %h2 Catalogs List
- %span.label.badge.dark.count= @catalogs.length
+ /%header
+ / %h2 Catalogs List
+ / %span.label.badge.dark.count= @catalogs.length
.content
- content_for :form_header do
%li= restful_submit_tag "Delete", "destroy", multi_destroy_catalogs_path, 'DELETE', :id => 'delete_button', :class => 'button danger'
+ %li= link_to "New Catalog", new_catalog_path, :id => 'new_catalog_button', :class => 'button pill'
= filter_table(@header, @catalogs) do |catalog|
%tr{:class => cycle('nostripe','stripe')}
diff --git a/src/app/views/catalogs/index.haml b/src/app/views/catalogs/index.haml
index 3fae6b6..947fd74 100644
--- a/src/app/views/catalogs/index.haml
+++ b/src/app/views/catalogs/index.haml
@@ -1,3 +1,2 @@
= render :partial => 'layouts/admin_nav'
-= render :partial => 'section_header'
-= render :partial => 'list'
+= render :partial => 'layouts/admin_content_tabs'
diff --git a/src/app/views/catalogs/new.haml b/src/app/views/catalogs/new.haml
index be583cf..1b24fa7 100644
--- a/src/app/views/catalogs/new.haml
+++ b/src/app/views/catalogs/new.haml
@@ -1,10 +1,12 @@
= render :partial => 'layouts/admin_nav'
-= render :partial => 'section_header'
-%section.admin-content-section.provider_accounts
+%header.admin-page-header
%header
- %h2 Add New Catalog
+ %h1 Add New Catalog
+ #obj_actions
+ Return to:
+ = link_to "Catalogs", catalogs_path, :class => 'rounded-link'
- .content
- = form_for @catalog, :url => catalogs_path, :html => {:class => 'generic'} do |f|
- = render :partial => "form", :locals => { :form => f }
+%section.admin-content-section
+ = form_for @catalog, :url => catalogs_path, :html => {:class => 'generic'} do |f|
+ = render :partial => "form", :locals => { :form => f }
diff --git a/src/app/views/hardware_profiles/_list.haml b/src/app/views/hardware_profiles/_list.haml
index d40d837..013cb8b 100644
--- a/src/app/views/hardware_profiles/_list.haml
+++ b/src/app/views/hardware_profiles/_list.haml
@@ -1,7 +1,7 @@
.content
- content_for :form_header do
%li= restful_submit_tag "Delete Selected", "destroy", multi_destroy_hardware_profiles_path, 'DELETE', :id => 'delete_button', :class => 'button pill danger'
- %li= link_to "New Hardware", new_hardware_profile_path, :id => 'new_hardware_profile', :class => 'button pill'
+ %li= link_to "New Hardware", new_hardware_profile_path, :id => 'new_hardware_profile_button', :class => 'button pill'
= filter_table(hardware_profiles_header, @hardware_profiles) do |hwp|
%tr{:class => cycle('nostripe','stripe')}
diff --git a/src/app/views/hardware_profiles/index.haml b/src/app/views/hardware_profiles/index.haml
index 3fae6b6..947fd74 100644
--- a/src/app/views/hardware_profiles/index.haml
+++ b/src/app/views/hardware_profiles/index.haml
@@ -1,3 +1,2 @@
= render :partial => 'layouts/admin_nav'
-= render :partial => 'section_header'
-= render :partial => 'list'
+= render :partial => 'layouts/admin_content_tabs'
diff --git a/src/app/views/hardware_profiles/new.haml b/src/app/views/hardware_profiles/new.haml
index 5d5f3f4..795a706 100644
--- a/src/app/views/hardware_profiles/new.haml
+++ b/src/app/views/hardware_profiles/new.haml
@@ -1,12 +1,14 @@
= render :partial => 'layouts/admin_nav'
-= render :partial => 'section_header'
-%section.admin-content-section
+%header.admin-page-header
%header
- %h2 New Hardware Profile
+ %h1 New Hardware Profile
+ #obj_actions
+ Return to:
+ = link_to "Hardware Profiles", hardware_profiles_path, :class => 'rounded-link'
- .content
- = form_for @hardware_profile, :url => hardware_profiles_path, :html => { :multipart => true } do |hwp_form|
- = render :partial => "form", :locals => { :hwp_form => hwp_form }
+%section.admin-content-section
+ = form_for @hardware_profile, :url => hardware_profiles_path, :html => { :multipart => true } do |hwp_form|
+ = render :partial => "form", :locals => { :hwp_form => hwp_form }
- = render :partial => 'matching_provider_hardware_profiles' if params[:commit] == 'Check Matches'
+ = render :partial => 'matching_provider_hardware_profiles' if params[:commit] == 'Check Matches'
diff --git a/src/app/views/layouts/_admin_content_tabs.haml b/src/app/views/layouts/_admin_content_tabs.haml
new file mode 100644
index 0000000..57d551a
--- /dev/null
+++ b/src/app/views/layouts/_admin_content_tabs.haml
@@ -0,0 +1,14 @@
+%section.admin-content-section
+ %header#tab-container-1
+ %h2
+ %nav.faceted
+ %ul#tab-container-1-nav
+ - @tabs.each do |tab|
+ %li
+ %a{ :href => tab[:url], :id => "details_#{tab[:id]}", :class => "#{'active' if @details_tab[:id] == tab[:id]} show"}
+ = tab[:name]
+ -if tab[:count]
+ %span.label.badge.count.dark=tab[:count]
+ .content.collapsible.toggle-view.pools#tab
+ %ul.deployable-cards
+ = render :partial => 'list'
diff --git a/src/app/views/realms/index.haml b/src/app/views/realms/index.haml
index 3fae6b6..947fd74 100644
--- a/src/app/views/realms/index.haml
+++ b/src/app/views/realms/index.haml
@@ -1,3 +1,2 @@
= render :partial => 'layouts/admin_nav'
-= render :partial => 'section_header'
-= render :partial => 'list'
+= render :partial => 'layouts/admin_content_tabs'
diff --git a/src/config/navigation.rb b/src/config/navigation.rb
index 0d5bad3..8edc32a 100644
--- a/src/config/navigation.rb
+++ b/src/config/navigation.rb
@@ -24,8 +24,8 @@ SimpleNavigation::Configuration.run do |navigation|
first_level.item :administer, t(:administer), users_path, :class => 'administer' do |second_level|
second_level.item :users_and_groups, "Users & Groups", users_path, :link => { :class => 'users' }, :highlights_on => /\/users|\/roles|\/account/
second_level.item :environments, "Environments", pool_families_path, :link => { :class => 'environments' }, :highlights_on => /\/pool_families/
- second_level.item :content, "Content", catalogs_path, :link => { :class => 'content' }, :highlights_on => /\/catalogs|\/catalog_entries/
- second_level.item :cloud_providers, "Cloud Providers", providers_path, :link => { :class => 'providers' }, :highlights_on => /\/providers|\/realms|\/realm_mappingsi|\/hardware_profiles/
+ second_level.item :content, "Content", catalogs_path, :link => { :class => 'content' }, :highlights_on => /\/catalogs|\/catalog_entries|\/realms|\/hardware_profiles|\/realm_mappings/
+ second_level.item :cloud_providers, "Cloud Providers", providers_path, :link => { :class => 'providers' }, :highlights_on => /\/providers/
end
end
end
--
1.7.6
12 years, 6 months
[PATCH conductor] Highlight Monitor tab when on root url
by Tomas Hrcka
---
src/config/navigation.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/config/navigation.rb b/src/config/navigation.rb
index 0d5bad3..ae9fcc0 100644
--- a/src/config/navigation.rb
+++ b/src/config/navigation.rb
@@ -20,7 +20,7 @@ SimpleNavigation::Configuration.run do |navigation|
navigation.autogenerate_item_ids = false
navigation.items do |first_level|
first_level.dom_class = 'container'
- first_level.item :monitor, t(:monitor), pools_path, :class => 'monitor', :link => { :id => 'monitor' }, :highlights_on => /\/deployments|\/pools|\/instances/
+ first_level.item :monitor, t(:monitor), pools_path, :class => 'monitor', :link => { :id => 'monitor' }, :highlights_on => /\/deployments|\/pools|\/instances|\/\z/
first_level.item :administer, t(:administer), users_path, :class => 'administer' do |second_level|
second_level.item :users_and_groups, "Users & Groups", users_path, :link => { :class => 'users' }, :highlights_on => /\/users|\/roles|\/account/
second_level.item :environments, "Environments", pool_families_path, :link => { :class => 'environments' }, :highlights_on => /\/pool_families/
--
1.7.6.4
12 years, 6 months
[PATCH conductor] Fixed some failing spec tests
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
This partially fixes https://www.aeolusproject.org/redmine/issues/2412
But not all of them.
---
src/app/controllers/providers_controller.rb | 2 +-
.../provider_accounts_controller_spec.rb | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb
index 818c423..516b65b 100644
--- a/src/app/controllers/providers_controller.rb
+++ b/src/app/controllers/providers_controller.rb
@@ -172,6 +172,6 @@ class ProvidersController < ApplicationController
protected
def load_providers
- @providers = Provider.list_for_user(current_user, Privilege::VIEW, :order => :name)
+ @providers = Provider.list_for_user(current_user, Privilege::VIEW)
end
end
diff --git a/src/spec/controllers/provider_accounts_controller_spec.rb b/src/spec/controllers/provider_accounts_controller_spec.rb
index b4d9962..4406a83 100644
--- a/src/spec/controllers/provider_accounts_controller_spec.rb
+++ b/src/spec/controllers/provider_accounts_controller_spec.rb
@@ -32,11 +32,10 @@ describe ProviderAccountsController do
@admin = @admin_permission.user
end
- it "shows provider accounts as list" do
+ it "shows provider accounts as XML list" do
mock_warden(@admin)
- get :index, :provider_id => @provider.id
+ get :index, :format => :xml
response.should be_success
- response.should render_template("index")
end
it "doesn't allow to save provider's account if not valid credentials" do
@@ -49,7 +48,7 @@ describe ProviderAccountsController do
it "should permit users with account modify permission to access edit cloud account interface" do
mock_warden(@admin)
- get :edit, :id => @provider_account.id
+ get :edit, :provider_id => @provider, :id => @provider_account.id
response.should be_success
response.should render_template("edit")
end
--
1.7.6
12 years, 6 months
aeolus-configure default profile change
by Richard Su
I've pushed a change to how the aeolus-configure behaves by default.
Executing "aeolus-configure" without a -p option uses the default
profile. The default profile no longer adds providers to conductor. It
only starts up components, creates the site administrator account,
creates the aeolus bucket, and adds a default hardware profile.
Out of the box, four provider profiles are available: mock, ec2, rhevm,
and vsphere. Each of these are a superset of the default profile.
To configure a particular provider, use -p with the name of the
profile. For example, "aeolus-configure -p ec2" configures ec2. Some
profiles like rhevm and vsphere have additional parameters that may need
to be changed to suit your environment. The changes can be made in a
file named /etc/aeolus-configure/nodes/<profile name>.
You may also specify multiple profiles in a single command.
For example, "aeolus-configure -p ec2,rhevm,vsphere,mock" will execute
all four profiles and add all four providers to conductor.
This is equivalent to "aeolus-configure -p ec2; aeolus-configure -p
rhevm; aeolus-configure -p vsphere; aeolus-configure -p mock".
Having the default profile not configure ec2 by default is biggest
change. If this feels odd, we can switch the default profile to be ec2.
- Richard
12 years, 6 months