From: Jan Provaznik jprovazn@redhat.com
- used *_tag helpers, fixed title, enabled jquery - new layout is active only for pools/instances/deployments --- src/app/controllers/application_controller.rb | 5 +--- src/app/controllers/deployments_controller.rb | 1 + src/app/controllers/instances_controller.rb | 1 + src/app/controllers/pools_controller.rb | 1 + src/app/views/layouts/application.haml | 28 ++++++++++++++---------- 5 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb index 9ea7d85..9d6815f 100644 --- a/src/app/controllers/application_controller.rb +++ b/src/app/controllers/application_controller.rb @@ -26,10 +26,7 @@ class ApplicationController < ActionController::Base include ApplicationService filter_parameter_logging :password, :password_confirmation helper_method :current_user_session, :current_user - - def layout - %w(PoolsController DeploymentsController InstancesController).include?(controller_name) ? 'application' : 'old' - end + layout 'old'
# General error handlers, must be in order from least specific # to most specific diff --git a/src/app/controllers/deployments_controller.rb b/src/app/controllers/deployments_controller.rb index bdf40de..8ba380d 100644 --- a/src/app/controllers/deployments_controller.rb +++ b/src/app/controllers/deployments_controller.rb @@ -2,6 +2,7 @@ class DeploymentsController < ApplicationController before_filter :require_user before_filter :load_deployments, :only => [:index, :show] before_filter :load_deployment, :only => [:edit, :update] + layout 'application'
def index respond_to do |format| diff --git a/src/app/controllers/instances_controller.rb b/src/app/controllers/instances_controller.rb index f04db3c..cf412a9 100644 --- a/src/app/controllers/instances_controller.rb +++ b/src/app/controllers/instances_controller.rb @@ -2,6 +2,7 @@ class InstancesController < ApplicationController before_filter :require_user, :except => [:can_start, :can_create] before_filter :load_instance, :only => [:show, :key, :edit, :update] before_filter :set_view_vars, :only => [:show, :index] + layout 'application'
def index @params = params diff --git a/src/app/controllers/pools_controller.rb b/src/app/controllers/pools_controller.rb index ea09745..1402cca 100644 --- a/src/app/controllers/pools_controller.rb +++ b/src/app/controllers/pools_controller.rb @@ -2,6 +2,7 @@ class PoolsController < ApplicationController before_filter :require_user before_filter :set_params_and_header, :only => [:index, :show] before_filter :load_pools, :only => [:show] + layout 'application'
def index @search_term = params[:q] diff --git a/src/app/views/layouts/application.haml b/src/app/views/layouts/application.haml index 99fa36e..f6f408b 100644 --- a/src/app/views/layouts/application.haml +++ b/src/app/views/layouts/application.haml @@ -2,20 +2,25 @@ %html{"xml:lang" => "en", :lang => "en"} %head %meta{:charset => 'utf-8'}/ - %title Layout Example - %link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/reset.css'} - %link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/960.css'} - %link{:rel => 'stylesheet', :type => 'text/css', :href => '/styles/buttons.css'} - %link{:rel => 'stylesheet', :type => 'text/css', :href => '/layout.css'}/ + %title Aeolus Conductor + = stylesheet_link_tag '/stylesheets/reset.css' + = stylesheet_link_tag '/stylesheets/960.css' + = stylesheet_link_tag '/stylesheets/buttons.css' + = stylesheet_link_tag '/stylesheets/compiled/layout.css' /[if lt IE 9] - %script{:src => 'http://html5shiv.googlecode.com/svn/trunk/html5.js%27%7D - %link{:rel => 'stylesheet', :type => 'text/css', :href => '/layout_ie.css'}/ + = stylesheet_link_tag 'http://html5shiv.googlecode.com/svn/trunk/html5.js' + = stylesheet_link_tag '/stylesheets/layout_ie.css' + + = javascript_include_tag "jquery-1.4.2.min.js" + = javascript_include_tag "jquery.ui-1.8.1/jquery-ui-1.8.1.custom.min.js" + = javascript_include_tag "application.js" + = yield :scripts %body #primary-container
%header#masthead .container - %img#logo{:src => '/images/upstream-logo.png'} + = image_tag('upstream-logo.png', :id => 'logo') %nav#system %ul %li.account @@ -32,17 +37,16 @@ %li %a{:href => '#'} Design & Deploy %li.active - %a{:href => '#'} Monitor + = link_to 'Monitor', pools_path %li %a{:href => '#'} Administer
#content - -# works with any 960 container (.container_16 or .container_24) - Yield view here. + = yield
%footer.standard .container - %img.logo{:src => '/images/footer-rhlogo.png'} + = image_tag('footer-rhlogo.png', :id => 'logo') %nav.footer %a{:href => '#'} Disclaimer %a{:href => '#'} Terms of Use