On Mon, 2010-05-17 at 13:17 +0200, [email protected] wrote:
> From: Tomas Sedovic <[email protected]>
> 
> Use it as the default template, delete the now obsolete dcloud.rhtml.
> ---
>  src/app/controllers/application_controller.rb |    6 +-
>  src/app/views/layouts/aggregator.haml         |   70 +++++++++++++++++++
>  src/app/views/layouts/dcloud.rhtml            |   89 
> -------------------------
>  3 files changed, 73 insertions(+), 92 deletions(-)
>  create mode 100644 src/app/views/layouts/aggregator.haml
>  delete mode 100644 src/app/views/layouts/dcloud.rhtml
> 
> diff --git a/src/app/controllers/application_controller.rb 
> b/src/app/controllers/application_controller.rb
> index 9ce3388..84f8a89 100644
> --- a/src/app/controllers/application_controller.rb
> +++ b/src/app/controllers/application_controller.rb
> @@ -41,9 +41,9 @@ class ApplicationController < ActionController::Base
>  
>    def choose_layout
>      if(params[:component_layout])
> -      return (ENV["RAILS_ENV"] != "production")?'components/' << 
> params[:component_layout]:'dcloud'
> +      return (ENV["RAILS_ENV"] != "production")?'components/' << 
> params[:component_layout]:'aggregator'
>      end
> -    @layout = 'dcloud'
> +    @layout = 'aggregator'
>      return @layout
>    end
>  
> @@ -115,7 +115,7 @@ class ApplicationController < ActionController::Base
>      @ajax = params[:ajax]
>      @nolayout = params[:nolayout]
>      if @layout
> -      render :layout => 'dcloud'
> +      render :layout => 'aggregator'
>      elsif @ajax
>        render :template => 'layouts/popup-error', :layout => 
> 'tabs-and-content'
>      elsif @nolayout
> diff --git a/src/app/views/layouts/aggregator.haml 
> b/src/app/views/layouts/aggregator.haml
> new file mode 100644
> index 0000000..a055756
> --- /dev/null
> +++ b/src/app/views/layouts/aggregator.haml
> @@ -0,0 +1,70 @@
> +!!!
> +%html{html_attrs}
> +  %head
> +    %meta(http-equiv="content-type" content="text/html;charset=UTF-8")
> +    %title
> +      dCloud
> +      = yield :title
> +    = stylesheet_link_tag 'layout'
> +    = stylesheet_link_tag 'components'
> +    = stylesheet_link_tag 'dcloud'
> +    /[if IE]
> +      = stylesheet_link_tag 'ie'
> +    = stylesheet_link_tag '/javascripts/jquery-treeview/ovirt.treeview.css'
> +    = stylesheet_link_tag 'flexigrid/flexigrid.css'
> +    = stylesheet_link_tag 'facebox'
> +    = stylesheet_link_tag 'jquery.jgrowl.css'
> +    = stylesheet_link_tag 'ovirt-tree/tree'
> +
> +    = javascript_include_tag "jquery-1.2.6.min.js"
> +    = javascript_include_tag "jquery-treeview/jquery.treeview.js"
> +    = javascript_include_tag "jquery-treeview/jquery.treeview.async.js"
> +    = javascript_include_tag "flexigrid.js"
> +    = javascript_include_tag "facebox.js"
> +    = javascript_include_tag "jquery.livequery.min.js"
> +    = javascript_include_tag "jquery.form.js"
> +    = javascript_include_tag "jquery.jgrowl.js"
> +
> +    = javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.core.packed.js"
> +    = javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.tabs.packed.js"
> +
> +    /ovirt-specific functions defined here
> +    = javascript_include_tag "ovirt.js"
> +    :javascript
> +      var $tabs, selected_tab;
> +      $(document).ready(function(){
> +         $.ajaxSetup({error: function(xhr) {$.jGrowl(xhr.status + ' ' + 
> xhr.statusText);}});
> +            
> $('a[rel*=facebox]').livequery(function(){$(this).facebox();},function(){});
> +            $('.dialog_tab_nav a').livequery(function(){
> +                $(this).bind('click', function(){
> +                    $('.dialog_tab_nav li').removeClass('current');
> +                    $(this).parent().addClass('current');
> +                    $.ajax({
> +                        url: $(this).attr('href'),
> +                        type: 'GET',
> +                        data: {ajax:true},
> +                        dataType: 'html',
> +                        success: function(data) {
> +                          var wrapped_data = 
> $(data).find('div').filter('[id=dialog-content-area]');
> +                          var my_parent = $(this).parent();
> +                          $('#dialog-content-area').html($(data));
> +                          $('#facebox').css('left', $(window).width() / 2 - 
> ($('#facebox table').width() / 2));
> +                        },
> +                        error: function(xhr) {$.jGrowl(xhr.status + ' ' + 
> xhr.statusText);}
> +                    });
> +                    return false;})},function(){});
> +                    $('ul.instance_action_list 
> li:first-child').addClass('first');
> +      });
> +    = yield :scripts
> +  %body
> +    #header
> +      = render :partial => '/layouts/header'
> +    #side
> +      = render :partial => '/layouts/main_nav' unless @current_user.nil?
> +    #tabs-and-content-container
> +      #navigation-tabs(style="position:absolute; top:40px; left:250px;")
> +        = render :partial => '/layouts/navigation_tabs'
> +      #main
> +        #content_area
> +          = render :partial => '/layouts/notification'
> +          = yield # the rest of the center and right hand side
> diff --git a/src/app/views/layouts/dcloud.rhtml 
> b/src/app/views/layouts/dcloud.rhtml
> deleted file mode 100644
> index 0026a00..0000000
> --- a/src/app/views/layouts/dcloud.rhtml
> +++ /dev/null
> @@ -1,89 +0,0 @@
> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> -       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> -
> -<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> -
> -<head>
> -  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
> -  <title>dCloud <%= yield :title -%></title>
> -  <!--%= stylesheet_link_tag 'default' %--> <%# remove me %>
> -  <%= stylesheet_link_tag 'layout' %>
> -  <%= stylesheet_link_tag 'components' %>
> -  <%= stylesheet_link_tag 'dcloud' %>
> -  <!--[if IE]>
> -    <%= stylesheet_link_tag 'ie' %>
> -  <![endif]-->
> -  <%= stylesheet_link_tag '/javascripts/jquery-treeview/ovirt.treeview.css' 
> %>
> -  <%= stylesheet_link_tag 'flexigrid/flexigrid.css' %>
> -  <%= stylesheet_link_tag 'facebox' %>
> -  <%= stylesheet_link_tag 'jquery.jgrowl.css' %>
> -  <%= stylesheet_link_tag 'ovirt-tree/tree' %>
> -
> -  <%= javascript_include_tag "jquery-1.2.6.min.js" -%>
> -  <%= javascript_include_tag "jquery-treeview/jquery.treeview.js" -%>
> -  <%= javascript_include_tag "jquery-treeview/jquery.treeview.async.js" -%>
> -  <%= javascript_include_tag "flexigrid.js" -%>
> -  <%= javascript_include_tag "facebox.js" -%>
> -  <%= javascript_include_tag "jquery.livequery.min.js" -%>
> -  <%= javascript_include_tag "jquery.form.js" -%>
> -  <%= javascript_include_tag "jquery.jgrowl.js" -%>
> -
> -  <%= javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.core.packed.js" 
> -%>
> -  <%= javascript_include_tag "jquery.ui-1.5.2/ui/packed/ui.tabs.packed.js" 
> -%>
> -
> -  <!-- ovirt-specific functions defined here -->
> -  <%= javascript_include_tag "ovirt.js" -%>
> -    <script type="text/javascript">
> -      var $tabs, selected_tab;
> -      $(document).ready(function(){
> -         $.ajaxSetup({error: function(xhr) {$.jGrowl(xhr.status + ' ' + 
> xhr.statusText);}});
> -            
> $('a[rel*=facebox]').livequery(function(){$(this).facebox();},function(){});
> -            $('.dialog_tab_nav a').livequery(function(){
> -                $(this).bind('click', function(){
> -                    $('.dialog_tab_nav li').removeClass('current');
> -                    $(this).parent().addClass('current');
> -                    $.ajax({
> -                        url: $(this).attr('href'),
> -                        type: 'GET',
> -                        data: {ajax:true},
> -                        dataType: 'html',
> -                        success: function(data) {
> -                          var wrapped_data = 
> $(data).find('div').filter('[id=dialog-content-area]');
> -                          var my_parent = $(this).parent();
> -                          $('#dialog-content-area').html($(data));
> -                          $('#facebox').css('left', $(window).width() / 2 - 
> ($('#facebox table').width() / 2));
> -                        },
> -                        error: function(xhr) {$.jGrowl(xhr.status + ' ' + 
> xhr.statusText);}
> -                    });
> -                    return false;})},function(){});
> -                    $('ul.instance_action_list 
> li:first-child').addClass('first');
> -     });
> -      </script>
> -   <%= yield :scripts -%>
> - </head>
> -
> - <body>
> -
> -   <div id="header">
> -      <%= render :partial => '/layouts/header' %>
> -   </div>
> -
> -   <div id="side">
> -     <%= render :partial => '/layouts/main_nav' unless @current_user.nil? %>
> -   </div>
> -
> -   <div id="tabs-and-content-container">
> -
> -     <div id="navigation-tabs" style="position:absolute; top:40px; 
> left:250px;">
> -       <%= render :partial => '/layouts/navigation_tabs' %>
> -     </div>
> -     <div id="main">
> -        <div id="content_area">
> -          <%= render :partial => '/layouts/notification' %>
> -          <%= yield  %> <%# the rest of the center and right hand side %>
> -        </div>
> -     </div>
> -   </div>
> -
> - </body>
> -</html>

ACK, this works just fine - renders as before, now using haml template

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to