aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--config/initializers/theme_loader.rb4
-rw-r--r--doc/TRANSLATE.md2
-rw-r--r--lib/tasks/gettext.rake4
-rw-r--r--lib/tasks/themes.rake2
-rwxr-xr-xscript/switch-theme.rb2
-rw-r--r--spec/spec_helper.rb1
7 files changed, 10 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index 87c55ce97..9e9a4b9f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,7 @@
.autotest
*#*#
TAGS
-/vendor/plugins/*theme
+/lib/themes
/locale/model_attributes.rb
/files/
/public/download
diff --git a/config/initializers/theme_loader.rb b/config/initializers/theme_loader.rb
index b3ae11e1e..9c79e513c 100644
--- a/config/initializers/theme_loader.rb
+++ b/config/initializers/theme_loader.rb
@@ -3,7 +3,9 @@
$alaveteli_route_extensions = []
def require_theme(theme_name)
- theme_main_include = File.expand_path "../../../vendor/plugins/#{theme_name}/lib/alavetelitheme.rb", __FILE__
+ theme_lib = Rails.root.join 'lib', 'themes', theme_name, 'lib'
+ $LOAD_PATH.unshift theme_lib.to_s
+ theme_main_include = Rails.root.join theme_lib, "alavetelitheme.rb"
if File.exists? theme_main_include
require theme_main_include
end
diff --git a/doc/TRANSLATE.md b/doc/TRANSLATE.md
index 2a8b0269e..aef2cfdc9 100644
--- a/doc/TRANSLATE.md
+++ b/doc/TRANSLATE.md
@@ -79,7 +79,7 @@ must:
language, using `bundle exec rake
gettext:store_model_attributes`, followed by `bundle exec rake
gettext:find`
- * careful of including msgids from themes in `vendor/plugin`;
+ * careful of including msgids from themes in `lib/themes`;
you might want to move them out of the way before running
the above commands
* this updates the PO template, but also merges it with the
diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake
index 366dfbe88..3f357213f 100644
--- a/lib/tasks/gettext.rake
+++ b/lib/tasks/gettext.rake
@@ -29,11 +29,11 @@ namespace :gettext do
end
def theme_files_to_translate(theme)
- Dir.glob("{vendor/plugins/#{theme}/lib}/**/*.{rb,erb}")
+ Dir.glob("{lib/themes/#{theme}/lib}/**/*.{rb,erb}")
end
def theme_locale_path(theme)
- File.join(Rails.root, "vendor", "plugins", theme, "locale-theme")
+ Rails.root.join "lib", "themes", theme, "locale-theme"
end
end
diff --git a/lib/tasks/themes.rake b/lib/tasks/themes.rake
index 1eed92f1e..78ffe73be 100644
--- a/lib/tasks/themes.rake
+++ b/lib/tasks/themes.rake
@@ -2,7 +2,7 @@
namespace :themes do
def plugin_dir
- File.join(Rails.root,"vendor","plugins")
+ File.join(Rails.root,"lib","themes")
end
def theme_dir(theme_name)
diff --git a/script/switch-theme.rb b/script/switch-theme.rb
index 03d59a2f9..e6afcebb9 100755
--- a/script/switch-theme.rb
+++ b/script/switch-theme.rb
@@ -113,7 +113,7 @@ symlink(File.join(full_theme_path, 'public'),
'alavetelitheme')
symlink(full_theme_path,
- File.join(alaveteli_directory, 'vendor', 'plugins'),
+ File.join(alaveteli_directory, 'lib', 'themes'),
requested_theme)
STDERR.puts """Switched to #{requested_theme}!
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 57d58e276..1eeb8603b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -16,6 +16,7 @@ SimpleCov.start('rails') do
add_filter 'lib/strip_attributes'
add_filter 'lib/has_tag_string'
add_filter 'lib/acts_as_xapian'
+ add_filter 'lib/themes'
end
Spork.prefork do