public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
Fetch "thanks for comment", "commenting has been 
disabled", "previewing your comment" from according 
templates (__thanks_for_comment, __commenting_disabled, 
__previewing_comment) to simplify L10N.

Add an options hash to Site#call_render, now takes boolean :layout 
parameter to allow partial template renders.
yaroslav (author)
Sun May 11 03:18:00 -0700 2008
commit  f80afafc295d5ef9687392074ff696d90beb47f2
tree    5338c36631fa1c20443c51262fb8b13737138fff
parent  9072b487bf45c5e41e33c66b32d94aea84732d1b
...
54
55
56
57
 
 
58
59
 
 
60
61
62
63
64
 
 
65
66
67
...
54
55
56
 
57
58
59
 
60
61
62
63
64
65
 
66
67
68
69
70
0
@@ -54,14 +54,17 @@
0
     rescue ActiveRecord::RecordInvalid
0
       show_article_with 'errors' => @comment.errors.full_messages, 'submitted' => params[:comment]
0
     rescue Article::CommentNotAllowed
0
- show_article_with 'errors' => ["Commenting has been disabled on this article"]
0
+ commenting_disabled = site.call_render(nil, :__commenting_disabled, {}, nil, :layout => false) rescue "Commenting has been disabled on this article"
0
+ show_article_with 'errors' => [commenting_disabled]
0
     rescue Comment::Previewing
0
- show_article_with 'errors' => ["Previewing your comment"], 'submitted' => params[:comment]
0
+ previewing_comment = site.call_render(nil, :__previewing_comment, {}, nil, :layout => false) rescue "Previewing your comment"
0
+ show_article_with 'errors' => [previewing_comment], 'submitted' => params[:comment]
0
     end
0
     
0
     def dispatch_comment
0
       @skip_caching = true
0
- show_article_with 'message' => 'Thanks for the comment!'
0
+ message = site.call_render(nil, :__thanks_for_comment, {}, nil, :layout => false) rescue "Thanks for the comment!"
0
+ show_article_with 'message' => message
0
     end
0
 
0
     def dispatch_archives
...
193
194
195
196
 
197
198
 
199
200
201
202
 
 
 
 
 
 
 
203
204
205
...
193
194
195
 
196
197
198
199
200
 
201
 
202
203
204
205
206
207
208
209
210
211
0
@@ -193,13 +193,19 @@
0
     comment_age.to_i > -1
0
   end
0
 
0
- def call_render(section, template_type, assigns = {}, controller = nil)
0
+ def call_render(section, template_type, assigns = {}, controller = nil, options = {})
0
     assigns.update('site' => to_liquid(section), 'mode' => template_type)
0
     assigns.update(default_assigns) unless default_assigns.empty?
0
+ options.reverse_merge!(:layout => true)
0
     template = set_content_template(section, template_type)
0
- layout = set_layout_template(section, template_type)
0
     handler = @@template_handlers[theme.extension] || @@template_handlers[".liquid"]
0
- handler.new(self).render(section, layout, template, assigns, controller)
0
+
0
+ if options[:layout]
0
+ layout = set_layout_template(section, template_type)
0
+ handler.new(self).render(section, layout, template, assigns, controller)
0
+ else
0
+ handler.new(self).parse_inner_template(template, assigns, controller)
0
+ end
0
   end
0
   
0
   def to_liquid(current_section = nil)

Comments

    No one has commented yet.