theme_support 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -0
- data/VERSION +1 -1
- data/lib/theme_support/patches/abstractcontroller_ex.rb +5 -9
- data/lib/theme_support/patches/actioncontroller_ex.rb +14 -0
- data/lib/theme_support.rb +1 -0
- data/theme_support.gemspec +1 -1
- metadata +5 -4
data/README
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.1
|
@@ -15,14 +15,10 @@ class AbstractController::Base
|
|
15
15
|
# 'theme_name'
|
16
16
|
# end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
theme = ActionView::Base.process_view_paths(File.join("themes", theme_name, "views"))
|
23
|
-
prepend_view_path(theme)
|
24
|
-
end
|
25
|
-
#end
|
18
|
+
def self.theme(theme_name, conditions = {})
|
19
|
+
# TODO: Allow conditions... (?)
|
20
|
+
write_inheritable_attribute "theme", theme_name
|
21
|
+
end
|
26
22
|
|
27
23
|
# Retrieves the current set theme
|
28
24
|
def current_theme(passed_theme=nil)
|
@@ -51,4 +47,4 @@ AbstractController::Layouts.module_eval do
|
|
51
47
|
options[:layout] = File.join(theme_path, options[:layout])
|
52
48
|
end
|
53
49
|
end
|
54
|
-
end
|
50
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Load the theme to execution and not in loading app
|
2
|
+
# TODO Check if this code works this action mailer
|
3
|
+
module ActionController
|
4
|
+
module ImplicitRender
|
5
|
+
alias_method :theme_support_default_render, :default_render
|
6
|
+
|
7
|
+
def default_render
|
8
|
+
theme = current_theme
|
9
|
+
theme = ActionView::Base.process_view_paths(File.join("themes", theme, "views"))
|
10
|
+
prepend_view_path(theme)
|
11
|
+
theme_support_default_render
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/theme_support.rb
CHANGED
@@ -7,6 +7,7 @@ require 'theme_support/theme_controller'
|
|
7
7
|
|
8
8
|
# Initializes theme support by extending some of the core Rails classes
|
9
9
|
require 'theme_support/patches/abstractcontroller_ex'
|
10
|
+
require 'theme_support/patches/actioncontroller_ex'
|
10
11
|
require 'theme_support/patches/routeset_ex'
|
11
12
|
|
12
13
|
# Add the tag helpers for rhtml and, optionally, liquid templates
|
data/theme_support.gemspec
CHANGED
@@ -5,7 +5,7 @@ spec = Gem::Specification.new do |s|
|
|
5
5
|
s.name = 'theme_support'
|
6
6
|
s.author = 'Pierre Yager and Sylvain Claudel'
|
7
7
|
s.email = "pierre@levosgien.net"
|
8
|
-
s.version = ("$Release: 3.0.
|
8
|
+
s.version = ("$Release: 3.0.1" =~ /[\.\d]+/) && $&
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.homepage = 'http://github.com/zedalaye/theme_support'
|
11
11
|
s.rubyforge_project = 'theme-support'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme_support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 1
|
10
|
+
version: 3.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pierre Yager and Sylvain Claudel
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-09 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- lib/generators/theme/templates/preview.png
|
39
39
|
- lib/generators/theme/theme_generator.rb
|
40
40
|
- lib/theme_support.rb
|
41
|
+
- lib/theme_support/patches/actioncontroller_ex.rb
|
41
42
|
- lib/theme_support/patches/abstractcontroller_ex.rb
|
42
43
|
- lib/theme_support/patches/routeset_ex.rb
|
43
44
|
- lib/theme_support/patches/actionmailer_ex.rb
|