replace Liquid by Radius

This commit is contained in:
chris authored and ihower committed 2011-04-13 18:22:51 +08:00
1 parent 70347d4c34
commit 8b8eff6920
8 files changed
+36 -59

No files matched your search

-13
View File
@@ -1,13 +0,0 @@
class I18nLiquid < Liquid::Tag
def initialize(tag_name, value, tokens)
super
@value = value.to_s
end
def render(context)
I18nVariable.first(:conditions => {:key => @value})[I18n.locale] rescue ''
end
end
Liquid::Template.register_tag('t', I18nLiquid)
-27
View File
@@ -1,27 +0,0 @@
module SnippetFilter
def render_snippet(snippet_name)
snippet = Snippet.first(:conditions => {:name => snippet_name})
if snippet
return Liquid::Template.parse( snippet.content ).render
else
return t('nothing')
end
end
def ruling_snippet(snippet_name)
case snippet_name
when 'language_bar'
site = Site.first
@site_in_use_locales = site.in_use_locales
@site_valid_locales = site.valid_locales
end
return Liquid::Template.parse( eval(File.open("#{RAILS_ROOT}/lib/snippets/#{snippet_name}.snippet").read) ).render
end
end
Liquid::Template.register_filter(SnippetFilter)