aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/general.yml-example8
-rw-r--r--config/initializers/theme_loader.rb7
2 files changed, 13 insertions, 2 deletions
diff --git a/config/general.yml-example b/config/general.yml-example
index 3c50e8005..019eb7ada 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -34,8 +34,12 @@ SPECIAL_REPLY_VERY_LATE_AFTER_DAYS: 60
# example public bodies for the home page, semicolon delimited - short_names
FRONTPAGE_PUBLICBODY_EXAMPLES: 'tgq'
-# URL of theme to install (when running rails-post-deploy script)
-THEME_URL: 'git://github.com/sebbacon/alavetelitheme.git'
+# URLs of themes to download and use (when running rails-post-deploy
+# script). Earlier in the list means the templates have a higher
+# priority.
+THEME_URLS:
+ - 'git://github.com/sebbacon/adminbootstraptheme.git'
+ - 'git://github.com/sebbacon/alavetelitheme.git'
# Whether a user needs to sign in to start the New Request process
FORCE_REGISTRATION_ON_NEW_REQUEST: false
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