Story 1776: Add theme to api server similar to workbench. Updated files: Gemfile...
authorradhika chippada <radhika@curoverse.com>
Wed, 9 Apr 2014 21:00:28 +0000 (17:00 -0400)
committerradhika chippada <radhika@curoverse.com>
Wed, 9 Apr 2014 21:00:28 +0000 (17:00 -0400)
services/api/Gemfile
services/api/Gemfile.lock
services/api/app/controllers/application_controller.rb
services/api/config/application.default.yml
services/api/config/routes.rb

index 5932778657ff2b6f2917e237e675aa15e7e1ff64..cbe2c41a4e49d5094c22f579ff657e67ff4b893c 100644 (file)
@@ -63,4 +63,6 @@ gem 'test_after_commit', :group => :test
 gem 'google-api-client', '~> 0.6.3'
 gem 'trollop'
 
+gem 'themes_for_rails'
+
 gem 'arvados-cli', '>= 0.1.20140328152103'
index 39718bda445f29624ccd9d118c2a5b88e299656d..460c58ea69bff934b9f30087eca1388bba3a7664 100644 (file)
@@ -177,6 +177,8 @@ GEM
       tilt (~> 1.1, != 1.3.0)
     sqlite3 (1.3.8)
     test_after_commit (0.2.2)
+    themes_for_rails (0.5.1)
+      rails (>= 3.0.0)
     therubyracer (0.12.0)
       libv8 (~> 3.16.14.0)
       ref
@@ -214,6 +216,7 @@ DEPENDENCIES
   sass-rails (>= 3.2.0)
   sqlite3
   test_after_commit
+  themes_for_rails
   therubyracer
   trollop
   uglifier (>= 1.0.3)
index 06e1838411b4a4d4171bf2884f323d61a9737ebf..227a488774ae83f8e6d5ed0c0361b69cfe3463a3 100644 (file)
@@ -1,5 +1,6 @@
 class ApplicationController < ActionController::Base
   include CurrentApiClient
+  include ThemesForRails::ActionController
 
   respond_to :json
   protect_from_forgery
@@ -20,6 +21,8 @@ class ApplicationController < ActionController::Base
                                                    :render_error,
                                                    :render_not_found]
 
+  theme :select_theme
+
   attr_accessor :resource_attrs
 
   def index
@@ -477,4 +480,8 @@ class ApplicationController < ActionController::Base
     end
     super *opts
   end
+
+  def select_theme
+    return Rails.configuration.arvados_theme
+  end
 end
index 1de4db1b7a81c1d55ea67dd6928a4bfaebbea00c..37bb1c380f9d48091c76ec167093c7b532709124 100644 (file)
@@ -110,3 +110,5 @@ common:
 
   # Version of your assets, change this if you want to expire all your assets
   assets.version: "1.0"
+
+  arvados_theme: default
index 4bc5de8c8462f1ffca9e75663652866e5c77fdfe..211701a05455edc6e3b05d03bd0823137247acec 100644 (file)
@@ -1,4 +1,6 @@
 Server::Application.routes.draw do
+  themes_for_rails
+
   resources :humans
   resources :traits
   resources :repositories