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 !
Merge commit 'yaroslav/master'
technoweenie (author)
Thu May 15 17:48:51 -0700 2008
commit  478896185b0feb41ac328742f3527531c35f2cad
tree    4b4360f46dc7d1e5a0409bbb3e2ad8aea7b1ca28
parent  aa50252c19b28969e3bc217e70bed6a2f16d3a78 parent  33a730791242bb12b2bcd8cfab0a59e2b750b725
...
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)
...
31
32
33
 
 
 
 
 
34
35
36
...
31
32
33
34
35
36
37
38
39
40
41
0
@@ -31,6 +31,11 @@
0
     <dt><label for="site_timezone">Website Timezone</label></dt>
0
     <dd><%= select_tag 'site_timezone', options_for_select(['UTC'] + TZInfo::Timezone.all.map{|tz| [tz.to_s, tz.name]}.sort, @site.timezone.name), :name => 'site[timezone]' %></dd>
0
     <dt>
0
+ <label for="site_lang">Site language</label>
0
+ <span class="hint">Used to specify language in your site feeds</span>
0
+ </dt>
0
+ <dd><%= f.text_field :lang %></dd>
0
+ <dt>
0
       <label for="site_current_theme_path">Current Theme Path</label>
0
       <span class="hint">This is the path to the current template in /themes/site-<%= site.id %>. Be careful with this setting!</span>
0
     </dt>
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
0
 
0
-xml.feed "xml:lang" => "en-US", "xmlns" => 'http://www.w3.org/2005/Atom' do
0
+xml.feed "xml:lang" => "#{site.lang || 'en-US'}", "xmlns" => 'http://www.w3.org/2005/Atom' do
0
   xml.title "#{site.title || 'Mephisto'} - #{@section ? @section.name : 'All'}#{' Comments' if @comments && @articles.nil?}"
0
   xml.id "tag:#{request.host},#{Time.now.utc.year}:mephisto#{"/#{@section.path}" if @section}#{ '/comments' if @comments && @articles.nil?}"
0
   xml.generator "Mephisto #{Mephisto::Version::TITLE}", :uri => "http://mephistoblog.com", :version => "#{Mephisto::Version::STRING}"
...
16
17
18
 
19
20
21
...
26
27
28
 
29
30
31
...
33
34
35
 
36
37
38
...
16
17
18
19
20
21
22
...
27
28
29
30
31
32
33
...
35
36
37
38
39
40
41
0
@@ -16,6 +16,7 @@
0
   username: root
0
   password:
0
   host: localhost
0
+ encoding: utf8
0
 
0
 # Warning: The database defined as 'test' will be erased and
0
 # re-generated from your development database when you run 'rake'.
0
@@ -26,6 +27,7 @@
0
   username: root
0
   password:
0
   host: localhost
0
+ encoding: utf8
0
 
0
 production:
0
   adapter: mysql
0
@@ -33,6 +35,7 @@
0
   username: root
0
   password:
0
   host: localhost
0
+ encoding: utf8
0
 
0
 
0
 ### Example database connections. You can safely delete these. ###
...
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
0
@@ -1 +1,10 @@
0
+class AddLangToSites < ActiveRecord::Migration
0
+ def self.up
0
+ add_column :sites, :lang, :string, :null => false, :default => 'en-US'
0
+ end
0
+
0
+ def self.down
0
+ remove_column :sites, :lang
0
+ end
0
+end

Comments

    No one has commented yet.