Added theme support to workbench.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 8 Jan 2014 21:21:02 +0000 (16:21 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 8 Jan 2014 21:21:02 +0000 (16:21 -0500)
apps/workbench/Gemfile
apps/workbench/Gemfile.lock
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/views/layouts/application.html.erb
apps/workbench/app/views/users/home.html.erb
apps/workbench/config/environments/development.rb.example
apps/workbench/config/environments/production.rb.example
apps/workbench/config/environments/test.rb.example
apps/workbench/config/routes.rb

index b947c81e190952bc3fc7326c291935b16571316b..49a488840576c831cf4c8dc56283599bfa19c332 100644 (file)
@@ -53,3 +53,4 @@ gem 'RedCloth'
 
 gem 'piwik_analytics'
 gem 'httpclient'
+gem 'themes_for_rails'
index 697f15ae086d9db5bd73baea4435382613b66e23..5e53ef1cc472613391a776acdf44024207f76a50 100644 (file)
@@ -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)
index f431be2bb5114b78e61385c962db813000e9993a..b4da696bc05f78cd9037f98baccb824069c4f07e 100644 (file)
@@ -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
index f843fe0e5b70256080d4472cc5a9652b52bf52c3..6b8a3523d0423049ddede1a5dd930c711a55c715 100644 (file)
@@ -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 %>
index d221db9a8df1c6a262f6d277b5c02c11cf557207..883b6a03897daa5db46e18c130da583128d52e98 100644 (file)
@@ -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">
index f1a20c0ac1ddccdb85149c02d734f8a44641ebdf..119089e7284e466e603df8eeef87cc0fede9729a 100644 (file)
@@ -51,4 +51,6 @@ ArvadosWorkbench::Application.configure do
   config.activation_contact_link = 'mailto:info@arvados.org'
 
   config.arvados_docsite = 'http://doc.arvados.org'
+
+  config.arvados_theme = 'default'
 end
index 76d44035521450a474b4e15ab8b63fa8619e4be1..5c8f2baa7030e5886b96fb45a97a70e39ba5ea2f 100644 (file)
@@ -83,4 +83,6 @@ ArvadosWorkbench::Application.configure do
   config.activation_contact_link = 'mailto:info@arvados.org'
 
   config.arvados_docsite = 'http://doc.arvados.org'
+
+  config.arvados_theme = 'default'
 end
index 6ea735e2800dc60f0982115b62dfa93aef13e00d..7122c2bbce3f92e81952ae32d6f240e162237d94 100644 (file)
@@ -53,4 +53,6 @@ ArvadosWorkbench::Application.configure do
   config.activation_contact_link = 'mailto:info@arvados.org'
 
   config.arvados_docsite = 'http://doc.arvados.org'
+
+  config.arvados_theme = 'default'
 end
index 409058cf3aa2b764814eeb82de06151aa3ac4d06..cf0dcec8200cc30b160ccb63a38a53f8584b6f34 100644 (file)
@@ -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'