[Ovirt-devel] [PATCH server] renamed 'redux' layout to standard rails 'default'

Mohammed Morsi mmorsi at redhat.com
Thu Nov 13 18:49:35 UTC 2008


---
 src/app/controllers/application.rb        |    6 +-
 src/app/views/layouts/_header.rhtml       |   11 +++
 src/app/views/layouts/_header_redux.rhtml |   11 ---
 src/app/views/layouts/default.rhtml       |  102 +++++++++++++++++++++++++++++
 src/app/views/layouts/redux.rhtml         |  102 -----------------------------
 5 files changed, 116 insertions(+), 116 deletions(-)
 create mode 100644 src/app/views/layouts/_header.rhtml
 delete mode 100644 src/app/views/layouts/_header_redux.rhtml
 create mode 100644 src/app/views/layouts/default.rhtml
 delete mode 100644 src/app/views/layouts/redux.rhtml

diff --git a/src/app/controllers/application.rb b/src/app/controllers/application.rb
index 3f75979..9affb20 100644
--- a/src/app/controllers/application.rb
+++ b/src/app/controllers/application.rb
@@ -34,10 +34,10 @@ class ApplicationController < ActionController::Base
   before_filter :is_logged_in, :get_help_section
 
   def choose_layout
-    if(params[:component_layout])
-      return (ENV["RAILS_ENV"] != "production")?'components/' << params[:component_layout]:'redux'
+    if(params[:component_layout] and ENV["RAILS_ENV"] != "production")
+      return 'components/' << params[:component_layout]
     end
-    return 'redux'
+    return 'default'
   end
 
   def is_logged_in
diff --git a/src/app/views/layouts/_header.rhtml b/src/app/views/layouts/_header.rhtml
new file mode 100644
index 0000000..a12d567
--- /dev/null
+++ b/src/app/views/layouts/_header.rhtml
@@ -0,0 +1,11 @@
+<div class="header_logo"><%= image_tag "ovirt_logo_redux.png" %></div>
+
+<div class="header_info">
+  <div id="hi-username">Hi, <%= @user %></div>
+  <form method="POST" id="search-form" action="<%= url_for :controller => "search", :action => 'results' %>">
+    <input id="textfield_effect" name="terms" value="Search" onkeypress="" onfocus="if( this.value == this.defaultValue ) this.value='';" type="text">
+    <input id="searchbox-button" src="<%= image_path "icon_search.png"%>" title="Search" type="image">  |
+  </form>
+</div>
+
+<div class="header_titlebar">Resource Pools</div>
diff --git a/src/app/views/layouts/_header_redux.rhtml b/src/app/views/layouts/_header_redux.rhtml
deleted file mode 100644
index a12d567..0000000
--- a/src/app/views/layouts/_header_redux.rhtml
+++ /dev/null
@@ -1,11 +0,0 @@
-<div class="header_logo"><%= image_tag "ovirt_logo_redux.png" %></div>
-
-<div class="header_info">
-  <div id="hi-username">Hi, <%= @user %></div>
-  <form method="POST" id="search-form" action="<%= url_for :controller => "search", :action => 'results' %>">
-    <input id="textfield_effect" name="terms" value="Search" onkeypress="" onfocus="if( this.value == this.defaultValue ) this.value='';" type="text">
-    <input id="searchbox-button" src="<%= image_path "icon_search.png"%>" title="Search" type="image">  |
-  </form>
-</div>
-
-<div class="header_titlebar">Resource Pools</div>
diff --git a/src/app/views/layouts/default.rhtml b/src/app/views/layouts/default.rhtml
new file mode 100644
index 0000000..092e1fe
--- /dev/null
+++ b/src/app/views/layouts/default.rhtml
@@ -0,0 +1,102 @@
+<!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><%= yield :title -%></title>
+  <!--%= stylesheet_link_tag 'default' %--> <%# remove me %>
+  <%= stylesheet_link_tag 'layout' %>
+  <%= stylesheet_link_tag 'components' %>
+  <!--[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.timers.js" -%>
+  <%= javascript_include_tag "jquery-svg/jquery.svg.pack.js" -%>
+  <!--%= javascript_include_tag "jquery-svg/jquery.svgfilter.js" -%-->
+  <%= javascript_include_tag "jquery-svg/jquery.svggraph.js" -%>
+  <%= javascript_include_tag "jquery.cookie.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" -%>
+  <%= javascript_include_tag "trimpath-template-1.0.38.js" %>
+  <%= javascript_include_tag "ovirt.tree.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(){});
+	});
+      </script>
+   <%= yield :scripts -%>
+ </head>
+
+ <body>
+
+   <div id="header">
+      <%= render :partial => '/layouts/header' %>
+   </div>
+
+   <div id="side">
+     <%= render :partial => '/layouts/tree' %>
+   </div>
+
+   <div id="side-toolbar" class="header_menu_wrapper">
+     <%= render :partial => '/layouts/side_toolbar' %>
+   </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">
+          <div id="help-div">
+                <%= link_to image_tag("icon_help.png"),
+                {:controller => 'help', :action => @help_section, :anchor => @anchor},
+                :id=>"help-link", :popup => true, :title => "Help" %>
+          </div>
+          <%= yield  %> <%# the rest of the center and right hand side %>
+        </div>
+     </div>
+   </div>
+
+ </body>
+</html>
diff --git a/src/app/views/layouts/redux.rhtml b/src/app/views/layouts/redux.rhtml
deleted file mode 100644
index a41864d..0000000
--- a/src/app/views/layouts/redux.rhtml
+++ /dev/null
@@ -1,102 +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><%= yield :title -%></title>
-  <!--%= stylesheet_link_tag 'default' %--> <%# remove me %>
-  <%= stylesheet_link_tag 'layout' %>
-  <%= stylesheet_link_tag 'components' %>
-  <!--[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.timers.js" -%>
-  <%= javascript_include_tag "jquery-svg/jquery.svg.pack.js" -%>
-  <!--%= javascript_include_tag "jquery-svg/jquery.svgfilter.js" -%-->
-  <%= javascript_include_tag "jquery-svg/jquery.svggraph.js" -%>
-  <%= javascript_include_tag "jquery.cookie.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" -%>
-  <%= javascript_include_tag "trimpath-template-1.0.38.js" %>
-  <%= javascript_include_tag "ovirt.tree.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(){});
-	});
-      </script>
-   <%= yield :scripts -%>
- </head>
-
- <body>
-
-   <div id="header">
-      <%= render :partial => '/layouts/header_redux' %>
-   </div>
-
-   <div id="side">
-     <%= render :partial => '/layouts/tree' %>
-   </div>
-
-   <div id="side-toolbar" class="header_menu_wrapper">
-     <%= render :partial => '/layouts/side_toolbar' %>
-   </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">
-          <div id="help-div">
-                <%= link_to image_tag("icon_help.png"),
-                {:controller => 'help', :action => @help_section, :anchor => @anchor},
-                :id=>"help-link", :popup => true, :title => "Help" %>
-          </div>
-          <%= yield  %> <%# the rest of the center and right hand side %>
-        </div>
-     </div>
-   </div>
-
- </body>
-</html>
-- 
1.5.6.5




More information about the ovirt-devel mailing list