aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-16 13:57:48 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-23 09:15:49 +0100
commite0a9db38df13a49a770d0298ea198df6d7f6cf99 (patch)
tree4cd23149ed050f61d148e91fe3adbb0e47bf79d7
parent157e92196d91325d8780f60a058a798727606c5b (diff)
Experimental theme loader, that allows us to specify the order themes are loaded in -- so we can try having more than one loaded at once.
-rw-r--r--config/initializers/theme_loader.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb
new file mode 100644
index 000000000..df392cc08
--- /dev/null
+++ b/config/initializers/theme_loader.rb
@@ -0,0 +1,7 @@
+theme_urls = MySociety::Config.get("THEME_URLS", [])
+if ENV["RAILS_ENV"] != "test" # Don't let the theme interfere with Alaveteli specs
+ for url in theme_urls.reverse
+ theme_name = url.sub(/.*\/(.*).git/, "\\1")
+ require File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__
+ end
+end