Skip to content

Commit

Permalink
merge pull request locomotivecms#148
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Jul 28, 2011
1 parent 08cac3b commit 6d66275
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions config/initializers/locomotive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
# # => '[email protected]' (Heroku), '[email protected]' (Bushido), '[email protected]' (Dev) or 'support@<your_hosting_platform>' (Multi-sites)
config.mailer_sender = 'support'

# allow apps using the engine to add their own Liquid drops, variables and similar available
# in Liquid templates, extending the assigns used while rendering.
# follow the Dependency Injection pattern
# config.context_assign_extensions = {}

# Rack-cache settings, mainly used for the inline resizing image module. Default options:
# config.rack_cache = {
# :verbose => true,
Expand Down
5 changes: 5 additions & 0 deletions lib/generators/locomotive/install/templates/locomotive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
# # => '[email protected]' (Heroku), '[email protected]' (Bushido), '[email protected]' (Dev) or 'support@<your_hosting_platform>' (Multi-sites)
config.mailer_sender = 'support'

# allow apps using the engine to add their own Liquid drops, variables and similar available
# in Liquid templates, extending the assigns used while rendering.
# follow the Dependency Injection pattern
# config.context_assign_extensions = {}

# Rack-cache settings, mainly used for the inline resizing image module. Default options:
# config.rack_cache = {
# :verbose => true,
Expand Down
3 changes: 2 additions & 1 deletion lib/locomotive/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class Configuration
:metastore => URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces
:entitystore => URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
},
:devise_modules => [:database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :encryptable, { :encryptor => :sha1 }]
:devise_modules => [:database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :encryptable, { :encryptor => :sha1 }],
:context_assign_extensions => { }
}

cattr_accessor :settings
Expand Down
6 changes: 5 additions & 1 deletion lib/locomotive/render.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ def locomotive_context
'url' => request.url,
'now' => Time.now.utc,
'today' => Date.today
}.merge(flash.stringify_keys) # data from api
}

assigns.merge!(Locomotive.config.context_assign_extensions)

assigns.merge!(flash.stringify_keys) # data from api

if @page.templatized? # add instance from content type
assigns['content_instance'] = @content_instance
Expand Down

0 comments on commit 6d66275

Please sign in to comment.