[ARVADOS] created: c190e60459f50d4a93f1a8f14315ea131f1e038a

git at public.curoverse.com git at public.curoverse.com
Wed Jan 8 16:20:34 EST 2014


        at  c190e60459f50d4a93f1a8f14315ea131f1e038a (commit)


commit c190e60459f50d4a93f1a8f14315ea131f1e038a
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jan 8 16:21:02 2014 -0500

    Added theme support to workbench.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index b947c81..49a4888 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -53,3 +53,4 @@ gem 'RedCloth'
 
 gem 'piwik_analytics'
 gem 'httpclient'
+gem 'themes_for_rails'
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 697f15a..5e53ef1 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -130,6 +130,8 @@ GEM
       rack (~> 1.0)
       tilt (~> 1.1, != 1.3.0)
     sqlite3 (1.3.8)
+    themes_for_rails (0.5.1)
+      rails (>= 3.0.0)
     therubyracer (0.12.0)
       libv8 (~> 3.16.14.0)
       ref
@@ -170,6 +172,7 @@ DEPENDENCIES
   sass
   sass-rails (~> 3.2.0)
   sqlite3
+  themes_for_rails
   therubyracer
   twitter-bootstrap-rails
   uglifier (>= 1.0.3)
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index f431be2..b4da696 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base
   around_filter :thread_with_api_token, :except => [:render_exception, :render_not_found]
   before_filter :find_object_by_uuid, :except => [:index, :render_exception, :render_not_found]
   before_filter :check_user_agreements, :except => [:render_exception, :render_not_found]
+  theme :select_theme
 
   begin
     rescue_from Exception,
@@ -253,4 +254,8 @@ class ApplicationController < ActionController::Base
     end
     true
   end
+
+  def select_theme
+    return Rails.configuration.arvados_theme
+  end
 end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index f843fe0..6b8a352 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -22,8 +22,9 @@
   <%= yield :js %>
   <% end %>
   <style>
-    body  {
-    padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
+    .container  {
+    padding-top: 60px; /* 60px to make the container go all the way to the
+    bottom of the topbar */
     }
     @media (max-width: 979px) { body { padding-top: 0; } }
     <%= yield :css %>
diff --git a/apps/workbench/app/views/users/home.html.erb b/apps/workbench/app/views/users/home.html.erb
index d221db9..883b6a0 100644
--- a/apps/workbench/app/views/users/home.html.erb
+++ b/apps/workbench/app/views/users/home.html.erb
@@ -1,5 +1,4 @@
-<% content_for :head do %>
-    <style>
+<% content_for :css do %>
       .dash-list {
         padding: 9px 0;
       }
@@ -34,7 +33,6 @@
       .daxalert {
       overflow: hidden;
       }
-    </style>
 <% end %>
 
 <div class="container-fluid">
diff --git a/apps/workbench/config/environments/development.rb.example b/apps/workbench/config/environments/development.rb.example
index f1a20c0..119089e 100644
--- a/apps/workbench/config/environments/development.rb.example
+++ b/apps/workbench/config/environments/development.rb.example
@@ -51,4 +51,6 @@ ArvadosWorkbench::Application.configure do
   config.activation_contact_link = 'mailto:info at arvados.org'
 
   config.arvados_docsite = 'http://doc.arvados.org'
+
+  config.arvados_theme = 'default'
 end
diff --git a/apps/workbench/config/environments/production.rb.example b/apps/workbench/config/environments/production.rb.example
index 76d4403..5c8f2ba 100644
--- a/apps/workbench/config/environments/production.rb.example
+++ b/apps/workbench/config/environments/production.rb.example
@@ -83,4 +83,6 @@ ArvadosWorkbench::Application.configure do
   config.activation_contact_link = 'mailto:info at arvados.org'
 
   config.arvados_docsite = 'http://doc.arvados.org'
+
+  config.arvados_theme = 'default'
 end
diff --git a/apps/workbench/config/environments/test.rb.example b/apps/workbench/config/environments/test.rb.example
index 6ea735e..7122c2b 100644
--- a/apps/workbench/config/environments/test.rb.example
+++ b/apps/workbench/config/environments/test.rb.example
@@ -53,4 +53,6 @@ ArvadosWorkbench::Application.configure do
   config.activation_contact_link = 'mailto:info at arvados.org'
 
   config.arvados_docsite = 'http://doc.arvados.org'
+
+  config.arvados_theme = 'default'
 end
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 409058c..cf0dcec 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -1,4 +1,6 @@
 ArvadosWorkbench::Application.routes.draw do
+  themes_for_rails
+
   resources :user_agreements
   post '/user_agreements/sign' => 'user_agreements#sign'
   get '/user_agreements/signatures' => 'user_agreements#signatures'

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list