diff options
Diffstat (limited to 'app/lib/themes.rb')
-rw-r--r-- | app/lib/themes.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/lib/themes.rb b/app/lib/themes.rb index 243ffb9ab..f7ec22fd2 100644 --- a/app/lib/themes.rb +++ b/app/lib/themes.rb @@ -7,7 +7,19 @@ class Themes include Singleton def initialize - @conf = YAML.load_file(Rails.root.join('config', 'themes.yml')) + result = Hash.new + Dir.glob(Rails.root.join('app', 'javascript', 'themes', '*', 'theme.yml')) do |path| + data = YAML.load_file(path) + name = File.basename(File.dirname(path)) + if data['pack'] + result[name] = data + end + end + @conf = result + end + + def get(name) + @conf[name] end def names |